Build Instructions

The build processes uses CMake starting with UCX 3.0. First, download the source code from Source Forge.

wget https://sourceforge.net/projects/ucx/files/ucx-latest.tar.gz
tar -xzf ucx-latest.tar.gz
cd ucx-latest

Then create a build directory and use cmake to create the build files, execute the build, and - optionally - install the files.

mkdir build
cd build
cmake ..
cmake --build .
sudo cmake --install .

When compiling UCX 3, you can tweak the buffer sizes for small-buffer-optimization. You can do this, be pre-defining one or more of the following macros:

Macro Description Default
CX_ARRAY_SWAP_SBO_SIZE The maximum item size in an array list that uses SBO. 128
CX_LINKED_LIST_SORT_SBO_SIZE The maximum list size that uses SBO during sort. 1024
CX_LINKED_LIST_SWAP_SBO_SIZE The maximum item size that uses SBO swap instead of relinking. 128
CX_PRINTF_SBO_SIZE The maximum string length printf.h uses stack memory for. 512
CX_STRSTR_SBO_SIZE The maximum length of the “needle” in strstr that can use SBO. 512

You can also tweak some other buffer sizes with the same technique:

Macro Description Default
CX_STRREPLACE_INDEX_BUFFER_SIZE The number of matches one index buffer can store. 64
CX_STREAM_COPY_BUF_SIZE The buffer size on the stack for a stream copy. 1024
CX_STREAM_BCOPY_BUF_SIZE The buffer size on the heap for a stream copy. 8192

UCX 2.1

The build procedure for UCX 2.1 uses a configure script. For Microsoft Windows, you will need an appropriate port of the linux tools (like MinGW or Cygwin). First, download the source code from Source Forge.

wget https://sourceforge.net/projects/ucx/files/ucx-2.1.0.tar.gz
tar -xzf ucx-2.1.0.tar.gz
cd ucx-2.1.0

Then issue the configure and make commands.

./configure && make

To verify your installment you can issue make check. If everything is fine, you can install UCX with

make install

Note, that you might need administrative privileges for a system wide installation.