parro-it/netcdf4

Unable to install in my Mac OS. Is there some environment variables i need to set?

lioneldelmo opened this issue · 2 comments

netcdf4@0.4.1 install /BOLIDES/src/server/node_modules/netcdf4

node-gyp rebuild

CXX(target) Release/obj.target/netcdf4/src/Group.o
../src/Group.cpp:2:10: fatal error: 'netcdf.h' file not found
#include <netcdf.h>
^~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/netcdf4/src/Group.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2

Looks like uyour missing the netcdf library. Have you installed it? On the mac, I use homebrew. It has built and run fine (there are some warnings about possible incompatibilities, but these appear to be harmless).

brew install netcdf

and then do the npm insall

Also, make sure to set your LDFLAGS and CPPFLAGS properly when running the install.

For example, after installing netcdf using homebrew I had to run the command as:

$ LDFLAGS="-L/opt/homebrew/opt/netcdf/lib" CPPFLAGS="-I/opt/homebrew/opt/netcdf/include" npm install netcdf4