ElementsProject / libwally-core

Useful primitives for wallets
Other
284 stars 136 forks source link

Error while installing: "no configuration information is in src/secp256k1" #314

Closed zerotobtc closed 2 years ago

zerotobtc commented 2 years ago

I am trying to install libwally on my debian machine. I followed the installation guide but running ./configureI got the warning

=== configuring in src/secp256k1 (/home/standup/libwally-core/src/secp256k1)
configure: WARNING: no configuration information is in src/secp256k1

so when I run make I get the error

Making all in src
make[1]: Entering directory '/home/standup/libwally-core/src'
make  all-recursive
make[2]: Entering directory '/home/standup/libwally-core/src'
Making all in secp256k1
make[3]: Entering directory '/home/standup/libwally-core/src/secp256k1'
make[3]: *** No rule to make target 'all'.  Stop.
make[3]: Leaving directory '/home/standup/libwally-core/src/secp256k1'
make[2]: *** [Makefile:1715: all-recursive] Error 1
make[2]: Leaving directory '/home/standup/libwally-core/src'
make[1]: *** [Makefile:927: all] Error 2
make[1]: Leaving directory '/home/standup/libwally-core/src'
make: *** [Makefile:436: all-recursive] Error 1

I see that it's an issue with the secp256k1 so I did some research and found this suggestion to install secp256k1 seperately in the /src directory (I simply cloned the repo and built it within /src). This brought me a bit further (no warning while running ./configure) but I still get this error after running make:

Making all in src
make[1]: Entering directory '/home/standup/libwally-core/src'
make  all-recursive
make[2]: Entering directory '/home/standup/libwally-core/src'
Making all in secp256k1
make[3]: Entering directory '/home/standup/libwally-core/src/secp256k1'
make  all-am
make[4]: Entering directory '/home/standup/libwally-core/src/secp256k1'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/standup/libwally-core/src/secp256k1'
make[3]: Leaving directory '/home/standup/libwally-core/src/secp256k1'
make[3]: Entering directory '/home/standup/libwally-core/src'
  CC       ctest/test_bech32-test_bech32.o
  CC       libwallycore_la-address.lo
In file included from address.c:1:
internal.h:8:10: fatal error: secp256k1/include/secp256k1_ecdsa_s2c.h: No such file or directory
    8 | #include "secp256k1/include/secp256k1_ecdsa_s2c.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [Makefile:1324: libwallycore_la-address.lo] Error 1
make[3]: Leaving directory '/home/standup/libwally-core/src'
make[2]: *** [Makefile:1715: all-recursive] Error 1
make[2]: Leaving directory '/home/standup/libwally-core/src'
make[1]: *** [Makefile:927: all] Error 2
make[1]: Leaving directory '/home/standup/libwally-core/src'
make: *** [Makefile:436: all-recursive] Error 1

There is no secp256k1/include/secp256k1_ecdsa_s2c.h file ...

How can I fix this? It already seemed strange to me that I had to install the secp256k1 manually...

zerotobtc commented 2 years ago

I installed the fork of bitcoin-core's secp256k1 manually, now it works.

jgriffiths commented 2 years ago

Hi @zerotobtc

I think you may have missed the README section on building:

# Initialise the libsecp sources (Needs to be run only once)
$ git submodule init
$ git submodule sync --recursive
$ git submodule update --init --recursive

This will sync libsecp sources using git submodules rather than you cloning a potentially incompatible version yourself.

Also in the current branch, you can build with the standard libsecp sources if you wish using --enable-standard-secp, although this will disable some features such as elements support.

pdxwebdev commented 4 months ago

Hi @zerotobtc

I think you may have missed the README section on building:

For posterity, this is missing from the Ubuntu instructions.