TooTallNate / ref

Turn Buffer instances into "pointers"
http://tootallnate.github.com/ref
453 stars 141 forks source link

npm install ref fails on AIX #57

Closed gdams closed 6 years ago

gdams commented 7 years ago

I get the following error when installing ref on AIX:

Downloading project: https://github.com/TooTallNate/ref/archive/1.3.2.tar.gz
info: npm:                 Project downloaded ref-1.3.2.tgz
info: npm:                 install started     
 > weak@1.0.1 install /tmp/625143c3-063f-4798-85ba-3a3d9e582fa3/ref/node_modules/weak
verbose:                      > node-gyp rebuild                                                                  
 gmake: Entering directory `/tmp/625143c3-063f-4798-85ba-3a3d9e582fa3/ref/node_modules/weak/build'
 CXX(target) Release/obj.target/weakref/src/weakref.o
 SOLINK_MODULE(target) Release/obj.target/weakref.node
 COPY Release/weakref.node
 gmake: Leaving directory `/tmp/625143c3-063f-4798-85ba-3a3d9e582fa3/ref/node_modules/weak/build'
 > ref@1.3.2 install /tmp/625143c3-063f-4798-85ba-3a3d9e582fa3/ref
verbose:                      > node-gyp rebuild                                               
 gmake: Entering directory `/tmp/625143c3-063f-4798-85ba-3a3d9e582fa3/ref/build'
 CXX(target) Release/obj.target/binding/src/binding.o
 ../src/binding.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE {anonymous}::ReadInt64(Nan::NAN_METHOD_ARGS_TYPE)': 
 ../src/binding.cc:324:31: error: expected ')' before 'PRId64'                                                   
 snprintf(strbuf, 128, "%" PRId64, val);                                                                         
 ^                                                                                                               
 ../src/binding.cc:324:42: warning: spurious trailing '%' in format [-Wformat=]                                  
 snprintf(strbuf, 128, "%" PRId64, val);                                                                         
 ^                                                                                                               
 ../src/binding.cc:324:42: warning: too many arguments for format [-Wformat-extra-args]                          
 ../src/binding.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE {anonymous}::ReadUInt64(Nan::NAN_METHOD_ARGS_TYPE)':
 ../src/binding.cc:411:31: error: expected ')' before 'PRIu64'                                                   
 snprintf(strbuf, 128, "%" PRIu64, val);                                                                         
 ^                                                                                                               
 ../src/binding.cc:411:42: warning: spurious trailing '%' in format [-Wformat=]                                  
 snprintf(strbuf, 128, "%" PRIu64, val);                                                                         
 ^                                                                                                               
 ../src/binding.cc:411:42: warning: too many arguments for format [-Wformat-extra-args]                          
 gmake: *** [Release/obj.target/binding/src/binding.o] Error
 1                   
 gmake: Leaving directory `/tmp/625143c3-063f-4798-85ba-3a3d9e582fa3/ref/build'
 gyp                 

 ERR! build error    
 gyp ERR! stack Error: `gmake` failed with exit code: 
TooTallNate commented 7 years ago

Related: http://lammps.sandia.gov/threads/msg18980.html

On Fri, 2011-03-11 at 15:43 +0100, pim schravendijk wrote:

{schraven}\:/usr/include>grep PRId64 * inttypes.h:#define PRId64 "ld" inttypes.h:#define PRId64 "lld"

great so there is hope.

all we need to know now is which #define is needed to get the compiler to include the proper one of those defines.

on glibc/gcc this is wrapped in

/ The ISO C99 standard specifies that these macros must only be defined if explicitly requested. /

if !defined cplusplus || defined STDC_FORMAT_MACROS

on AIX it may be something like -D_ANSI_SOURCE or -D_STDC_SOURCE or -D_AIX_SOURCE

cheers, axel.