[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #CAM-704494]: problem compiling netcdf f90 example
- Subject: [netCDF #CAM-704494]: problem compiling netcdf f90 example
- Date: Mon, 11 Feb 2013 15:39:18 -0700
Hi Tatiana,
> I installed netcdf 4.2 (both C and fortran) and I used intel compilers
> version 13.1. I followed the installation instructions on this page
>
> http://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-netcdf-with-the-intel-compilers?page=1
I didn't know about that updated information from Intel, so thanks for pointing
it out.
> The installation went smoothly and all the tests passed. I managed to
> compile and F77 example program (simple_xy_wr.f), however I have problems
> compiling the F90 version:
>
> ...:/media/Data/my files$ ifort simple_xy_wr.f90 -o simple
> `/home/maneka/netcdf/bin/nf-config --fflags --flibs`
> simple_xy_wr.f90(19): error #7002: Error in opening the compiled module file.
> Check INCLUDE paths. [NETCDF]
> use netcdf
> ------^
The ifort compiler is looking for the netcdf.mod file, which got installed in
the include/
directory. Perhaps it is only looking for it in the lib/ directory. I'm not
sure what the
ifort option is for specifying where to find .mod module files. The
documentation I found
says to use -I dirname in one place and -module dirname in another place. It's
possible that
the nf-config command is not properly specifying the right right flag for
finding modules,
so try manually inserting -I or -module followed by the directory name where
the netcdf.mod
file was installed. Alternatively, you could try copying it into your current
directory to see
if it's found there.
> simple_xy_wr.f90(56): error #6404: This name does not have a type, and must
> have an explicit type. [NF90_CREATE]
> call check( nf90_create(FILE_NAME, NF90_CLOBBER, ncid) )
> --------------^
That error is probably just a consequence of not finding the netcdf.mod file,
which defines types
for function returns, among other things.
> This is what my nf-config gives out:
>
> --cc -> icc
> --cflags -> -I/home/maneka/netcdf/include -I/home/maneka/netcdf/include
> --libs -> -L/home/maneka/netcdf/lib -L/home/maneka/netcdf/lib -lnetcdf
> -lnetcdf
>
> --fc -> ifort
> --fflags -> -O3 -xHost -ip -no-prec-div -static-intel
> -I/home/maneka/netcdf/include
> --flibs -> -L/home/maneka/netcdf/lib -lnetcdff -L/home/maneka/netcdf/lib
> -lnetcdf -lnetcdf
> --has-f90 -> yes
>
> --has-nc2 -> yes
> --has-nc4 -> no
>
> --prefix -> /home/maneka/netcdf
> --includedir-> /home/maneka/netcdf/include
> --version -> netCDF-Fortran 4.2
>
> Variables PATH and LD_LIBRARY_PATH are set correctly.
>
> What can I be doing wrong?
Probably nothing, it's apparently a bug in the netcdf-fortran-4.2 nf-config
command, that
it doesn't provide the correct syntax for specifying whare modules are
installed.
--Russ
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu
Ticket Details
===================
Ticket ID: CAM-704494
Department: Support netCDF
Priority: Normal
Status: Closed