> Hi Russ, > > Thank you for your reply - > > I did a complete reinstall of OS 10.9. and reinstalled netcdf from ports. The > relevant netcdf module files are now in the correct directories. However, > when compiling, I still have the same error: > > ---- > > configure:15807: checking the Fortran 90 module netcdf is available > configure:15815: mpif90 -c -g -O2 conftest.f90 > conftest.f90:2.4: > > use netcdf > 1 > Fatal Error: Can't open module file 'netcdf.mod' for reading at (1): No such > file or directory > > ---- > > The âconftest.f90â file does not exist anywhere on my system, thus using > the command line instructions you recommended did not work. The directory > /usr/local/Cellar/netcdf/184.108.40.206/include exists, but not the conftest.f90 > file. I believe I have installed all the required packages - which package is > directly responsible for the conftest.f90 file? The conftest.f90 file is created temporarily by the configure script, in order to test characteristics of the Fortran compiler and development environment. In this case, it is merely testing whether the netcdf.mod file can be located by the Fortran compiler (mpif90). But the arguments to mpif90 should tell it where to look for netcdf.mod, with an argument like "-I/PATH/TO/NETCDF/include", where /PATH/TO/NETCDF is where you installed the netCDF-C library. In order to specify this location to the Fortran compiler, you need to specify it in the CPPFLAGS environment variable when running the netCDF Fortran configure script, as explained here: http://www.unidata.ucar.edu/netcdf/docs/building_netcdf_fortran.html Note that this is not an OSX problem, but would apply to installing the netCDF Fortran library on any Unix-like platform. --Russ > On 24 May 2014, at 03:00, Unidata netCDF Support <address@hidden> wrote: > > > Hi Jason, > > > >> Description of problem: I am attempting to make a build based on Fortran > >> code. During the make process, I encounter the error: Can't open module > >> file 'netcdf.mod' for reading at (1). > >> > >> I can confirm that the "netcdf.mod" file does not exist in any directory. > >> Evidently, it was not made during the configuration process. > > > > Installing the netCDF Fortran software should install the netcdf.mod file in > > the right include directory, assuming you have the necessary permissions to > > copy files there. > > > > Maybe you need to set CPPFLAGS or provide an equivalent configure option for > > the software you're building to tell it in which include directory to look > > for the netcdf.mod file. My Spotlight says it's installed in several > > places, > > including /opt/local/include/NETCDF.mod installed by MacPorts when I ran > > "port install netcdf-fortran" last summer. I also see the all lower-case > > netcdf.mod file in various other "include/" directories from testing other > > versions in the past. > > > > Here are the instructions that work for me out-of-the-box, using CPPFLAGS > > and > > LDFLAGS environment variables, with either of the current releases of netCDF > > Fortran (version 4.2 or 4.4-beta1), after the netCDF C library is installed: > > > > http://www.unidata.ucar.edu/netcdf/docs/building_netcdf_fortran.html > > > > I can see from your config.log that the compile line generated to test for > > netcdf.mod didn't specify a directory in which to search for that file: > > > > configure:15807: checking the Fortran 90 module netcdf is available > > configure:15815: mpif90 -c -g -O2 conftest.f90 > > conftest.f90:2.4: > > > > use netcdf > > 1 > > Fatal Error: Can't open module file 'netcdf.mod' for reading at (1): No > > such file or directory > > > > That mpif90 invocation, in your case, should have been something like > > > > mpif90 -c -g -O2 -I/usr/local/Cellar/netcdf/220.127.116.11/include conftest.f90 > > > > so try setting CPPFLAGS=-I/usr/local/Cellar/netcdf/18.104.22.168/include before > > running configure. > > > > --Russ > > > > > > > > > > > > > > > > > > > >> Netcdf was installed using fink. After fink failed, tried using macports > >> and homebrew, which also failed to install the netcdf.mod file. After > >> uninstalling the ports and brew netcdf, I reinstalled fink, to no avail. > >> Here are the installed netcdf packages: > >> > >> netcdf-bin 4.3.2-1 Array-based data access, user programs > >> netcdf-c7 4.3.2-1 Array-based data access, C headers and docs > >> netcdf-c7-shlib 4.3.2-1 Array-based data access, C library > >> netcdf-cxx4 4.2.1-1 Array-based data access, C++ headers and ... > >> netcdf-cxx4-shl 4.2.1-1 Array-based data access, C++ library > >> netcdf-fortran5 4.2-9 Array-based data access, Fortran headers/doc > >> netcdf-fortran5 4.2-9 Array-based data access, Fortran library > >> netcdf-oct343 1.0.2-1 MATLAB compatible NetCDF interface for Oc... > >> netcdf-oct360 1.0.2-1 MATLAB compatible NetCDF interface for Oc... > >> netcdf-oct361 1.0.2-1 MATLAB compatible NetCDF interface for Oc... > >> netcdf-oct362 1.0.2-1 MATLAB compatible NetCDF interface for Oc... > >> netcdf-oct363 1.0.2-1 MATLAB compatible NetCDF interface for Oc... > >> netcdf-oct364 1.0.2-1 MATLAB compatible NetCDF interface for Oc... > >> > >> Compiling fortran code in command line encounters no problems. Other > >> forums on a similar topic have failed to help me. Can post more > >> information if necessary; I have also attached the relevant config.log > >> file. I also previously installed netcdf from the source code, and > >> encountered the same problem. Any assistance much appreciated, > >> > >> Many thanks, > >> > >> Jason > >> > >> > > Russ Rew UCAR Unidata Program > > address@hidden http://www.unidata.ucar.edu > > > > > > > > Ticket Details > > =================== > > Ticket ID: MZG-331133 > > Department: Support netCDF > > Priority: Normal > > Status: Closed > > > > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: MZG-331133 Department: Support netCDF Priority: Normal Status: Closed
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.