[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #EPW-963095]: Compilation of NETCDF Fortran 4.4.4



It appears that it is linking against a libnetcdf that was built as a shared 
library.  Can you confirm that there are no other netcdf installs on your 
system beyond the one you have created in /hpctmp2/tmsyx/latest/netcdf?  This 
behavior would be explained if it was linking against a shared library that was 
not on the LD_LIBRARY_PATH, causing the C runtime to fail to find the library 
containing the symbols that it is complaining about.

Try this; go into /hpctmp2/tmsyx/latest/netcdf/lib and run:

    $ nm libnetcdf.a | grep nc_inq_varndims

Does nc_inq_varndims appear defined in the library? If so, then your netcdf 
fortran install is not linking against this library, and must be linking 
against a different one.  If nc_inq_varndims is not present, then I am at a 
loss as there is no reason it would not be. 

I hope this information is helpful; ideally we can identify an alternative 
netcdf version (it would be older, but not necessarily very old, if it lacks 
nc_inq_varndims) and perhaps remove it.

Have a good day,

-Ward

> 
> Hi,
> 
> I am compiling NETCDF Fortran 4.4.4 and from my understanding the program 
> could not link to the NETCDF-C library.
> 
> I have compiled NETCDF-C with HDF, szip, zlib as below:
> 
> ---------------------------------------------------------
> HDF5 (hdf5-1.8.18)
> 
> export CC=mpiicc
> export CFLAGS='-O1'
> export CXX=mpiicpc
> export CXXFLAGS='-O1'
> export CPP='icc -E'
> export CXXCPP='icpc -E'
> export F9X=mpiifort
> export FC=mpiifort
> export FCFLAGS='-O1'
> export LDFLAGS="-L/hpctmp2/tmsyx/latest/zlib/lib 
> -Wl,-rpath=/hpctmp2/tmsyx/latest/zlib/lib"
> 
> ./configure --prefix=/hpctmp2/tmsyx/latest/hdf5 --enable-shared=no 
> --enable-static --enable-fortran --disable-silent-rules  --enable-debug=all 
> --with-zlib=/hpctmp2/tmsyx/latest/zlib --with-szlib=/hpctmp2/tmsyx/latest/szip
> 
> ---------------------------------------------------------
> NETCDF-C (netcdf-4.3.3.1)
> 
> export CPPFLAGS=-I/hpctmp2/tmsyx/latest/hdf5/include
> export LDFLAGS="-L/hpctmp2/tmsyx/latest/hdf5/lib -lhdf5_hl -lhdf5 
> -L/hpctmp2/tmsyx/latest/zlib/lib -lz -L/hpctmp2/tmsyx/latest/szip/lib -lsz"
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/hpctmp2/tmsyx/latest/hdf5/lib
> 
> export CC=icc
> export CXX=icpc
> export CFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export CXXFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export F77=ifort
> export FC=ifort
> export F90=ifort
> export FFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export CPP='icc -E'
> export CXXCPP='icpc -E'
> 
> ./configure --prefix=/hpctmp2/tmsyx/latest/netcdf --enable-shared=no 
> --enable-static --enable-netcdf-4 --disable-dap
> ---------------------------------------------------------
> NETCDF-F (netcdf-fortran-4.4.4)
> 
> sh /app1/centos6.3/Intel/xe_2015/bin/compilervars.sh intel64
> 
> export CC=icc
> export CXX=icpc
> export CFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export CXXFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export F77=ifort
> export FC=ifort
> export F90=ifort
> export FFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export CPP='icc -E'
> export CXXCPP='icpc -E'
> 
> export 
> INCLUDE=/hpctmp2/tmsyx/latest/netcdf/include:/hpctmp2/tmsyx/latest/hdf5/include:$INCLUDE
> export CPPFLAGS="-I/hpctmp2/tmsyx/latest/netcdf/include 
> -I/hpctmp2/tmsyx/latest/hdf5/include -I/hpctmp2/tmsyx/latest/zlib/include"
> export LDFLAGS="-L/hpctmp2/tmsyx/latest/netcdf/lib 
> -L/hpctmp2/tmsyx/latest/hdf5/lib -L/hpctmp2/tmsyx/latest/zlib/lib 
> -L/hpctmp2/tmsyx/latest/szip/lib"
> export LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz -lsz"
> 
> ./configure --prefix=/hpctmp2/tmsyx/latest/netcdf --enable-static 
> --disable-shared
> 
> ---------------------------------------------------------
> If I set the LIBS var as above, the ./configure will stop with this error:
> “checking whether the C compiler works... no”
> 
> If I unset LIBS var, the ./configure went fine, along with make command. 
> However, I hit another wall when running make check with a lot of undefined 
> reference errors.
> 
> My apologies for this long email but I had this issue for almost 2 weeks now 
> and I am desperately trying to solve this issue. Attached are the config.log 
> file with 2 other log files which are output of “make” and “make check” 
> commands.
> 
> Thank you in advance for your support!
> 
> Cheers,
> Ethan
> 
> 
> Hi,
> 
> I am compiling NETCDF Fortran 4.4.4 and from my understanding the program 
> could not link to the NETCDF-C library.
> 
> I have compiled NETCDF-C with HDF, szip, zlib as below:
> 
> ---------------------------------------------------------
> HDF5 (hdf5-1.8.18)
> 
> export CC=mpiicc
> export CFLAGS='-O1'
> export CXX=mpiicpc
> export CXXFLAGS='-O1'
> export CPP='icc -E'
> export CXXCPP='icpc -E'
> export F9X=mpiifort
> export FC=mpiifort
> export FCFLAGS='-O1'
> export LDFLAGS="-L/hpctmp2/tmsyx/latest/zlib/lib 
> -Wl,-rpath=/hpctmp2/tmsyx/latest/zlib/lib"
> 
> ./configure --prefix=/hpctmp2/tmsyx/latest/hdf5 --enable-shared=no 
> --enable-static --enable-fortran --disable-silent-rules  --enable-debug=all 
> --with-zlib=/hpctmp2/tmsyx/latest/zlib --with-szlib=/hpctmp2/tmsyx/latest/szip
> 
> ---------------------------------------------------------
> NETCDF-C (netcdf-4.3.3.1)
> 
> export CPPFLAGS=-I/hpctmp2/tmsyx/latest/hdf5/include
> export LDFLAGS="-L/hpctmp2/tmsyx/latest/hdf5/lib -lhdf5_hl -lhdf5 
> -L/hpctmp2/tmsyx/latest/zlib/lib -lz -L/hpctmp2/tmsyx/latest/szip/lib -lsz"
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/hpctmp2/tmsyx/latest/hdf5/lib
> 
> export CC=icc
> export CXX=icpc
> export CFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export CXXFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export F77=ifort
> export FC=ifort
> export F90=ifort
> export FFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export CPP='icc -E'
> export CXXCPP='icpc -E'
> 
> ./configure --prefix=/hpctmp2/tmsyx/latest/netcdf --enable-shared=no 
> --enable-static --enable-netcdf-4 --disable-dap
> ---------------------------------------------------------
> NETCDF-F (netcdf-fortran-4.4.4)
> 
> sh /app1/centos6.3/Intel/xe_2015/bin/compilervars.sh intel64
> 
> export CC=icc
> export CXX=icpc
> export CFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export CXXFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export F77=ifort
> export FC=ifort
> export F90=ifort
> export FFLAGS='-O1 -xHost -ip -no-prec-div -static-intel'
> export CPP='icc -E'
> export CXXCPP='icpc -E'
> 
> export 
> INCLUDE=/hpctmp2/tmsyx/latest/netcdf/include:/hpctmp2/tmsyx/latest/hdf5/include:$INCLUDE
> export CPPFLAGS="-I/hpctmp2/tmsyx/latest/netcdf/include 
> -I/hpctmp2/tmsyx/latest/hdf5/include -I/hpctmp2/tmsyx/latest/zlib/include"
> export LDFLAGS="-L/hpctmp2/tmsyx/latest/netcdf/lib 
> -L/hpctmp2/tmsyx/latest/hdf5/lib -L/hpctmp2/tmsyx/latest/zlib/lib 
> -L/hpctmp2/tmsyx/latest/szip/lib"
> export LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz -lsz"
> 
> ./configure --prefix=/hpctmp2/tmsyx/latest/netcdf --enable-static 
> --disable-shared
> 
> ---------------------------------------------------------
> If I set the LIBS var as above, the ./configure will stop with this error:
> “checking whether the C compiler works... no”
> 
> If I unset LIBS var, the ./configure went fine, along with make command. 
> However, I hit another wall when running make check with a lot of undefined 
> reference errors.
> 
> My apologies for this long email but I had this issue for almost 2 weeks now 
> and I am desperately trying to solve this issue. Attached are the config.log 
> file with 2 other log files which are output of “make” and “make check” 
> commands.
> 
> Thank you in advance for your support!
> 
> Cheers,
> Ethan
> 


Ticket Details
===================
Ticket ID: EPW-963095
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.