Closed diop closed 4 years ago
I think you might be missing autoconf on your local machine. It's needed for secp256k1.
Can you try install autoconf and let me know if it works?
brew install autoconf
You'll also need automake and libtool too.
Hey Philip,
I do have autoconf
installed on my machine actually. Here's the total output I get.
Warning: autoconf 2.69 is already installed and up-to-date
To reinstall 2.69, run `brew reinstall autoconf`
bitcoinex on ξ master via π§ v1.10.3 took 51s
β mix compile
==> libsecp256k1 (compile)
Cloning into 'secp256k1'...
HEAD is now at 5a91bd7 Merge #400: A couple minor cleanups
Can't exec "aclocal": No such file or directory at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory
ERROR: Command [compile] failed!
** (Mix) Could not compile dependency :libsecp256k1, "/Users/fodediop/.mix/rebar compile skip_deps=true deps_dir="/Users/fodediop/dev/bitcoin/bitcoinex/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile libsecp256k1", update it with "mix deps.update libsecp256k1" or clean it with "mix deps.clean libsecp256k1"
bitcoinex on ξ master via π§ v1.10.3 took 6s
β mix deps.compile libsecp256k1
==> libsecp256k1 (compile)
fatal: destination path 'secp256k1' already exists and is not an empty directory.
ERROR: Command [compile] failed!
** (Mix) Could not compile dependency :libsecp256k1, "/Users/fodediop/.mix/rebar compile skip_deps=true deps_dir="/Users/fodediop/dev/bitcoin/bitcoinex/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile libsecp256k1", update it with "mix deps.update libsecp256k1" or clean it with "mix deps.clean libsecp256k1"
bitcoinex on ξ master via π§ v1.10.3
β mix deps.update libsecp256k1
* Updating libsecp256k1 (https://github.com/RiverFinancial/libsecp256k1.git)
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
bunt 0.2.0
certifi 2.5.1
combine 0.10.0
credo 1.0.5
decimal 1.7.0
dialyxir 1.0.0-rc.6
erlex 0.2.1
excoveralls 0.11.1
file_system 0.2.7
gettext 0.16.1
hackney 1.15.1
idna 6.0.0
jason 1.1.2
metrics 1.0.1
mimerl 1.2.0
mix_test_watch 0.9.0
parse_trans 3.3.0
ssl_verify_fun 1.1.4
stream_data 0.4.3
timex 3.5.0
tzdata 0.5.20
unicode_util_compat 0.4.1
bitcoinex on ξ master via π§ v1.10.3 took 4s
β mix deps.clean libsecp256k1
* Cleaning libsecp256k1
warning: the dependency libsecp256k1 is not present in the build directory
Hey @diop can you try running brew install automake
and see if that solves it. I think aclocal
is part of automake, not autoconf. Not sure from your previous comment if you already have that installed or not.
Hey Alex,
I do have automake
installed. I did it a couple of days ago digging around the web for the error.
bitcoinex on ξ master via π§ v1.10.3
β brew install automake
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (caskroom/cask).
==> Updated Casks
trader-workstation
Warning: automake 1.16.2 is already installed, it's just not linked
You can use `brew link automake` to link this version.
bitcoinex on ξ master via π§ v1.10.3 took 18s
β brew link automake
Linking /usr/local/Cellar/automake/1.16.2... 30 symlinks created
bitcoinex on ξ master via π§ v1.10.3 took 2s
β mix compile
Unchecked dependencies for environment dev:
* libsecp256k1 (https://github.com/RiverFinancial/libsecp256k1.git)
the dependency is not available, run "mix deps.get"
** (Mix) Can't continue due to errors on dependencies
bitcoinex on ξ master via π§ v1.10.3
β mix deps.get
* Getting libsecp256k1 (https://github.com/RiverFinancial/libsecp256k1.git)
remote: Enumerating objects: 95, done.
remote: Total 95 (delta 0), reused 0 (delta 0), pack-reused 95
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
bunt 0.2.0
certifi 2.5.1
combine 0.10.0
credo 1.0.5
decimal 1.7.0
dialyxir 1.0.0-rc.6
erlex 0.2.1
excoveralls 0.11.1
file_system 0.2.7
gettext 0.16.1
hackney 1.15.1
idna 6.0.0
jason 1.1.2
metrics 1.0.1
mimerl 1.2.0
mix_test_watch 0.9.0
parse_trans 3.3.0
ssl_verify_fun 1.1.4
stream_data 0.4.3
timex 3.5.0
tzdata 0.5.20
unicode_util_compat 0.4.1
bitcoinex on ξ master via π§ v1.10.3 took 4s
β mix compile
==> libsecp256k1 (compile)
Cloning into 'secp256k1'...
HEAD is now at 5a91bd7 Merge #400: A couple minor cleanups
Can't exec "glibtoolize": No such file or directory at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 345, <GEN2> line 5.
autoreconf: failed to run glibtoolize: No such file or directory
autoreconf: glibtoolize is needed because this package uses Libtool
ERROR: Command [compile] failed!
** (Mix) Could not compile dependency :libsecp256k1, "/Users/fodediop/.mix/rebar compile skip_deps=true deps_dir="/Users/fodediop/dev/bitcoin/bitcoinex/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile libsecp256k1", update it with "mix deps.update libsecp256k1" or clean it with "mix deps.clean libsecp256k1"
Seems this error is different than your first one? Looks like the new error is:
Can't exec "glibtoolize": No such file or directory at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 345, <GEN2> line 5.
I think you also need to do brew install libtool
. I'm looking at the deps for compiling Bitcoin Core on OSX: https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md#dependencies
Only some of them should be required for libsecp though. Does installing this solve the issue?
I just installed libtool
as well from the error. The output is now slightly different
bitcoinex on ξ master via π§ v1.10.3 took 4s
β mix compile
==> libsecp256k1 (compile)
Cloning into 'secp256k1'...
HEAD is now at 5a91bd7 Merge #400: A couple minor cleanups
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
glibtoolize: copying file 'build-aux/m4/libtool.m4'
glibtoolize: copying file 'build-aux/m4/ltoptions.m4'
glibtoolize: copying file 'build-aux/m4/ltsugar.m4'
glibtoolize: copying file 'build-aux/m4/ltversion.m4'
glibtoolize: copying file 'build-aux/m4/lt~obsolete.m4'
configure.ac:10: installing 'build-aux/compile'
configure.ac:5: installing 'build-aux/config.guess'
configure.ac:5: installing 'build-aux/config.sub'
configure.ac:9: installing 'build-aux/install-sh'
configure.ac:9: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'
checking build system type... x86_64-apple-darwin19.4.0
checking host system type... x86_64-apple-darwin19.4.0
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking whether cc understands -c and -o together... yes
checking dependency style of cc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... ld
checking if the linker (ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... nm
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin19.4.0 file names to x86_64-apple-darwin19.4.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin19.4.0 file names to toolchain format... func_convert_file_noop
checking for ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse nm output from cc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... cpp
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common -DPIC
checking if cc PIC flag -fno-common -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin19.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
./configure: line 12100: PKG_PROG_PKG_CONFIG: command not found
checking for ar... /usr/bin/ar
checking for ranlib... /usr/bin/ranlib
checking for strip... /usr/bin/strip
checking for gcc... gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for cc option to accept ISO C89... (cached) none needed
checking dependency style of cc... gcc3
checking for brew... /usr/local/bin/brew
checking if cc supports -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings... yes
checking if cc supports -fvisibility=hidden... yes
checking for __int128... yes
checking for __builtin_expect... yes
checking native compiler: gcc... ok
checking for x86_64 assembly availability... yes
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for __gmpz_init in -lgmp... yes
checking openssl/crypto.h usability... no
checking openssl/crypto.h presence... no
checking for openssl/crypto.h... no
checking for javac... /usr/bin/javac
checking symlink for /usr/bin/javac... /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
checking jni headers... none
configure: WARNING: jni headers/dependencies not found. jni support disabled
checking whether byte ordering is bigendian... no
configure: Using static precomputation: yes
configure: Using assembly optimizations: x86_64
configure: Using field implementation: 64bit
configure: Using bignum implementation: gmp
configure: Using scalar implementation: 64bit
configure: Using endomorphism optimizations: no
configure: Building ECDH module: no
configure: Building Schnorr signatures module: no
configure: Building ECDSA pubkey recovery module: yes
configure: Using jni: no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libsecp256k1.pc
config.status: creating src/libsecp256k1-config.h
config.status: executing depfiles commands
config.status: executing libtool commands
CC src/tests-tests.o
CCLD tests
CC src/libsecp256k1_la-secp256k1.lo
CCLD libsecp256k1.la
Compiled src/libsecp256k1.erl
Compiling c_src/libsecp256k1_nif.c
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:10:
In file included from c_src/secp256k1/src/num_impl.h:14:
In file included from c_src/secp256k1/src/num.h:17:
c_src/secp256k1/src/num_gmp.h:10:10: fatal error: 'gmp.h' file not found
#include <gmp.h>
^~~~~~~
1 error generated.
ERROR: compile failed while processing /Users/fodediop/dev/bitcoin/bitcoinex/deps/libsecp256k1: rebar_abort
** (Mix) Could not compile dependency :libsecp256k1, "/Users/fodediop/.mix/rebar compile skip_deps=true deps_dir="/Users/fodediop/dev/bitcoin/bitcoinex/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile libsecp256k1", update it with "mix deps.update libsecp256k1" or clean it with "mix deps.clean libsecp256k1"
I'm going ahead and installing all the extra required packages from the Bitcoin Core page.
brew install gmp
should do the trick here
gmp
is now installed, but I'm unfortunately getting more errors:
bitcoinex on ξ master via π§ v1.10.3 took 4s
β mix compile
==> libsecp256k1 (compile)
Cloning into 'secp256k1'...
HEAD is now at 5a91bd7 Merge #400: A couple minor cleanups
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
glibtoolize: copying file 'build-aux/m4/libtool.m4'
glibtoolize: copying file 'build-aux/m4/ltoptions.m4'
glibtoolize: copying file 'build-aux/m4/ltsugar.m4'
glibtoolize: copying file 'build-aux/m4/ltversion.m4'
glibtoolize: copying file 'build-aux/m4/lt~obsolete.m4'
configure.ac:10: installing 'build-aux/compile'
configure.ac:5: installing 'build-aux/config.guess'
configure.ac:5: installing 'build-aux/config.sub'
configure.ac:9: installing 'build-aux/install-sh'
configure.ac:9: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'
checking build system type... x86_64-apple-darwin19.4.0
checking host system type... x86_64-apple-darwin19.4.0
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking whether cc understands -c and -o together... yes
checking dependency style of cc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... ld
checking if the linker (ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... nm
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin19.4.0 file names to x86_64-apple-darwin19.4.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin19.4.0 file names to toolchain format... func_convert_file_noop
checking for ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse nm output from cc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... cpp
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common -DPIC
checking if cc PIC flag -fno-common -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin19.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ar... /usr/bin/ar
checking for ranlib... /usr/bin/ranlib
checking for strip... /usr/bin/strip
checking for gcc... gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for cc option to accept ISO C89... (cached) none needed
checking dependency style of cc... gcc3
checking for brew... /usr/local/bin/brew
checking if cc supports -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings... yes
checking if cc supports -fvisibility=hidden... yes
checking for __int128... yes
checking for __builtin_expect... yes
checking native compiler: gcc... ok
checking for x86_64 assembly availability... yes
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for __gmpz_init in -lgmp... yes
checking for libcrypto... yes
checking for main in -lcrypto... yes
checking for EC functions in libcrypto... no
checking for javac... /usr/bin/javac
checking symlink for /usr/bin/javac... /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
checking jni headers... none
configure: WARNING: jni headers/dependencies not found. jni support disabled
checking whether byte ordering is bigendian... no
configure: Using static precomputation: yes
configure: Using assembly optimizations: x86_64
configure: Using field implementation: 64bit
configure: Using bignum implementation: gmp
configure: Using scalar implementation: 64bit
configure: Using endomorphism optimizations: no
configure: Building ECDH module: no
configure: Building Schnorr signatures module: no
configure: Building ECDSA pubkey recovery module: yes
configure: Using jni: no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libsecp256k1.pc
config.status: creating src/libsecp256k1-config.h
config.status: executing depfiles commands
config.status: executing libtool commands
CC src/tests-tests.o
CCLD tests
CC src/libsecp256k1_la-secp256k1.lo
CCLD libsecp256k1.la
Compiled src/libsecp256k1.erl
Compiling c_src/libsecp256k1_nif.c
c_src/libsecp256k1_nif.c:494:51: warning: incompatible pointer types passing 'unsigned char (*)[74]' to parameter of type 'unsigned char *' [-Wincompatible-pointer-types]
if (secp256k1_ecdsa_signature_serialize_der(ctx, &intermediatesig, &siglen, &signature) != 1) {
^~~~~~~~~~~~~~~~
c_src/secp256k1/src/secp256k1.c:249:90: note: passing argument to parameter 'output' here
int secp256k1_ecdsa_signature_serialize_der(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_ecdsa_signature* sig) {
^
c_src/libsecp256k1_nif.c:497:64: warning: incompatible pointer types passing 'unsigned char (*)[74]' to parameter of type 'const unsigned char *' [-Wincompatible-pointer-types]
CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &signature, &intermediatesig, siglen) == 1);
^~~~~~~~~~~~~~~~
c_src/secp256k1/src/util.h:53:18: note: expanded from macro 'CHECK'
if (EXPECT(!(cond), 0)) { \
^~~~
c_src/secp256k1/src/util.h:40:39: note: expanded from macro 'EXPECT'
#define EXPECT(x,c) __builtin_expect((x),(c))
^
c_src/secp256k1/src/secp256k1.c:212:124: note: passing argument to parameter 'input' here
int secp256k1_ecdsa_signature_parse_der(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:10:
In file included from c_src/secp256k1/src/num_impl.h:17:
c_src/secp256k1/src/num_gmp_impl.h:25:13: warning: unused function 'secp256k1_num_copy' [-Wunused-function]
static void secp256k1_num_copy(secp256k1_num *r, const secp256k1_num *a) {
^
c_src/secp256k1/src/num_gmp_impl.h:191:12: warning: unused function 'secp256k1_num_eq' [-Wunused-function]
static int secp256k1_num_eq(const secp256k1_num *a, const secp256k1_num *b) {
^
c_src/secp256k1/src/num_gmp_impl.h:223:13: warning: unused function 'secp256k1_num_add' [-Wunused-function]
static void secp256k1_num_add(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {
^
c_src/secp256k1/src/num_gmp_impl.h:229:13: warning: unused function 'secp256k1_num_sub' [-Wunused-function]
static void secp256k1_num_sub(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {
^
c_src/secp256k1/src/num_gmp_impl.h:235:13: warning: unused function 'secp256k1_num_mul' [-Wunused-function]
static void secp256k1_num_mul(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {
^
c_src/secp256k1/src/num_gmp_impl.h:81:13: warning: unused function 'secp256k1_num_mod' [-Wunused-function]
static void secp256k1_num_mod(secp256k1_num *r, const secp256k1_num *m) {
^
c_src/secp256k1/src/num_gmp_impl.h:262:13: warning: unused function 'secp256k1_num_shift' [-Wunused-function]
static void secp256k1_num_shift(secp256k1_num *r, int bits) {
^
c_src/secp256k1/src/num_gmp_impl.h:169:12: warning: unused function 'secp256k1_num_is_one' [-Wunused-function]
static int secp256k1_num_is_one(const secp256k1_num *a) {
^
c_src/secp256k1/src/num_gmp_impl.h:177:12: warning: unused function 'secp256k1_num_is_neg' [-Wunused-function]
static int secp256k1_num_is_neg(const secp256k1_num *a) {
^
c_src/secp256k1/src/num_gmp_impl.h:284:13: warning: unused function 'secp256k1_num_negate' [-Wunused-function]
static void secp256k1_num_negate(secp256k1_num *r) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:11:
In file included from c_src/secp256k1/src/field_impl.h:19:
c_src/secp256k1/src/field_5x52_impl.h:53:13: warning: unused function 'secp256k1_fe_verify' [-Wunused-function]
static void secp256k1_fe_verify(const secp256k1_fe *a) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:13:
c_src/secp256k1/src/group_impl.h:630:12: warning: unused function 'secp256k1_gej_has_quad_y_var' [-Wunused-function]
static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:12:
c_src/secp256k1/src/scalar_impl.h:26:13: warning: unused function 'secp256k1_scalar_get_num' [-Wunused-function]
static void secp256k1_scalar_get_num(secp256k1_num *r, const secp256k1_scalar *a) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:13:
c_src/secp256k1/src/group_impl.h:217:12: warning: unused function 'secp256k1_gej_is_valid_var' [-Wunused-function]
static int secp256k1_gej_is_valid_var(const secp256k1_gej *a) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:15:
c_src/secp256k1/src/ecmult_const_impl.h:122:13: warning: unused function 'secp256k1_ecmult_const' [-Wunused-function]
static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *scalar) {
^
In file included from c_src/libsecp256k1_nif.c:11:
c_src/secp256k1/src/testrand_impl.h:47:17: warning: unused function 'secp256k1_rand_int' [-Wunused-function]
static uint32_t secp256k1_rand_int(uint32_t range) {
^
c_src/secp256k1/src/testrand_impl.h:106:13: warning: unused function 'secp256k1_rand256_test' [-Wunused-function]
static void secp256k1_rand256_test(unsigned char *b32) {
^
19 warnings generated.
ld: library not found for -lerl_interface
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: sh(cc c_src/libsecp256k1_nif.o $LDFLAGS -bundle -flat_namespace -undefined suppress -L"/usr/local/Cellar/erlang/23.0.2/lib/erlang/lib/erl_interface-4.0/lib" -lerl_interface -lei c_src/secp256k1/.libs/libsecp256k1.a -lgmp -o priv/libsecp256k1_nif.so)
failed with return code 1 and the following output:
ld: library not found for -lerl_interface
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: compile failed while processing /Users/fodediop/dev/bitcoin/bitcoinex/deps/libsecp256k1: rebar_abort
** (Mix) Could not compile dependency :libsecp256k1, "/Users/fodediop/.mix/rebar compile skip_deps=true deps_dir="/Users/fodediop/dev/bitcoin/bitcoinex/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile libsecp256k1", update it with "mix deps.update libsecp256k1" or clean it with "mix deps.clean libsecp256k1"
Ok I've seen this error as well and I think it's related to a newer version of erlang. Are you using asdf for Erlang version management? Could you try this with Elixir 1.9.X?
I see. I'm not using any version management tools for Erlang right now, but I can try asdf. I'll keep you posted. Thank you for all the help.
Ok, I had a chance to play with it some more this evening and installed asdf
with Elixir 1.9.4, It's still not, unfortunately, working for me:
bitcoinex on ξ master [!] via π§ v1.9.4
β mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
bunt 0.2.0
certifi 2.5.1
combine 0.10.0
credo 1.0.5
decimal 1.7.0
dialyxir 1.0.0-rc.6
erlex 0.2.1
excoveralls 0.11.1
file_system 0.2.7
gettext 0.16.1
hackney 1.15.1
idna 6.0.0
jason 1.1.2
metrics 1.0.1
mimerl 1.2.0
mix_test_watch 0.9.0
parse_trans 3.3.0
ssl_verify_fun 1.1.4
stream_data 0.4.3
timex 3.5.0
tzdata 0.5.20
unicode_util_compat 0.4.1
All dependencies are up to date
bitcoinex on ξ master [!] via π§ v1.9.4 took 2s
β mix deps.compile
===> Compiling parse_trans
===> Compiling mimerl
==> libsecp256k1 (compile)
Cloning into 'secp256k1'...
HEAD is now at 5a91bd7 Merge #400: A couple minor cleanups
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
glibtoolize: copying file 'build-aux/m4/libtool.m4'
glibtoolize: copying file 'build-aux/m4/ltoptions.m4'
glibtoolize: copying file 'build-aux/m4/ltsugar.m4'
glibtoolize: copying file 'build-aux/m4/ltversion.m4'
glibtoolize: copying file 'build-aux/m4/lt~obsolete.m4'
configure.ac:10: installing 'build-aux/compile'
configure.ac:5: installing 'build-aux/config.guess'
configure.ac:5: installing 'build-aux/config.sub'
configure.ac:9: installing 'build-aux/install-sh'
configure.ac:9: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'
checking build system type... x86_64-apple-darwin19.4.0
checking host system type... x86_64-apple-darwin19.4.0
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking whether cc understands -c and -o together... yes
checking dependency style of cc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... ld
checking if the linker (ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... nm
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin19.4.0 file names to x86_64-apple-darwin19.4.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin19.4.0 file names to toolchain format... func_convert_file_noop
checking for ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse nm output from cc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... cpp
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common -DPIC
checking if cc PIC flag -fno-common -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin19.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ar... /usr/bin/ar
checking for ranlib... /usr/bin/ranlib
checking for strip... /usr/bin/strip
checking for gcc... gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for cc option to accept ISO C89... (cached) none needed
checking dependency style of cc... gcc3
checking for brew... /usr/local/bin/brew
checking if cc supports -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings... yes
checking if cc supports -fvisibility=hidden... yes
checking for __int128... yes
checking for __builtin_expect... yes
checking native compiler: gcc... ok
checking for x86_64 assembly availability... yes
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for __gmpz_init in -lgmp... yes
checking for libcrypto... yes
checking for main in -lcrypto... yes
checking for EC functions in libcrypto... no
checking for javac... /usr/bin/javac
checking symlink for /usr/bin/javac... /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
checking jni headers... none
configure: WARNING: jni headers/dependencies not found. jni support disabled
checking whether byte ordering is bigendian... no
configure: Using static precomputation: yes
configure: Using assembly optimizations: x86_64
configure: Using field implementation: 64bit
configure: Using bignum implementation: gmp
configure: Using scalar implementation: 64bit
configure: Using endomorphism optimizations: no
configure: Building ECDH module: no
configure: Building Schnorr signatures module: no
configure: Building ECDSA pubkey recovery module: yes
configure: Using jni: no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libsecp256k1.pc
config.status: creating src/libsecp256k1-config.h
config.status: executing depfiles commands
config.status: executing libtool commands
CC src/tests-tests.o
CCLD tests
CC src/libsecp256k1_la-secp256k1.lo
CCLD libsecp256k1.la
Compiled src/libsecp256k1.erl
Compiling c_src/libsecp256k1_nif.c
c_src/libsecp256k1_nif.c:494:51: warning: incompatible pointer types passing 'unsigned char (*)[74]' to parameter of type 'unsigned char *' [-Wincompatible-pointer-types]
if (secp256k1_ecdsa_signature_serialize_der(ctx, &intermediatesig, &siglen, &signature) != 1) {
^~~~~~~~~~~~~~~~
c_src/secp256k1/src/secp256k1.c:249:90: note: passing argument to parameter 'output' here
int secp256k1_ecdsa_signature_serialize_der(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_ecdsa_signature* sig) {
^
c_src/libsecp256k1_nif.c:497:64: warning: incompatible pointer types passing 'unsigned char (*)[74]' to parameter of type 'const unsigned char *' [-Wincompatible-pointer-types]
CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &signature, &intermediatesig, siglen) == 1);
^~~~~~~~~~~~~~~~
c_src/secp256k1/src/util.h:53:18: note: expanded from macro 'CHECK'
if (EXPECT(!(cond), 0)) { \
^~~~
c_src/secp256k1/src/util.h:40:39: note: expanded from macro 'EXPECT'
#define EXPECT(x,c) __builtin_expect((x),(c))
^
c_src/secp256k1/src/secp256k1.c:212:124: note: passing argument to parameter 'input' here
int secp256k1_ecdsa_signature_parse_der(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:10:
In file included from c_src/secp256k1/src/num_impl.h:17:
c_src/secp256k1/src/num_gmp_impl.h:25:13: warning: unused function 'secp256k1_num_copy' [-Wunused-function]
static void secp256k1_num_copy(secp256k1_num *r, const secp256k1_num *a) {
^
c_src/secp256k1/src/num_gmp_impl.h:191:12: warning: unused function 'secp256k1_num_eq' [-Wunused-function]
static int secp256k1_num_eq(const secp256k1_num *a, const secp256k1_num *b) {
^
c_src/secp256k1/src/num_gmp_impl.h:223:13: warning: unused function 'secp256k1_num_add' [-Wunused-function]
static void secp256k1_num_add(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {
^
c_src/secp256k1/src/num_gmp_impl.h:229:13: warning: unused function 'secp256k1_num_sub' [-Wunused-function]
static void secp256k1_num_sub(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {
^
c_src/secp256k1/src/num_gmp_impl.h:235:13: warning: unused function 'secp256k1_num_mul' [-Wunused-function]
static void secp256k1_num_mul(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {
^
c_src/secp256k1/src/num_gmp_impl.h:81:13: warning: unused function 'secp256k1_num_mod' [-Wunused-function]
static void secp256k1_num_mod(secp256k1_num *r, const secp256k1_num *m) {
^
c_src/secp256k1/src/num_gmp_impl.h:262:13: warning: unused function 'secp256k1_num_shift' [-Wunused-function]
static void secp256k1_num_shift(secp256k1_num *r, int bits) {
^
c_src/secp256k1/src/num_gmp_impl.h:169:12: warning: unused function 'secp256k1_num_is_one' [-Wunused-function]
static int secp256k1_num_is_one(const secp256k1_num *a) {
^
c_src/secp256k1/src/num_gmp_impl.h:177:12: warning: unused function 'secp256k1_num_is_neg' [-Wunused-function]
static int secp256k1_num_is_neg(const secp256k1_num *a) {
^
c_src/secp256k1/src/num_gmp_impl.h:284:13: warning: unused function 'secp256k1_num_negate' [-Wunused-function]
static void secp256k1_num_negate(secp256k1_num *r) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:11:
In file included from c_src/secp256k1/src/field_impl.h:19:
c_src/secp256k1/src/field_5x52_impl.h:53:13: warning: unused function 'secp256k1_fe_verify' [-Wunused-function]
static void secp256k1_fe_verify(const secp256k1_fe *a) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:13:
c_src/secp256k1/src/group_impl.h:630:12: warning: unused function 'secp256k1_gej_has_quad_y_var' [-Wunused-function]
static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:12:
c_src/secp256k1/src/scalar_impl.h:26:13: warning: unused function 'secp256k1_scalar_get_num' [-Wunused-function]
static void secp256k1_scalar_get_num(secp256k1_num *r, const secp256k1_scalar *a) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:13:
c_src/secp256k1/src/group_impl.h:217:12: warning: unused function 'secp256k1_gej_is_valid_var' [-Wunused-function]
static int secp256k1_gej_is_valid_var(const secp256k1_gej *a) {
^
In file included from c_src/libsecp256k1_nif.c:9:
In file included from c_src/secp256k1/src/secp256k1.c:15:
c_src/secp256k1/src/ecmult_const_impl.h:122:13: warning: unused function 'secp256k1_ecmult_const' [-Wunused-function]
static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *scalar) {
^
In file included from c_src/libsecp256k1_nif.c:11:
c_src/secp256k1/src/testrand_impl.h:47:17: warning: unused function 'secp256k1_rand_int' [-Wunused-function]
static uint32_t secp256k1_rand_int(uint32_t range) {
^
c_src/secp256k1/src/testrand_impl.h:106:13: warning: unused function 'secp256k1_rand256_test' [-Wunused-function]
static void secp256k1_rand256_test(unsigned char *b32) {
^
19 warnings generated.
ld: library not found for -lerl_interface
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: sh(cc c_src/libsecp256k1_nif.o $LDFLAGS -bundle -flat_namespace -undefined suppress -L"/Users/fodediop/.asdf/installs/erlang/23.0.2/lib/erl_interface-4.0/lib" -lerl_interface -lei c_src/secp256k1/.libs/libsecp256k1.a -lgmp -o priv/libsecp256k1_nif.so)
failed with return code 1 and the following output:
ld: library not found for -lerl_interface
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: compile failed while processing /Users/fodediop/dev/bitcoin/bitcoinex/deps/libsecp256k1: rebar_abort
** (Mix) Could not compile dependency :libsecp256k1, "/Users/fodediop/.asdf/installs/elixir/1.9.4/.mix/rebar compile skip_deps=true deps_dir="/Users/fodediop/dev/bitcoin/bitcoinex/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile libsecp256k1", update it with "mix deps.update libsecp256k1" or clean it with "mix deps.clean libsecp256k1"
ld: library not found for -lerl_interface
It looks like it's complaining about missing lerl_interface
which is used by Erlang for FFI to call C. did you also use asdf to install Erlang?
Good morning,
Yes I do have Erlang installed with asdf. I'm using v23.0.2
bitcoinex on ξ master [!] via π§ v1.9.4
β asdf list
elixir
1.9.4
erlang
23.0.2
I suspect it might be building native deps problem with OTP23(which was just released last month). Would you mind try to downgrade it to OTP22?
Good call! It worked with OTP22. Thank you for the tip. Here's the tail output of the console logs:
19 warnings generated.
===> Compiling metrics
===> Compiling unicode_util_compat
===> Compiling idna
==> bunt
Compiling 2 files (.ex)
Generated bunt app
==> gettext
Compiling 1 file (.yrl)
Compiling 1 file (.erl)
Compiling 20 files (.ex)
Generated gettext app
==> decimal
Compiling 1 file (.ex)
Generated decimal app
==> jason
Compiling 8 files (.ex)
Generated jason app
==> ssl_verify_fun
Compiling 7 files (.erl)
Generated ssl_verify_fun app
==> dialyxir
Compiling 57 files (.ex)
Generated dialyxir app
==> combine
Compiling 6 files (.ex)
Generated combine app
===> Compiling certifi
===> Compiling hackney
==> tzdata
Compiling 16 files (.ex)
Generated tzdata app
==> timex
Compiling 58 files (.ex)
Generated timex app
==> credo
Compiling 183 files (.ex)
Compiling lib/credo/code/sigils.ex (it's taking more than 15s)
Generated credo app
==> mix_test_watch
Compiling 8 files (.ex)
Generated mix_test_watch app
==> bitcoinex
Compiling 13 files (.ex)
Generated bitcoinex app
That' awesome. I am glad that we can help you!
Hello all,
I have not been able to compile the library locally on my Mac:
I pulled down the repo, did a
mix deps.get
thenmix compile
and I'm getting the following error:Can I help with the documentation and with writing additional tests?