Skip to content

Commit b048f21

Browse files
committed
Add section for configuration flags
1 parent e53bc0b commit b048f21

File tree

1 file changed

+151
-1
lines changed

1 file changed

+151
-1
lines changed

README.md

+151-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,157 @@ libsecp256k1 is built using autotools:
7171
$ make check # run the test suite
7272
$ sudo make install # optional
7373

74-
To compile optional modules (such as Schnorr signatures), you need to run `./configure` with additional flags (such as `--enable-module-schnorrsig`). Run `./configure --help` to see the full list of available flags.
74+
75+
To compile optional modules (such as Schnorr signatures), you need to run `./configure` with additional flags (such as `--enable-module-schnorrsig`). Run `./configure --help` to see the full list of available flags and environment variables.
76+
77+
Configuration flags
78+
-----------
79+
80+
The build process recognizes the following flags. Unless otherwise specified, valid values for each option are "yes" and "no".
81+
82+
### Toggle Dev-Mode
83+
84+
| Autotools | Manual | Default |
85+
|---------------------|--------------------|---------|
86+
| `--enable-dev_mode` | None | no |
87+
88+
In dev mode, all binaries and modules are enabled by default but individual options can still be overridden explicitly. Options may have different default values when in dev-mode. This option is hidden from `./configure --help`.
89+
90+
91+
### Enable Coverage
92+
93+
| Autotools | Manual | Default | Default (dev-mode) |
94+
|---------------------|---------------------|---------|--------------------|
95+
| `--enable-coverage` | `-DENABLE_COVERAGE` | no | no |
96+
97+
Enable compiler flags to support kcov coverage analysis. Compiles out all VERIFY code as a side effect.
98+
99+
### Enable Benchmarks
100+
101+
| Autotools | Manual | Default | Default (dev-mode) |
102+
|----------------------|----------------------|---------|--------------------|
103+
| `--enable-benchmark` | `-DENABLE_BENCHMARK` | yes | yes |
104+
105+
Additionally compile the benchmarks.
106+
107+
108+
### Enable Tests
109+
110+
| Autotools | Manual | Default | Default (dev-mode) |
111+
|------------------|------------------|---------|--------------------|
112+
| `--enable-tests` | `-DENABLE_TESTS` | yes | yes |
113+
114+
Additionally compile the tests.
115+
116+
### Enable Exhaustive tests
117+
118+
| Autotools | Manual | Default | Default (dev-mode) |
119+
|-----------------------------|-----------------------------|---------|--------------------|
120+
| `--enable-exhaustive-tests` | `-DENABLE_EXHAUSTIVE_TESTS` | yes | yes |
121+
122+
Additionally compile the tests.
123+
124+
### Enable Examples
125+
126+
| Autotools | Manual | Default | Default (dev-mode) |
127+
|---------------------|---------------------|---------|--------------------|
128+
| `--enable-examples` | `-DENABLE_EXAMPLES` | no | yes |
129+
130+
Additionally compile the examples.
131+
132+
### Enable Valgrind Checks
133+
134+
| Autotools | Manual | Default | Default (dev-mode) |
135+
|-------------------|--------|-----------|---------------------|
136+
| `--with-valgrind` | None | auto | auto |
137+
138+
Build with extra checks for running inside Valgrind. Valid values are "yes", "no", and "auto".
139+
140+
### Enable External Default Callbacks
141+
142+
| Autotools | Manual | Default | Default (dev-mode) |
143+
|---------------------------------------|--------------------------------------|---------|--------------------|
144+
| `--enable-external-default-callbacks` | `-DUSE_EXTERNAL_DEFAULT_CALLBACKS` | no | no |
145+
146+
Enable external default callback functions. Ensure that you supply them in your code, otherwise you will get a linker error.
147+
148+
### Allow Experimental Options
149+
150+
| Autotools | Manual | Default | Default (dev-mode) |
151+
|-------------------------|-------------------------|---------|--------------------|
152+
| `--enable-experimental` | `-DENABLE_EXPERIMENTAL` | no | yes |
153+
154+
Allow passing of experimental build options. The following options are experimental:
155+
156+
- `--with-asm=arm`
157+
158+
### Enable ECDH Module
159+
160+
| Autotools | Manual | Default | Default (dev-mode) |
161+
|------------------------|------------------------|---------|--------------------|
162+
| `--enable-module-ecdh` | `-DENABLE_MODULE_ECDH` | no | yes |
163+
164+
Enable the ECDH module.
165+
166+
### Enable Recovery Module
167+
168+
| Autotools | Manual | Default | Default (dev-mode) |
169+
|----------------------------|----------------------------|---------|--------------------|
170+
| `--enable-module-recovery` | `-DENABLE_MODULE_RECOVERY` | no | yes |
171+
172+
Enable the ECDSA public key recovery module.
173+
174+
### Enable Extrakeys Module
175+
176+
| Autotools | Manual | Default | Default (dev-mode) |
177+
|-----------------------------|-----------------------------|---------|--------------------|
178+
| `--enable-module-extrakeys` | `-DENABLE_MODULE_EXTRAKEYS` | no | yes |
179+
180+
Enable the extrakeys module. Extrakeys exports miscellaneous and supplimentary public key functions.
181+
182+
### Enable Schnorrsig Module
183+
184+
| Autotools | Manual | Default | Default (dev-mode) |
185+
|------------------------------|------------------------------|---------|--------------------|
186+
| `--enable-module-schnorrsig` | `-DENABLE_MODULE_SCHNORRSIG` | no | yes |
187+
188+
Enable the Schnorr signatures module.
189+
190+
### Override `widemul` Setting
191+
192+
| Autotools | Manual | Default | Default (dev-mode) |
193+
|--------------------------------------|-----------|---------|--------------------|
194+
| `--with-test-override-wide-multiply` | See below | auto | auto |
195+
196+
Test-only override of the (autodetected by the C code) "widemul" setting, used in the multiplication implementation. Legal values are "int64" (for `[u]int64_t`), "int128" (for `[unsigned] __int128`), and "auto" (the default).
197+
198+
`-DUSE_FORCE_WIDEMUL_INT128` is passed when "int128" is specified, and `-DUSE_FORCE_WIDEMUL_INT64` is passed when int64 is specified. Neither option is passed when "auto" is specified.
199+
200+
### Assembly Optimizations
201+
202+
| Autotools | Manual | Default | Default (dev-mode) |
203+
|--------------|-----------|---------|--------------------|
204+
| `--with-asm` | See below | auto | auto |
205+
206+
Specifies the assembly options to use. Legal values are "x86_64", "arm", "no", and "auto". Please note that --with-asm=arm is an experimental option (see [Allow Experimental Options](#allow-experimental-options).
207+
208+
`-USE_ASM_X86_64` is passed when "x86_64" is specified. `-DUSE_EXTERNAL_ASM` is passed when "arm" is passed. When "auto" is passed, the system checks if assembly optimizations are available for the current architecture and sets one of the above macros accordingly. Passing "none" completely disables assembly optimizations.
209+
210+
### Tune `ecmult` Table Window
211+
212+
| Autotools | Manual | Default | Default (dev-mode) |
213+
|------------------------|------------------------|---------|--------------------|
214+
| `--with-ecmult-window` | `-DECMULT_WINDOW_SIZE` | auto | auto |
215+
216+
Window size for ecmult precomputation for verification, specified as integer in range `[2..24]`. Larger values result in possibly better performance at the cost of an exponentially larger precomputed table. The table will store `2^(SIZE-1) * 64` bytes of data but can be larger in memory due to platform-specific padding and alignment. A window size larger than 15 will require you delete the prebuilt precomputed_ecmult.c file so that it can be rebuilt. For very large window sizes, use `make -j 1` to reduce memory use during compilation. "auto" is a reasonable setting for desktop machines (currently 15).
217+
218+
### Tune `ecmult` Bit Precision
219+
220+
| Autotools | Manual | Default | Default (dev-mode) |
221+
|-------------------------------|--------------------------|---------|--------------------|
222+
| `--with-ecmult-gen-precision` | `-DECMULT_GEN_PREC_BITS` | auto | auto |
223+
224+
Precision bits to tune the precomputed table size for signing. Valid values are "2", "4", "8", and "auto". The size of the table is 32kB for 2 bits, 64kB for 4 bits, 512kB for 8 bits of precision. A larger table size usually results in possible faster signing. "auto" is a reasonable setting for desktop machines (currently 4).
75225

76226
Usage examples
77227
-----------

0 commit comments

Comments
 (0)