|
1 --- |
|
2 title: Build Instructions |
|
3 --- |
|
4 |
|
5 The build processes uses configure and make. |
|
6 Make sure that you have `make` and a |
|
7 <tooltip term="supported-compilers">supported compiler</tooltip> |
|
8 installed. |
|
9 |
|
10 <tabs> |
|
11 <tab title="Unix / Linux"> |
|
12 <procedure> |
|
13 <step> |
|
14 Download the latest source archive from <a href="https://sourceforge.net/projects/ucx/files/">Source Forge</a> |
|
15 and extract it somewhere on your machine. |
|
16 You can also use the command line to do this. |
|
17 <code-block lang="sh"> |
|
18 wget https://sourceforge.net/projects/ucx/files/ucx-latest.tar.gz |
|
19 tar -xzf ucx-latest.tar.gz |
|
20 cd ucx-latest |
|
21 </code-block> |
|
22 </step> |
|
23 <step> |
|
24 Configure the build according to your preferences. You can get a list of |
|
25 all available options with <code>./configure --help</code>. |
|
26 The recommended configuration for production builds is <code>./configure --release</code>. |
|
27 <code-block lang="sh"> |
|
28 ./configure --release |
|
29 make |
|
30 make check |
|
31 sudo make install |
|
32 </code-block> |
|
33 <note>The check target is optional and only runs some tests with the built software.</note> |
|
34 </step> |
|
35 </procedure> |
|
36 </tab> |
|
37 <tab title="Windows"> |
|
38 <procedure> |
|
39 <step> |
|
40 Download the latest source archive from <a href="https://sourceforge.net/projects/ucx/files/">Source Forge</a> |
|
41 and extract it somewhere on your machine. |
|
42 </step> |
|
43 <step> |
|
44 Navigate to the folder named <code>msvc</code> in the extracted directory structure. |
|
45 </step> |
|
46 <step> |
|
47 Open the contained <code>ucx.sln</code> in Visual Studio and build the solution. |
|
48 </step> |
|
49 </procedure> |
|
50 </tab> |
|
51 </tabs> |
|
52 |
|
53 ## Compile Time Options |
|
54 |
|
55 When compiling UCX, you can tweak several compile time variables via macro definitions. |
|
56 |
|
57 ### Features Defines |
|
58 |
|
59 The following macros are not defined by default. |
|
60 The effect when they are defined in described in the table. |
|
61 |
|
62 <table> |
|
63 <tr> |
|
64 <th>Macro</th> |
|
65 <th>Effect</th> |
|
66 </tr> |
|
67 <tr> |
|
68 <td>CX_NO_SZMUL_BUILTINT</td> |
|
69 <td> |
|
70 By default, UCX uses a compiler builtin (only available for clang and gcc) |
|
71 to perform multiplications with overflow check. |
|
72 When this macro is defined, using the builtin is disabled and UCX will |
|
73 always use an own implementation. |
|
74 <tip> |
|
75 This macro is defined when you use the <code>--disable-szmul-builtin</code> |
|
76 option during configuration, so you do not need to define it manually. |
|
77 </tip> |
|
78 </td> |
|
79 </tr> |
|
80 </table> |
|
81 |
|
82 ### Small Buffer Optimizations |
|
83 |
|
84 <table> |
|
85 <tr> |
|
86 <th>Macro</th> |
|
87 <th>Description</th> |
|
88 <th>Default</th> |
|
89 </tr> |
|
90 <tr> |
|
91 <td>CX_ARRAY_SWAP_SBO_SIZE</td> |
|
92 <td>The maximum item size in an array list that uses SBO.</td> |
|
93 <td>128</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td>CX_LINKED_LIST_SORT_SBO_SIZE</td> |
|
97 <td>The maximum list size that uses SBO during sort.</td> |
|
98 <td>1024</td> |
|
99 </tr> |
|
100 <tr> |
|
101 <td>CX_PRINTF_SBO_SIZE</td> |
|
102 <td>The maximum string length functions in printf.h use stack memory for.</td> |
|
103 <td>512</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td>CX_STRSTR_SBO_SIZE</td> |
|
107 <td>The maximum length of the "needle" in cx_strstr that can use SBO.</td> |
|
108 <td>128</td> |
|
109 </tr> |
|
110 </table> |
|
111 |
|
112 |
|
113 ### Other Buffers |
|
114 |
|
115 <table> |
|
116 <tr> |
|
117 <th>Macro</th> |
|
118 <th>Description</th> |
|
119 <th>Default</th> |
|
120 </tr> |
|
121 <tr> |
|
122 <td>CX_STRREPLACE_INDEX_BUFFER_SIZE</td> |
|
123 <td> |
|
124 The number of matches the index buffer can store on the stack. |
|
125 If the function finds more matches, more index buffers of the same size are allocated on the heap. |
|
126 </td> |
|
127 <td>64</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td>CX_STREAM_COPY_BUF_SIZE</td> |
|
131 <td>The buffer size on the stack for a stream copy.</td> |
|
132 <td>1024</td> |
|
133 </tr> |
|
134 <tr> |
|
135 <td>CX_STREAM_BCOPY_BUF_SIZE</td> |
|
136 <td>The buffer size on the heap for a stream copy.</td> |
|
137 <td>8192</td> |
|
138 </tr> |
|
139 </table> |