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

Use of --includedir from nc-config in build #1227

Open
tomgreen66 opened this issue Dec 13, 2022 · 1 comment
Open

Use of --includedir from nc-config in build #1227

tomgreen66 opened this issue Dec 13, 2022 · 1 comment

Comments

@tomgreen66
Copy link

Version: 1.6.2
Environment: Linux, Cray Compiler with GNU, Python 3.8.5
Steps:

Trying to install netcdf4 pip package on Cray system. Using:

$ module swap PrgEnv-cray PrgEnv-gnu
$ module load cray-netcdf
$ module load cray-hdf5
$ module load cray-python
$ python -m venv venv
$ . venv/bin/activate
$ nc-config --all
...
--cflags        -> -DpgiFortran
...
--includedir    -> /opt/cray/pe/netcdf/4.7.4.4/GNU/8.3/include
$ pip install netCDF4==1.6.2
...
      src/netCDF4/_netCDF4.c:749:10: fatal error: netcdf.h: No such file or directory
        749 | #include "netcdf.h"
            |          ^~~~~~~~~~
      compilation terminated.

It looks like the --cflags are only used in the build setup and the --includedir from nc-config is ignored.

dep = subprocess.Popen([ncconfig, '--cflags'],

Workaround was to:

NETCDF4_DIR=$NETCDF_DIR USE_NCCONFIG=0 pip install netCDF4==1.6.2

Should --includedir from nc-config be automatically added to build include search path?

@jswhit
Copy link
Collaborator

jswhit commented Dec 13, 2022

perhaps you are correct - usually the include directory ends up in cflags but in your case it did not for some reason.

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

No branches or pull requests

2 participants