Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npm install fails #35

Closed
IstoraMandiri opened this issue Oct 14, 2015 · 26 comments · Fixed by #36
Closed

Npm install fails #35

IstoraMandiri opened this issue Oct 14, 2015 · 26 comments · Fixed by #36

Comments

@IstoraMandiri
Copy link

see embarklabs/embark#99

Here is the output of npm install [email protected] -g:

> [email protected] install /usr/local/lib/node_modules/secp256k1
> node-gyp rebuild

  CXX(target) Release/obj.target/secp256k1/functions.o
../functions.cc:224:57: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results = secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                        ^~~~~~~
../functions.cc:223:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = NULL
../functions.cc:248:56: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results= secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                       ^~~~~~~
../functions.cc:247:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = NULL
2 warnings generated.
  CXX(target) Release/obj.target/secp256k1/util.o
  CXX(target) Release/obj.target/secp256k1/secp256k1.o
  CC(target) Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:25:13: warning: unused function 'secp256k1_num_copy'
      [-Wunused-function]
static void secp256k1_num_copy(secp256k1_num_t *r, const secp256k1_num_t *a) {
            ^
../secp256k1-src/src/num_gmp_impl.h:163:12: warning: unused function 'secp256k1_num_eq'
      [-Wunused-function]
static int secp256k1_num_eq(const secp256k1_num_t *a, const secp256k1_num_t *b) {
           ^
../secp256k1-src/src/num_gmp_impl.h:195:13: warning: unused function 'secp256k1_num_add'
      [-Wunused-function]
static void secp256k1_num_add(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_n...
            ^
../secp256k1-src/src/num_gmp_impl.h:201:13: warning: unused function 'secp256k1_num_sub'
      [-Wunused-function]
static void secp256k1_num_sub(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_n...
            ^
../secp256k1-src/src/num_gmp_impl.h:207:13: warning: unused function 'secp256k1_num_mul'
      [-Wunused-function]
static void secp256k1_num_mul(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_n...
            ^
../secp256k1-src/src/num_gmp_impl.h:80:13: warning: unused function 'secp256k1_num_mod'
      [-Wunused-function]
static void secp256k1_num_mod(secp256k1_num_t *r, const secp256k1_num_t *m) {
            ^
../secp256k1-src/src/num_gmp_impl.h:234:13: warning: unused function 'secp256k1_num_shift'
      [-Wunused-function]
static void secp256k1_num_shift(secp256k1_num_t *r, int bits) {
            ^
../secp256k1-src/src/num_gmp_impl.h:149:12: warning: unused function 'secp256k1_num_is_neg'
      [-Wunused-function]
static int secp256k1_num_is_neg(const secp256k1_num_t *a) {
           ^
../secp256k1-src/src/num_gmp_impl.h:256:13: warning: unused function 'secp256k1_num_negate'
      [-Wunused-function]
static void secp256k1_num_negate(secp256k1_num_t *r) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:13:
In file included from ../secp256k1-src/src/field_impl.h:19:
../secp256k1-src/src/field_5x52_impl.h:54:13: warning: unused function 'secp256k1_fe_verify'
      [-Wunused-function]
static void secp256k1_fe_verify(const secp256k1_fe_t *a) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:15:
../secp256k1-src/src/group_impl.h:36:13: warning: unused function 'secp256k1_ge_set_infinity'
      [-Wunused-function]
static void secp256k1_ge_set_infinity(secp256k1_ge_t *r) {
            ^
../secp256k1-src/src/group_impl.h:161:13: warning: unused function 'secp256k1_gej_set_xy'
      [-Wunused-function]
static void secp256k1_gej_set_xy(secp256k1_gej_t *r, const secp256k1_fe_t *x, const secp256k1...
            ^
In file included from ../secp256k1-src/src/secp256k1.c:14:
../secp256k1-src/src/scalar_impl.h:28:13: warning: unused function 'secp256k1_scalar_get_num'
      [-Wunused-function]
static void secp256k1_scalar_get_num(secp256k1_num_t *r, const secp256k1_scalar_t *a) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:14:
In file included from ../secp256k1-src/src/scalar_impl.h:20:
../secp256k1-src/src/scalar_4x64_impl.h:886:13: warning: unused function 'secp256k1_scalar_split_128'
      [-Wunused-function]
static void secp256k1_scalar_split_128(secp256k1_scalar_t *r1, secp256k1_scalar_t *r2, const ...
            ^
In file included from ../secp256k1-src/src/secp256k1.c:15:
../secp256k1-src/src/group_impl.h:227:12: warning: unused function 'secp256k1_gej_is_valid_var'
      [-Wunused-function]
static int secp256k1_gej_is_valid_var(const secp256k1_gej_t *a) {
           ^
15 warnings generated.
  SOLINK_MODULE(target) Release/secp256k1.node
  SOLINK_MODULE(target) Release/secp256k1.node: Finished
[email protected] /usr/local/lib/node_modules/secp256k1
├── [email protected]
└── [email protected]
@wanderer
Copy link
Member

@hitchcott thanks for reporting this! What OS are you using and what version of node are you using?

@wanderer
Copy link
Member

@hitchcott secondly can you run?

git clone https://github.com/wanderer/secp256k1-node/
cd secp256k1-node
sed -i 's/\"<!(.\/utils\/has_lib\.sh gmpxx)\"/"false"/g' ./binding.gyp
npm install

@iurimatias
Copy link

@tcoulter
Copy link
Contributor

@wanderer I think your commands above work, but I had to make a few modifications for OS X. Here's what I ran:

$ git clone https://github.com/wanderer/secp256k1-node/
$ cd secp256k1-node
$ git submodule udpate --init --recursive
$ mv binding.gyp binding.gyp.old
$ sed -e 's/\"<!(.\/utils\/has_lib\.sh gmpxx)\"/"false"/g' ./binding.gyp.old > ./binding.gyp
$ npm install

The install logs are here. Looks fine to me! (just warnings):

https://gist.github.com/tcoulter/40680715ed21e7e13cc5

@wanderer
Copy link
Member

thanks @tcoulter . So looks like the has_lib.sh script is giving a false positive for OS X. Can you tell me what the script ./utils/has_lib.sh gmpxx returns?

@tcoulter
Copy link
Contributor

@wanderer

Tims-MacBook-Pro:secp256k1-node tim$ ./utils/has_lib.sh 
true

@wanderer
Copy link
Member

@tcoulter what does ./has_lib.sh some_random_button_mashing do?

@tcoulter
Copy link
Contributor

@wanderer

Tims-MacBook-Pro:secp256k1-node tim$ ./utils/has_lib.sh asdfasdf
false

@wanderer
Copy link
Member

@hitchcott can you please try install the latest version of secp256k1?
git clone [email protected]:wanderer/secp256k1-node.git
cd secp256k1-node
npm install

Let me know what happens! thanks.

@taoeffect
Copy link
Contributor

Deleted my previous comment (didn't realize you had submodules).

@hitchcott can you please try install the latest version of secp256k1?

On OS X, I get the following error because it can't find <gmp.h>, even though it should since it's installed via Homebrew. Header is located in /usr/local/include/. It should have a -I/usr/local/include/ somewhere.

% npm install

> [email protected] install /Users/greg/secp256k1-node
> node-gyp rebuild

  CXX(target) Release/obj.target/secp256k1/functions.o
../functions.cc:224:57: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results = secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                        ^~~~~~~
../functions.cc:223:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
../functions.cc:248:56: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results= secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                       ^~~~~~~
../functions.cc:247:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
2 warnings generated.
  CXX(target) Release/obj.target/secp256k1/util.o
  CXX(target) Release/obj.target/secp256k1/secp256k1.o
  CC(target) Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:12:10: fatal error: 'gmp.h' file not found
#include <gmp.h>
         ^
1 error generated.
make: *** [Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/greg/secp256k1-node
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.2.1
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the secp256k1 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls secp256k1
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/greg/secp256k1-node/npm-debug.log

@wanderer
Copy link
Member

@taoeffect @hitchcott
my bad; you need to pull the submodule (git submodule update --init --recursive) before npm install

@taoeffect
Copy link
Contributor

my bad; you need to pull the submodule (git clone [email protected]:wanderer/secp256k1-node.git) before npm install

Guessing you didn't see my latest comment. :)

I also fixed the header problem by adding /usr/local/include to include_dirs. Now I get this:

% npm install

> [email protected] install /Users/greg/secp256k1-node
> node-gyp rebuild

  CXX(target) Release/obj.target/secp256k1/functions.o
../functions.cc:224:57: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results = secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                        ^~~~~~~
../functions.cc:223:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
../functions.cc:248:56: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results= secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                       ^~~~~~~
../functions.cc:247:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
2 warnings generated.
  CXX(target) Release/obj.target/secp256k1/util.o
  CXX(target) Release/obj.target/secp256k1/secp256k1.o
  CC(target) Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:25:32: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_copy(secp256k1_num_t *r, const secp256k1_num_t *a) {
                               ^~~~~~~~~~~~~~~
                               secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:25:58: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_copy(secp256k1_num_t *r, const secp256k1_num_t *a) {
                                                         ^~~~~~~~~~~~~~~
                                                         secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:29:78: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_get_bin(unsigned char *r, unsigned int rlen, const secp256k1_num_t *a) {
                                                                             ^~~~~~~~~~~~~~~
                                                                             secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:33:12: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    if (a->limbs>1 || a->data[0] != 0) {
        ~  ^
../secp256k1-src/src/num_gmp_impl.h:34:61: error: no member named 'limbs' in 'secp256k1_pubkey_t'
        len = mpn_get_str(tmp, 256, (mp_limb_t*)a->data, a->limbs);
                                                         ~  ^
../secp256k1-src/src/num_gmp_impl.h:45:35: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_set_bin(secp256k1_num_t *r, const unsigned char *a, unsigned int alen) {
                                  ^~~~~~~~~~~~~~~
                                  secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:49:23: warning: incompatible pointer types passing 'unsigned char [64]' to parameter of type 'mp_ptr' (aka 'unsigned long *') [-Wincompatible-pointer-types]
    len = mpn_set_str(r->data, a, alen, 256);
                      ^~~~~~~
/usr/local/include/gmp.h:1585:45: note: passing argument to parameter here
__GMP_DECLSPEC mp_size_t mpn_set_str (mp_ptr, const unsigned char *, size_t, int);
                                            ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:54:25: error: use of undeclared identifier 'NUM_LIMBS'
    VERIFY_CHECK(len <= NUM_LIMBS*2);
                        ^
../secp256k1-src/src/util.h:59:40: note: expanded from macro 'VERIFY_CHECK'
#define VERIFY_CHECK(cond) do { (void)(cond); } while(0)
                                       ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:55:8: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    r->limbs = len;
    ~  ^
../secp256k1-src/src/num_gmp_impl.h:56:8: error: no member named 'neg' in 'secp256k1_pubkey_t'
    r->neg = 0;
    ~  ^
../secp256k1-src/src/num_gmp_impl.h:57:15: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    while (r->limbs > 1 && r->data[r->limbs-1]==0) {
           ~  ^
../secp256k1-src/src/num_gmp_impl.h:57:39: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    while (r->limbs > 1 && r->data[r->limbs-1]==0) {
                                   ~  ^
../secp256k1-src/src/num_gmp_impl.h:58:12: error: no member named 'limbs' in 'secp256k1_pubkey_t'
        r->limbs--;
        ~  ^
../secp256k1-src/src/num_gmp_impl.h:62:35: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_add_abs(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
                                  ^~~~~~~~~~~~~~~
                                  secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:62:61: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_add_abs(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
                                                            ^~~~~~~~~~~~~~~
                                                            secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:62:87: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_add_abs(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
                                                                                      ^~~~~~~~~~~~~~~
                                                                                      secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:63:48: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    mp_limb_t c = mpn_add(r->data, a->data, a->limbs, b->data, b->limbs);
                                            ~  ^
../secp256k1-src/src/num_gmp_impl.h:63:67: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    mp_limb_t c = mpn_add(r->data, a->data, a->limbs, b->data, b->limbs);
                                                               ~  ^
../secp256k1-src/src/num_gmp_impl.h:64:8: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    r->limbs = a->limbs;
    ~  ^
../secp256k1-src/src/num_gmp_impl.h:64:19: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    r->limbs = a->limbs;
               ~  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/greg/secp256k1-node
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.2.1
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the secp256k1 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls secp256k1
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/greg/secp256k1-node/npm-debug.log

@wanderer
Copy link
Member

so it shouldn't be using num_gmp_impl.h if you on a mac. Maybe the condition here is not working. @taoeffect what happens when change this line to "with_gmp%": "false" ?

@taoeffect
Copy link
Contributor

This:

% npm install

> [email protected] install /Users/greg/secp256k1-node
> node-gyp rebuild

  CXX(target) Release/obj.target/secp256k1/functions.o
../functions.cc:224:57: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results = secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                        ^~~~~~~
../functions.cc:223:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
../functions.cc:248:56: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results= secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                       ^~~~~~~
../functions.cc:247:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
2 warnings generated.
  CXX(target) Release/obj.target/secp256k1/util.o
  CXX(target) Release/obj.target/secp256k1/secp256k1.o
  CC(target) Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:25:32: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_copy(secp256k1_num_t *r, const secp256k1_num_t *a) {
                               ^~~~~~~~~~~~~~~
                               secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:25:58: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_copy(secp256k1_num_t *r, const secp256k1_num_t *a) {
                                                         ^~~~~~~~~~~~~~~
                                                         secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:29:78: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_get_bin(unsigned char *r, unsigned int rlen, const secp256k1_num_t *a) {
                                                                             ^~~~~~~~~~~~~~~
                                                                             secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:33:12: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    if (a->limbs>1 || a->data[0] != 0) {
        ~  ^
../secp256k1-src/src/num_gmp_impl.h:34:61: error: no member named 'limbs' in 'secp256k1_pubkey_t'
        len = mpn_get_str(tmp, 256, (mp_limb_t*)a->data, a->limbs);
                                                         ~  ^
../secp256k1-src/src/num_gmp_impl.h:45:35: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_set_bin(secp256k1_num_t *r, const unsigned char *a, unsigned int alen) {
                                  ^~~~~~~~~~~~~~~
                                  secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:49:23: warning: incompatible pointer types passing 'unsigned char [64]' to parameter of type 'mp_ptr' (aka 'unsigned long *') [-Wincompatible-pointer-types]
    len = mpn_set_str(r->data, a, alen, 256);
                      ^~~~~~~
/usr/local/include/gmp.h:1585:45: note: passing argument to parameter here
__GMP_DECLSPEC mp_size_t mpn_set_str (mp_ptr, const unsigned char *, size_t, int);
                                            ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:54:25: error: use of undeclared identifier 'NUM_LIMBS'
    VERIFY_CHECK(len <= NUM_LIMBS*2);
                        ^
../secp256k1-src/src/util.h:59:40: note: expanded from macro 'VERIFY_CHECK'
#define VERIFY_CHECK(cond) do { (void)(cond); } while(0)
                                       ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:55:8: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    r->limbs = len;
    ~  ^
../secp256k1-src/src/num_gmp_impl.h:56:8: error: no member named 'neg' in 'secp256k1_pubkey_t'
    r->neg = 0;
    ~  ^
../secp256k1-src/src/num_gmp_impl.h:57:15: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    while (r->limbs > 1 && r->data[r->limbs-1]==0) {
           ~  ^
../secp256k1-src/src/num_gmp_impl.h:57:39: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    while (r->limbs > 1 && r->data[r->limbs-1]==0) {
                                   ~  ^
../secp256k1-src/src/num_gmp_impl.h:58:12: error: no member named 'limbs' in 'secp256k1_pubkey_t'
        r->limbs--;
        ~  ^
../secp256k1-src/src/num_gmp_impl.h:62:35: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_add_abs(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
                                  ^~~~~~~~~~~~~~~
                                  secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:62:61: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_add_abs(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
                                                            ^~~~~~~~~~~~~~~
                                                            secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:62:87: error: unknown type name 'secp256k1_num_t'; did you mean 'secp256k1_pubkey_t'?
static void secp256k1_num_add_abs(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
                                                                                      ^~~~~~~~~~~~~~~
                                                                                      secp256k1_pubkey_t
../secp256k1-src/include/secp256k1.h:117:3: note: 'secp256k1_pubkey_t' declared here
} secp256k1_pubkey_t;
  ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:63:48: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    mp_limb_t c = mpn_add(r->data, a->data, a->limbs, b->data, b->limbs);
                                            ~  ^
../secp256k1-src/src/num_gmp_impl.h:63:67: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    mp_limb_t c = mpn_add(r->data, a->data, a->limbs, b->data, b->limbs);
                                                               ~  ^
../secp256k1-src/src/num_gmp_impl.h:64:8: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    r->limbs = a->limbs;
    ~  ^
../secp256k1-src/src/num_gmp_impl.h:64:19: error: no member named 'limbs' in 'secp256k1_pubkey_t'
    r->limbs = a->limbs;
               ~  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/greg/secp256k1-node
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.2.1
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the secp256k1 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls secp256k1
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/greg/secp256k1-node/npm-debug.log

@taoeffect
Copy link
Contributor

I don't understand why gmp is being disabled on a mac if it's installed...

@wanderer
Copy link
Member

becuase all of the build fails on mac's seem to revolve around the ./has_lib.sh script incorrectly detecting gmp. So I thought I would just disable it for macs until I can figure out a good way to detect if a library is installed

@taoeffect
Copy link
Contributor

I kinda fixed it:

% npm install

> [email protected] install /Users/greg/secp256k1-node
> node-gyp rebuild

  CXX(target) Release/obj.target/secp256k1/functions.o
In file included from <built-in>:348:
<command line>:13:9: warning: 'HAVE_LIBGMP' macro redefined [-Wmacro-redefined]
#define HAVE_LIBGMP 0
        ^
<command line>:5:9: note: previous definition is here
#define HAVE_LIBGMP 1
        ^
<command line>:14:9: warning: 'USE_NUM_GMP' macro redefined [-Wmacro-redefined]
#define USE_NUM_GMP 0
        ^
<command line>:6:9: note: previous definition is here
#define USE_NUM_GMP 1
        ^
<command line>:15:9: warning: 'USE_FIELD_INV_NUM' macro redefined [-Wmacro-redefined]
#define USE_FIELD_INV_NUM 0
        ^
<command line>:7:9: note: previous definition is here
#define USE_FIELD_INV_NUM 1
        ^
<command line>:16:9: warning: 'USE_SCALAR_INV_NUM' macro redefined [-Wmacro-redefined]
#define USE_SCALAR_INV_NUM 0
        ^
<command line>:8:9: note: previous definition is here
#define USE_SCALAR_INV_NUM 1
        ^
../functions.cc:224:57: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results = secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                        ^~~~~~~
../functions.cc:223:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
../functions.cc:248:56: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results= secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                       ^~~~~~~
../functions.cc:247:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
6 warnings generated.
  CXX(target) Release/obj.target/secp256k1/util.o
In file included from <built-in>:348:
<command line>:13:9: warning: 'HAVE_LIBGMP' macro redefined [-Wmacro-redefined]
#define HAVE_LIBGMP 0
        ^
<command line>:5:9: note: previous definition is here
#define HAVE_LIBGMP 1
        ^
<command line>:14:9: warning: 'USE_NUM_GMP' macro redefined [-Wmacro-redefined]
#define USE_NUM_GMP 0
        ^
<command line>:6:9: note: previous definition is here
#define USE_NUM_GMP 1
        ^
<command line>:15:9: warning: 'USE_FIELD_INV_NUM' macro redefined [-Wmacro-redefined]
#define USE_FIELD_INV_NUM 0
        ^
<command line>:7:9: note: previous definition is here
#define USE_FIELD_INV_NUM 1
        ^
<command line>:16:9: warning: 'USE_SCALAR_INV_NUM' macro redefined [-Wmacro-redefined]
#define USE_SCALAR_INV_NUM 0
        ^
<command line>:8:9: note: previous definition is here
#define USE_SCALAR_INV_NUM 1
        ^
4 warnings generated.
  CXX(target) Release/obj.target/secp256k1/secp256k1.o
In file included from <built-in>:348:
<command line>:13:9: warning: 'HAVE_LIBGMP' macro redefined [-Wmacro-redefined]
#define HAVE_LIBGMP 0
        ^
<command line>:5:9: note: previous definition is here
#define HAVE_LIBGMP 1
        ^
<command line>:14:9: warning: 'USE_NUM_GMP' macro redefined [-Wmacro-redefined]
#define USE_NUM_GMP 0
        ^
<command line>:6:9: note: previous definition is here
#define USE_NUM_GMP 1
        ^
<command line>:15:9: warning: 'USE_FIELD_INV_NUM' macro redefined [-Wmacro-redefined]
#define USE_FIELD_INV_NUM 0
        ^
<command line>:7:9: note: previous definition is here
#define USE_FIELD_INV_NUM 1
        ^
<command line>:16:9: warning: 'USE_SCALAR_INV_NUM' macro redefined [-Wmacro-redefined]
#define USE_SCALAR_INV_NUM 0
        ^
<command line>:8:9: note: previous definition is here
#define USE_SCALAR_INV_NUM 1
        ^
4 warnings generated.
  CC(target) Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o
In file included from <built-in>:326:
<command line>:13:9: warning: 'HAVE_LIBGMP' macro redefined [-Wmacro-redefined]
#define HAVE_LIBGMP 0
        ^
<command line>:5:9: note: previous definition is here
#define HAVE_LIBGMP 1
        ^
<command line>:14:9: warning: 'USE_NUM_GMP' macro redefined [-Wmacro-redefined]
#define USE_NUM_GMP 0
        ^
<command line>:6:9: note: previous definition is here
#define USE_NUM_GMP 1
        ^
<command line>:15:9: warning: 'USE_FIELD_INV_NUM' macro redefined [-Wmacro-redefined]
#define USE_FIELD_INV_NUM 0
        ^
<command line>:7:9: note: previous definition is here
#define USE_FIELD_INV_NUM 1
        ^
<command line>:16:9: warning: 'USE_SCALAR_INV_NUM' macro redefined [-Wmacro-redefined]
#define USE_SCALAR_INV_NUM 0
        ^
<command line>:8:9: note: previous definition is here
#define USE_SCALAR_INV_NUM 1
        ^
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:25:13: warning: unused function 'secp256k1_num_copy' [-Wunused-function]
static void secp256k1_num_copy(secp256k1_num_t *r, const secp256k1_num_t *a) {
            ^
../secp256k1-src/src/num_gmp_impl.h:163:12: warning: unused function 'secp256k1_num_eq' [-Wunused-function]
static int secp256k1_num_eq(const secp256k1_num_t *a, const secp256k1_num_t *b) {
           ^
../secp256k1-src/src/num_gmp_impl.h:195:13: warning: unused function 'secp256k1_num_add' [-Wunused-function]
static void secp256k1_num_add(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
            ^
../secp256k1-src/src/num_gmp_impl.h:201:13: warning: unused function 'secp256k1_num_sub' [-Wunused-function]
static void secp256k1_num_sub(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
            ^
../secp256k1-src/src/num_gmp_impl.h:207:13: warning: unused function 'secp256k1_num_mul' [-Wunused-function]
static void secp256k1_num_mul(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
            ^
../secp256k1-src/src/num_gmp_impl.h:80:13: warning: unused function 'secp256k1_num_mod' [-Wunused-function]
static void secp256k1_num_mod(secp256k1_num_t *r, const secp256k1_num_t *m) {
            ^
../secp256k1-src/src/num_gmp_impl.h:234:13: warning: unused function 'secp256k1_num_shift' [-Wunused-function]
static void secp256k1_num_shift(secp256k1_num_t *r, int bits) {
            ^
../secp256k1-src/src/num_gmp_impl.h:149:12: warning: unused function 'secp256k1_num_is_neg' [-Wunused-function]
static int secp256k1_num_is_neg(const secp256k1_num_t *a) {
           ^
../secp256k1-src/src/num_gmp_impl.h:256:13: warning: unused function 'secp256k1_num_negate' [-Wunused-function]
static void secp256k1_num_negate(secp256k1_num_t *r) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:13:
In file included from ../secp256k1-src/src/field_impl.h:19:
../secp256k1-src/src/field_5x52_impl.h:54:13: warning: unused function 'secp256k1_fe_verify' [-Wunused-function]
static void secp256k1_fe_verify(const secp256k1_fe_t *a) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:15:
../secp256k1-src/src/group_impl.h:36:13: warning: unused function 'secp256k1_ge_set_infinity' [-Wunused-function]
static void secp256k1_ge_set_infinity(secp256k1_ge_t *r) {
            ^
../secp256k1-src/src/group_impl.h:161:13: warning: unused function 'secp256k1_gej_set_xy' [-Wunused-function]
static void secp256k1_gej_set_xy(secp256k1_gej_t *r, const secp256k1_fe_t *x, const secp256k1_fe_t *y) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:14:
../secp256k1-src/src/scalar_impl.h:28:13: warning: unused function 'secp256k1_scalar_get_num' [-Wunused-function]
static void secp256k1_scalar_get_num(secp256k1_num_t *r, const secp256k1_scalar_t *a) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:14:
In file included from ../secp256k1-src/src/scalar_impl.h:20:
../secp256k1-src/src/scalar_4x64_impl.h:886:13: warning: unused function 'secp256k1_scalar_split_128' [-Wunused-function]
static void secp256k1_scalar_split_128(secp256k1_scalar_t *r1, secp256k1_scalar_t *r2, const secp256k1_scalar_t *a) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:15:
../secp256k1-src/src/group_impl.h:227:12: warning: unused function 'secp256k1_gej_is_valid_var' [-Wunused-function]
static int secp256k1_gej_is_valid_var(const secp256k1_gej_t *a) {
           ^
19 warnings generated.
  SOLINK_MODULE(target) Release/secp256k1.node
% 

Summary of changes

  1. I set "with_gmp%": "true"
  2. I added "/usr/local/include" to include_dirs list
  3. I changed mac section to:
       'OS=="mac"', {
          "defines": [
            "HAVE_LIBGMP=0",
            "USE_NUM_GMP=0",
            "USE_FIELD_INV_NUM=0",
            "USE_SCALAR_INV_NUM=0"
          ],
          "libraries": [
            "-L/usr/local/lib"
          ]
      }],

EDIT: actually, removing the "defines" section there should be done as well. See comment further down.

More elegant fix needed, and warnings should be fixed as well.

Also, replacing true with <!(./utils/has_lib.sh gmpxx && ./utils/has_lib.sh gmp) breaks it.

@taoeffect
Copy link
Contributor

Your has_lib.sh file should look for these files on OS X:

% ls /usr/local/lib/libgmp*
/usr/local/lib/libgmp.10.dylib@  /usr/local/lib/libgmp.a@         /usr/local/lib/libgmp.dylib@     /usr/local/lib/libgmpxx.4.dylib@ /usr/local/lib/libgmpxx.a@       /usr/local/lib/libgmpxx.dylib@

@taoeffect
Copy link
Contributor

Note: The @ sign on the end of those files is not part of the file name, it's just an indication that they're symlinks.

@taoeffect
Copy link
Contributor

Also, since GMP works fine on OS X, you should remove the "defines" block from the "mac" section. In fact, removing it reduces the amount of errors:

% npm install

> [email protected] install /Users/greg/secp256k1-node
> node-gyp rebuild

  CXX(target) Release/obj.target/secp256k1/functions.o
../functions.cc:224:57: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results = secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                        ^~~~~~~
../functions.cc:223:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
../functions.cc:248:56: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results= secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                       ^~~~~~~
../functions.cc:247:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
2 warnings generated.
  CXX(target) Release/obj.target/secp256k1/util.o
  CXX(target) Release/obj.target/secp256k1/secp256k1.o
  CC(target) Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:17:
../secp256k1-src/src/num_gmp_impl.h:25:13: warning: unused function 'secp256k1_num_copy' [-Wunused-function]
static void secp256k1_num_copy(secp256k1_num_t *r, const secp256k1_num_t *a) {
            ^
../secp256k1-src/src/num_gmp_impl.h:163:12: warning: unused function 'secp256k1_num_eq' [-Wunused-function]
static int secp256k1_num_eq(const secp256k1_num_t *a, const secp256k1_num_t *b) {
           ^
../secp256k1-src/src/num_gmp_impl.h:195:13: warning: unused function 'secp256k1_num_add' [-Wunused-function]
static void secp256k1_num_add(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
            ^
../secp256k1-src/src/num_gmp_impl.h:201:13: warning: unused function 'secp256k1_num_sub' [-Wunused-function]
static void secp256k1_num_sub(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
            ^
../secp256k1-src/src/num_gmp_impl.h:207:13: warning: unused function 'secp256k1_num_mul' [-Wunused-function]
static void secp256k1_num_mul(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) {
            ^
../secp256k1-src/src/num_gmp_impl.h:80:13: warning: unused function 'secp256k1_num_mod' [-Wunused-function]
static void secp256k1_num_mod(secp256k1_num_t *r, const secp256k1_num_t *m) {
            ^
../secp256k1-src/src/num_gmp_impl.h:234:13: warning: unused function 'secp256k1_num_shift' [-Wunused-function]
static void secp256k1_num_shift(secp256k1_num_t *r, int bits) {
            ^
../secp256k1-src/src/num_gmp_impl.h:149:12: warning: unused function 'secp256k1_num_is_neg' [-Wunused-function]
static int secp256k1_num_is_neg(const secp256k1_num_t *a) {
           ^
../secp256k1-src/src/num_gmp_impl.h:256:13: warning: unused function 'secp256k1_num_negate' [-Wunused-function]
static void secp256k1_num_negate(secp256k1_num_t *r) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:13:
In file included from ../secp256k1-src/src/field_impl.h:19:
../secp256k1-src/src/field_5x52_impl.h:54:13: warning: unused function 'secp256k1_fe_verify' [-Wunused-function]
static void secp256k1_fe_verify(const secp256k1_fe_t *a) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:15:
../secp256k1-src/src/group_impl.h:36:13: warning: unused function 'secp256k1_ge_set_infinity' [-Wunused-function]
static void secp256k1_ge_set_infinity(secp256k1_ge_t *r) {
            ^
../secp256k1-src/src/group_impl.h:161:13: warning: unused function 'secp256k1_gej_set_xy' [-Wunused-function]
static void secp256k1_gej_set_xy(secp256k1_gej_t *r, const secp256k1_fe_t *x, const secp256k1_fe_t *y) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:14:
../secp256k1-src/src/scalar_impl.h:28:13: warning: unused function 'secp256k1_scalar_get_num' [-Wunused-function]
static void secp256k1_scalar_get_num(secp256k1_num_t *r, const secp256k1_scalar_t *a) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:14:
In file included from ../secp256k1-src/src/scalar_impl.h:20:
../secp256k1-src/src/scalar_4x64_impl.h:886:13: warning: unused function 'secp256k1_scalar_split_128' [-Wunused-function]
static void secp256k1_scalar_split_128(secp256k1_scalar_t *r1, secp256k1_scalar_t *r2, const secp256k1_scalar_t *a) {
            ^
In file included from ../secp256k1-src/src/secp256k1.c:15:
../secp256k1-src/src/group_impl.h:227:12: warning: unused function 'secp256k1_gej_is_valid_var' [-Wunused-function]
static int secp256k1_gej_is_valid_var(const secp256k1_gej_t *a) {
           ^
15 warnings generated.
  SOLINK_MODULE(target) Release/secp256k1.node

@wanderer
Copy link
Member

thanks a bunch @taoeffect ! this is great. The remaining warnings should be taken care of by these flags I don't see the on linux. so maybe the flag is slightly different

@taoeffect
Copy link
Contributor

@wanderer Awesome, glad I could help. 😄

Do you think we can expect to see a new release soon? I ask because Embark is currently broken on OS X until this is fixed: embarklabs/embark#99

@wanderer
Copy link
Member

sure! @taoeffect do you mind send in a PR? I'll publish as a i get it

@taoeffect
Copy link
Contributor

@wanderer Sure, but what's the fix for the has_lib.sh file?

@taoeffect
Copy link
Contributor

@wanderer Nevermind. Seems to be working. PR #36 submitted.

@wanderer
Copy link
Member

ok 1.1.5 is up on npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants