you got it!
when this libbitcoin was still more sx-tools i think i built secp256k1 back then to try and get the outdated package to work, perhaps an install of an older version of secp256k1 left some of the 'cruft' as you put it in odd places.
Either way it builds successfully now, thank you very much for your help getting this to build.
Search Criteria
Package Details: secp256k1-git 20150422-1
Package Actions
| Package Base: | secp256k1-git |
|---|---|
| Description: | Elliptic Curve Library for libbitcoin |
| Upstream URL: | https://github.com/libbitcoin/secp256k1 |
| Category: | lib |
| Licenses: | |
| Groups: | |
| Conflicts: | |
| Provides: | |
| Submitter: | atweiden |
| Maintainer: | atweiden |
| Last Packager: | atweiden |
| Votes: | 2 |
| First Submitted: | 2014-05-09 17:10 |
| Last Updated: | 2015-07-08 16:55 |
Required by (15)
Sources
Latest Comments
Comment by leshow
Comment by atweiden
This error line is probably the cause of your issue:
/usr/local/include/secp256k1.h:85:34: note: declared here
How did secp256k1.h get installed to /usr/local :)? What is the output of `pacman -Qo /usr/local/include/secp256k1.h`?
What probably happened is you previously installed secp256k1 without using Pacman, and the old secp256k1 cruft is conflicting with the new secp256k1-git pkg. The solution is to remove the old secp256k1. You should look in /usr/local for these files:
$ sudo pacman -S mlocate
$ locate secp256k1.h
$ locate libsecp256k1.so
$ locate libsecp256k1.so.0
$ locate libsecp256k1.so.0.0.0
$ locate libsecp256k1.pc
After removing the cruft in /usr/local, start over the build process.
Comment by leshow
I'm on x86_64 not i686. It should be noted that I also tried cloning your pkgbuilds repo and running makepkg -Acsi on secp256k1-git then on libbitcoin-git.
in any case I tried again following your instructions below, still got the same error:
CXX src/math/src_libbitcoin_la-ec_keys.lo
src/math/ec_keys.cpp: In function ‘libbitcoin::endorsement libbitcoin::sign(libbitcoin::ec_secret, libbitcoin::hash_digest)’:
src/math/ec_keys.cpp:115:24: error: ‘secp256k1_nonce_function_rfc6979’ was not declared in this scope
secret.data(), secp256k1_nonce_function_rfc6979, nullptr) != 1)
^
src/math/ec_keys.cpp: In function ‘libbitcoin::compact_signature libbitcoin::sign_compact(libbitcoin::ec_secret, libbitcoin::hash_digest)’:
src/math/ec_keys.cpp:131:24: error: ‘secp256k1_nonce_function_rfc6979’ was not declared in this scope
secret.data(), secp256k1_nonce_function_rfc6979, nullptr,
^
src/math/ec_keys.cpp: In function ‘bool libbitcoin::verify_signature(const ec_point&, libbitcoin::hash_digest, const endorsement&)’:
src/math/ec_keys.cpp:146:70: error: invalid conversion from ‘const unsigned char*’ to ‘int’ [-fpermissive]
auto result = secp256k1_ecdsa_verify(hash.data(), signature.data(),
^
src/math/ec_keys.cpp:148:49: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘const unsigned char*’ [-fpermissive]
static_cast<uint32_t>(public_key.size()));
^
src/math/ec_keys.cpp:147:66: error: invalid conversion from ‘const unsigned char*’ to ‘int’ [-fpermissive]
static_cast<uint32_t>(signature.size()), public_key.data(),
^
src/math/ec_keys.cpp:148:49: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘const unsigned char*’ [-fpermissive]
static_cast<uint32_t>(public_key.size()));
^
src/math/ec_keys.cpp:148:49: error: too few arguments to function ‘int secp256k1_ecdsa_verify(const unsigned char*, int, const unsigned char*, int, const unsigned char*, int)’
In file included from src/math/ec_keys.cpp:23:0:
/usr/local/include/secp256k1.h:85:34: note: declared here
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify(
^
src/math/ec_keys.cpp: In function ‘libbitcoin::ec_point libbitcoin::recover_compact(libbitcoin::compact_signature, libbitcoin::hash_digest, bool)’:
src/math/ec_keys.cpp:168:34: error: invalid conversion from ‘std::array<unsigned char, 64ul>::pointer {aka unsigned char*}’ to ‘int’ [-fpermissive]
signature.signature.data(), out.data(), &out_size, compressed,
^
src/math/ec_keys.cpp:169:24: error: cannot convert ‘int*’ to ‘unsigned char*’ for argument ‘4’ to ‘int secp256k1_ecdsa_recover_compact(const unsigned char*, int, const unsigned char*, unsigned char*, int*, int, int)’
signature.recid) == 1)
^
src/math/ec_keys.cpp: In function ‘bool libbitcoin::verify_signature(const ec_point&, libbitcoin::hash_digest, const endorsement&)’:
src/math/ec_keys.cpp:153:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
Makefile:1521: recipe for target 'src/math/src_libbitcoin_la-ec_keys.lo' failed
make: *** [src/math/src_libbitcoin_la-ec_keys.lo] Error 1
Comment by atweiden
Interesting. The only thing I can think of is if you are on i686 there could be something happening there that doesn't on x86_64. I cannot reproduce this. I have built secp256k1 and complete libbitcoin pkgs as of this week on x86_64.
Please copy/paste the following script into buildsecp256k1.sh:
#!/bin/bash
rm -rf secp256k1-git*
curl -O https://aur.archlinux.org/packages/se/secp256k1-git/secp256k1-git.tar.gz
tar xvzf secp256k1-git.tar.gz
pushd secp256k1-git
makepkg -Acsi --noconfirm
popd
Then:
chmod +x buildsecp256k1.sh.
./buildsecp256k1.sh
Just to be sure.
Comment by leshow
I have tried removing this package (pacman -Rn secp256k1-git) and clearing out all my local package cache (pacman -Scc) to be sure it downloads a fresh version.
this package builds fine, however i get an error building libbitcoin-git afterwards:
src/math/ec_keys.cpp: In function ‘libbitcoin::endorsement libbitcoin::sign(libbitcoin::ec_secret, libbitcoin::hash_digest)’:
src/math/ec_keys.cpp:115:24: error: ‘secp256k1_nonce_function_rfc6979’ was not declared in this scope
secret.data(), secp256k1_nonce_function_rfc6979, nullptr) != 1)
^
src/math/ec_keys.cpp: In function ‘libbitcoin::compact_signature libbitcoin::sign_compact(libbitcoin::ec_secret, libbitcoin::hash_digest)’:
src/math/ec_keys.cpp:131:24: error: ‘secp256k1_nonce_function_rfc6979’ was not declared in this scope
secret.data(), secp256k1_nonce_function_rfc6979, nullptr,
^
src/math/ec_keys.cpp: In function ‘bool libbitcoin::verify_signature(const ec_point&, libbitcoin::hash_digest, const endorsement&)’:
src/math/ec_keys.cpp:146:70: error: invalid conversion from ‘const unsigned char*’ to ‘int’ [-fpermissive]
auto result = secp256k1_ecdsa_verify(hash.data(), signature.data(),
^
src/math/ec_keys.cpp:148:49: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘const unsigned char*’ [-fpermissive]
static_cast<uint32_t>(public_key.size()));
^
src/math/ec_keys.cpp:147:66: error: invalid conversion from ‘const unsigned char*’ to ‘int’ [-fpermissive]
static_cast<uint32_t>(signature.size()), public_key.data(),
^
src/math/ec_keys.cpp:148:49: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘const unsigned char*’ [-fpermissive]
static_cast<uint32_t>(public_key.size()));
^
src/math/ec_keys.cpp:148:49: error: too few arguments to function ‘int secp256k1_ecdsa_verify(const unsigned char*, int, const unsigned char*, int, const unsigned char*, int)’
In file included from src/math/ec_keys.cpp:23:0:
/usr/local/include/secp256k1.h:85:34: note: declared here
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify(
^
src/math/ec_keys.cpp: In function ‘libbitcoin::ec_point libbitcoin::recover_compact(libbitcoin::compact_signature, libbitcoin::hash_digest, bool)’:
src/math/ec_keys.cpp:168:34: error: invalid conversion from ‘std::array<unsigned char, 64ul>::pointer {aka unsigned char*}’ to ‘int’ [-fpermissive]
signature.signature.data(), out.data(), &out_size, compressed,
^
src/math/ec_keys.cpp:169:24: error: cannot convert ‘int*’ to ‘unsigned char*’ for argument ‘4’ to ‘int secp256k1_ecdsa_recover_compact(const unsigned char*, int, const unsigned char*, unsigned char*, int*, int, int)’
signature.recid) == 1)
^
src/math/ec_keys.cpp: In function ‘bool libbitcoin::verify_signature(const ec_point&, libbitcoin::hash_digest, const endorsement&)’:
src/math/ec_keys.cpp:153:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
Makefile:1521: recipe for target 'src/math/src_libbitcoin_la-ec_keys.lo' failed
make: *** [src/math/src_libbitcoin_la-ec_keys.lo] Error 1
==> ERROR: A failure occurred in build().
Aborting...
Comment by noctlos
If this is going to be the package used mainly for building libbitcoin-git, I would recommend using the source https://github.com/libbitcoin/secp256k1 instead. That or perhaps a separate package for that purpose should be created.