Unidata / netcdf-fortran

Official GitHub repository for netCDF-Fortran libraries, which depend on the netCDF C library. Install the netCDF C library first.
Other
238 stars 96 forks source link

Fatal Error: Cannot open module file 'netcdf.mod' for reading at (1) #379

Open Pouyeyazdi opened 2 years ago

Pouyeyazdi commented 2 years ago

Hello I am trying to install a software "https://github.com/geodynamics/relax" on my MacOS Catalina 10.15.7 doing ./waf configure I get this:

.... Checking for 'clang' (C compiler) : /usr/bin/clang Checking for 'gfortran' (Fortran compiler) : /usr/local/bin/gfortran Checking for 'clang++' (C++ compiler) : /usr/bin/clang++ Compiling a simple fortran app : yes Checking for netcdf.mod : no Could not find NETCDF

I tried FFLAGS="-I/usr/local/Cellar/netcdf/4.8.1/include" ./waf configure too but same error came up. I have GMT, PROJ and Python installed. To let you know I use several condo environments and I suppose I have netcdf in some but I just installed netCDF using macports too: sudo port install netcdf it is now inside /usr/local/Cellar/netcdf and netcdf.mod inside /usr/local/Cellar/netcdf/4.8.1/include

Could you please help me understanding what is the problem and what should I do? Kind regards

WardF commented 2 years ago

I'm not familiar with macports, but it sounds like it may have the C library (v4.8.1) installed. The Fortran interface, which netcdf.mod is a part of, is a different version, so I am surprised it is in the directory for the C library files. Can you check macports to see if it has a netcdf-fortran library available and, if so, install that?