--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/Writerside/topics/install.md Thu Jan 23 01:15:52 2025 +0100 @@ -0,0 +1,139 @@ +--- +title: Build Instructions +--- + +The build processes uses configure and make. +Make sure that you have `make` and a +<tooltip term="supported-compilers">supported compiler</tooltip> +installed. + +<tabs> +<tab title="Unix / Linux"> +<procedure> +<step> +Download the latest source archive from <a href="https://sourceforge.net/projects/ucx/files/">Source Forge</a> +and extract it somewhere on your machine. +You can also use the command line to do this. +<code-block lang="sh"> +wget https://sourceforge.net/projects/ucx/files/ucx-latest.tar.gz +tar -xzf ucx-latest.tar.gz +cd ucx-latest +</code-block> +</step> +<step> +Configure the build according to your preferences. You can get a list of +all available options with <code>./configure --help</code>. +The recommended configuration for production builds is <code>./configure --release</code>. +<code-block lang="sh"> + ./configure --release + make + make check + sudo make install +</code-block> +<note>The check target is optional and only runs some tests with the built software.</note> +</step> +</procedure> +</tab> +<tab title="Windows"> +<procedure> +<step> +Download the latest source archive from <a href="https://sourceforge.net/projects/ucx/files/">Source Forge</a> +and extract it somewhere on your machine. +</step> +<step> +Navigate to the folder named <code>msvc</code> in the extracted directory structure. +</step> +<step> +Open the contained <code>ucx.sln</code> in Visual Studio and build the solution. +</step> +</procedure> +</tab> +</tabs> + +## 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. + +<table> +<tr> +<th>Macro</th> +<th>Effect</th> +</tr> +<tr> + <td>CX_NO_SZMUL_BUILTINT</td> + <td> + 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. + <tip> + This macro is defined when you use the <code>--disable-szmul-builtin</code> + option during configuration, so you do not need to define it manually. + </tip> + </td> +</tr> +</table> + +### Small Buffer Optimizations + +<table> +<tr> +<th>Macro</th> +<th>Description</th> +<th>Default</th> +</tr> +<tr> + <td>CX_ARRAY_SWAP_SBO_SIZE</td> + <td>The maximum item size in an array list that uses SBO.</td> + <td>128</td> +</tr> +<tr> + <td>CX_LINKED_LIST_SORT_SBO_SIZE</td> + <td>The maximum list size that uses SBO during sort.</td> + <td>1024</td> +</tr> +<tr> + <td>CX_PRINTF_SBO_SIZE</td> + <td>The maximum string length functions in printf.h use stack memory for.</td> + <td>512</td> +</tr> +<tr> + <td>CX_STRSTR_SBO_SIZE</td> + <td>The maximum length of the "needle" in cx_strstr that can use SBO.</td> + <td>128</td> +</tr> +</table> + + +### Other Buffers + +<table> +<tr> +<th>Macro</th> +<th>Description</th> +<th>Default</th> +</tr> +<tr> + <td>CX_STRREPLACE_INDEX_BUFFER_SIZE</td> + <td> + 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. + </td> + <td>64</td> +</tr> +<tr> + <td>CX_STREAM_COPY_BUF_SIZE</td> + <td>The buffer size on the stack for a stream copy.</td> + <td>1024</td> +</tr> +<tr> + <td>CX_STREAM_BCOPY_BUF_SIZE</td> + <td>The buffer size on the heap for a stream copy.</td> + <td>8192</td> +</tr> +</table>