diff -r 0f70bb04f7ba -r b0300de92b72 docs/Writerside/topics/install.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/Writerside/topics/install.md Tue Feb 11 19:55:32 2025 +0100 @@ -0,0 +1,165 @@ +--- +title: Build Instructions +--- + +The build processes uses configure and make. +Make sure that you have `make` and a +supported compiler +installed. + + + + + +Download the latest source archive from +Source Forge and extract it somewhere on your machine. +You can also use the command line to do this. + +wget https://sourceforge.net/projects/ucx/files/ucx-latest.tar.gz +tar -xzf ucx-latest.tar.gz +cd ucx-latest + + + +Configure the build according to your preferences. You can get a list of +all available options with ./configure --help. +The recommended configuration for production builds is ./configure --release. + + ./configure --release + make + make check + sudo make install + +The check target is optional and only runs some tests with the built software. + + + + + + +Download the latest source archive from +Source Forge and extract it somewhere on your machine. + + +Navigate to the folder named msvc in the extracted directory structure. + + +Open the contained ucx.sln in Visual Studio and build the solution. + + +The libucx project in the solution will produce a libucx.lib that can be used for static linking +and the libucx_dll project will produce a libucx.dll and a libucx.dll.lib import lib for dynamic linking. + + + +For native Windows projects it is recommended to statically link UCX. + + + + +## Compile Time Options + +When compiling UCX, you can tweak several compile time variables via macro definitions. + +### Features Defines + +The following macros are not defined by default. +The effect when they are defined in described in the table. + + + + + + + + + + + + + + + + + + +
MacroEffect
CX_NO_SZMUL_BUILTINT + By default, UCX uses a compiler builtin (only available for clang and gcc) + to perform multiplications with overflow check. + When this macro is defined, using the builtin is disabled and UCX will + always use an own implementation. + + This macro is defined when you use the --disable-szmul-builtin + option during configuration, so you do not need to define it manually. + +
CX_WINDLL + Define this macro during compilation of the project that is using + UCX as a Windows DLL to import the symbols. + In general it is recommended to use UCX as a static library under Windows, though. +
CX_WINDLL_EXPORT + Define this macro during compilation of UCX to export symbols for a Windows DLL. + The Visual Studio Solution does that automatically. +
+ +### Small Buffer Optimizations + +With the following macros you can control the size of stack memory for small buffer optimizations. + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MacroDescriptionDefault
CX_ARRAY_SWAP_SBO_SIZEThe maximum item size in an array list that uses SBO.128
CX_LINKED_LIST_SORT_SBO_SIZEThe maximum list size that uses SBO during sort.1024
CX_PRINTF_SBO_SIZEThe maximum string length functions in printf.h use stack memory for.512
CX_STRSTR_SBO_SIZEThe maximum length of the "needle" in cx_strstr that can use SBO.128
+ + +### Other Buffers + +With the following macros you can control other buffer sizes that are not falling into the category of small buffer optimizations. + + + + + + + + + + + + + + + + + + + + + + +
MacroDescriptionDefault
CX_STRREPLACE_INDEX_BUFFER_SIZE + The number of matches the index buffer can store on the stack. + If the function finds more matches, more index buffers of the same size are allocated on the heap. + 64
CX_STREAM_COPY_BUF_SIZEThe buffer size on the stack for a stream copy.1024
CX_STREAM_BCOPY_BUF_SIZEThe buffer size on the heap for a stream copy.8192