No such file or directory
I am quite a beginner and so my query may sound quite trivial to u guys but plz help me out with this
when i tried to have a netcad output i changed the make file as follow: FLAG_6 = -DNETCDF_IO IOLIBS = -L/usr/local/lib -lnetcdf IOINCS = -I/usr/local/include then i had the following results: /usr/bin/cpp -P -C -traditional -DGFORTRAN -P -C -traditional -DNETCDF_IO -DGCN -DDYE_RELEASE mod_ncdio.F > mod_ncdio.f90 gfortran -O3 -c -I/usr/local/include mod_ncdio.f90 In file mod_ncdio.f90:49 USE netcdf 1 Fatal Error: Can't open module file 'netcdf.mod' for reading at (1): No such file or directory make: *** [mod_ncdio.o] Error 1 any help |
Well.. is there a netcdf.mod file in /usr/include? Which linux distribution are you running on and how did you install netcdf libraries?
|
Quote:
i did not install the netcdf libraries myself but the IT team did it for me. the Linux server is called caunton |
Hmmm, is it in /usr/local/include (see the gfortran statement in your firts post) or in /usr/include?
Another story: there is a chance that a netcdf.mod file has been compiled using a fortran compiler different from that you are used to (gfortran). A compatibility issue may arise. In this case, take in mind that you can install netcdf libraries locally, under your home directory. You must not have root privileges to do that, since only your own files and directories are affected. If you need some help to do this (if it happens you need it), feel free to ask. |
Quote:
the following are my recent make file. FLAG_6 = -DNETCDF_IO IOLIBS = -L/usr/lib64 -lnetcdf IOINCS = -I/usr/include/ the required libraries are located in the above locations lib64 and include. Then the following are the massage that i received after i compiled mod_lag.f90:(.text+0x8c57): undefined reference to `__netcdf__nf90_put_var_1d_fourbytereal' mod_lag.f90:(.text+0x8ccb): undefined reference to `__netcdf__nf90_put_var_1d_fourbytereal' mod_lag.o:mod_lag.f90:(.text+0x8d3f): more undefined references to `__netcdf__nf90_put_var_1d_fourbytereal' follow mod_lag.o: In function `__mod_lag__dump_lag_restart': mod_lag.f90:(.text+0x8dae): undefined reference to `__netcdf__nf90_put_var_1d_fourbyteint' mod_lag.f90:(.text+0x8e25): undefined reference to `__netcdf__nf90_put_var_1d_fourbyteint' mod_lag.f90:(.text+0x8e34): undefined reference to `__netcdf__nf90_close' mod_lag.f90:(.text+0x90f5): undefined reference to `__netcdf__nf90_strerror' collect2: ld returned 1 exit status make: *** [fvcom] Error 1 i appreciate if you can guide me to start again and install Netcadf Correctly. as i mention before i am quite new in the field. so please keep in mind |
Ok. It looks like the NetCDF installed on the system have been compiled without the -fno-second-underscore option. So, if you want to install your own NetCDF for usage with gfortran, here are detailed instructions. The following commands will install NetCDF 3.6.3 under your HOME directory. I choosed version 3.6.3 instead of the more recent NetCDF 4 to avoid further complications. Unless you need the advanced functionalities of NetCDF 4, you can safely follow my choice.
1) First download the NetCDF source code (using wget from command line, or any ftp client with anonymous login) Code:
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-3.6.3.tar.gz Code:
tar zxvf netcdf-3.6.3.tar.gz -C $HOME Code:
export F77=gfortran Code:
./configure --prefix=$HOME/netcdf-3.6.3 --enable-shared Code:
make Code:
make check 2>&1 | tee check.log Code:
make install |
Thanks
i started to follow your procedure. however after the fourth step i received the following: checking whether we are using the GNU Fortran compiler... no checking whether gofortran accepts -g... no checking whether we are using the GNU Fortran 77 compiler... no checking whether gofortran accepts -g... no configure: setting up Fortran 90 checking for Fortran flag to compile .f90 files... unknown configure: error: Fortran could not compile .f90 files [enxmabm@caunton netcdf-3.6.3]$ |
Quote:
|
Thank you all it works now.
|
I'm glad to hear good news! :)
|
Quote:
|
For intel compilers
Set the build environment for intel compilers, the following way:
export CC=icc export CXX=icpc export CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel' export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel' export F77=ifort export FC=ifort export F90=ifort export FFLAGS='-O3 -xHost -ip -no-prec-div -static-intel' export CPP='icc -E' export CXXCPP='icpc -E' Rest of the steps remain the same as given by colucix |
All times are GMT -5. The time now is 03:03 AM. |