Compiler error with ecmult generation #1161

issue cryptoquick opened this issue on November 24, 2022
  1. cryptoquick commented at 4:05 AM on November 24, 2022: none

    I'm trying to compile a performant version of this library for testing on my local machine. I experimented with the following flags: CFLAGS="-O3" ./configure --with-ecmult-window=24 --with-ecmult-gen-precision=8 After running make -j 1, I got this error:

    make  all-am
    make[1]: Entering directory '/home/.../rust-secp256k1/secp256k1-sys/depend/secp256k1'
      CC       src/bench.o
    src/bench.c: In function 'main':
    src/bench.c:191:16: warning: implicit declaration of function 'rustsecp256k1_v0_6_1_context_create'; did you mean 'rustsecp256k1_v0_6_1_context_randomize'? [-Wimplicit-function-declaration]
      191 |     data.ctx = rustsecp256k1_v0_6_1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);
          |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                rustsecp256k1_v0_6_1_context_randomize
    src/bench.c:191:16: warning: nested extern declaration of 'rustsecp256k1_v0_6_1_context_create' [-Wnested-externs]
    src/bench.c:191:14: warning: assignment to 'rustsecp256k1_v0_6_1_context *' {aka 'struct rustsecp256k1_v0_6_1_context_struct *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
      191 |     data.ctx = rustsecp256k1_v0_6_1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);
          |              ^
    src/bench.c:209:5: warning: implicit declaration of function 'rustsecp256k1_v0_6_1_context_destroy'; did you mean 'rustsecp256k1_v0_6_1_context_randomize'? [-Wimplicit-function-declaration]
      209 |     rustsecp256k1_v0_6_1_context_destroy(data.ctx);
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |     rustsecp256k1_v0_6_1_context_randomize
    src/bench.c:209:5: warning: nested extern declaration of 'rustsecp256k1_v0_6_1_context_destroy' [-Wnested-externs]
    src/bench.c:212:14: warning: assignment to 'rustsecp256k1_v0_6_1_context *' {aka 'struct rustsecp256k1_v0_6_1_context_struct *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
      212 |     data.ctx = rustsecp256k1_v0_6_1_context_create(SECP256K1_CONTEXT_SIGN);
          |              ^
    make[1]: *** No rule to make target 'libsecp256k1.c', needed by 'libsecp256k1.lo'.  Stop.
    make[1]: Leaving directory '/home/.../rust-secp256k1/secp256k1-sys/depend/secp256k1'
    make: *** [Makefile:825: all] Error 2
    

    How can I resolve this error, and are there any other performance optimizations I can make use of?

    Also, it's worth noting, in troubleshooting this error, it seems to build fine if I stay on the happy path with defaults, following the build instructions in the README.

    Not sure if it's helpful to mention or relevant, but I'm building on a Zen 2 AMD system running Arch Linux with 128GB of DDR4.

  2. sipa commented at 4:07 AM on November 24, 2022: contributor

    You should probably post this as an issue for rust-secp256k1, as the build system does seem influenced by that.

    However, setting the ecmult-gen precision to 8 is almost certainly slower than 4 (the default).

  3. cryptoquick commented at 4:27 AM on November 24, 2022: none

    I just noticed that, thank you. And that's a good recommendation, will do.

  4. cryptoquick closed this on Nov 24, 2022

Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-06-04 04:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me