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

[netCDF #ASX-279014]: Building netcdf-fortran-4.2 on 64-bit CentOS 5.6



Jennifer,

You could try setting LD_LIBRARY_PATH with /opt/netcdf/4.2/intel/11.1.064/lib/ 
*before* /opt/netcdf/4.2/gnu/4.1.2/lib (or eliminate the latter from 
LD_LIBRARY_PATH).  Then run configure, though I don't know why that should be 
necessary, given that you've set LDFLAGS -L/opt/netcdf/4.2/gnu/4.1.2/lib.

--Russ

> > I found an error in my LDFLAGS environment variable, I had put -I instead 
> > of -L. Oops! I made that change, reran configure, make, and then tried 
> > 'make check'. Here's the result:
> >
> > is6[root]:/opt/netcdf/4.2/intel/11.1.064/src # make check
> > Making check in f90
> > make[1]: Entering directory `/opt/netcdf/4.2/intel/11.1.064/src/f90'
> > make  check-am
> > make[2]: Entering directory `/opt/netcdf/4.2/intel/11.1.064/src/f90'
> > make[2]: Nothing to be done for `check-am'.
> > make[2]: Leaving directory `/opt/netcdf/4.2/intel/11.1.064/src/f90'
> > make[1]: Leaving directory `/opt/netcdf/4.2/intel/11.1.064/src/f90'
> > Making check in fortran
> > make[1]: Entering directory `/opt/netcdf/4.2/intel/11.1.064/src/fortran'
> > make  check-am
> > make[2]: Entering directory `/opt/netcdf/4.2/intel/11.1.064/src/fortran'
> > make[2]: Nothing to be done for `check-am'.
> > make[2]: Leaving directory `/opt/netcdf/4.2/intel/11.1.064/src/fortran'
> > make[1]: Leaving directory `/opt/netcdf/4.2/intel/11.1.064/src/fortran'
> > Making check in nf_test
> > make[1]: Entering directory `/opt/netcdf/4.2/intel/11.1.064/src/nf_test'
> > make  nf_test          tst_f90
> > make[2]: Entering directory `/opt/netcdf/4.2/intel/11.1.064/src/nf_test'
> > ifort -DHAVE_CONFIG_H -I. -I.. -I../fortran   
> > -I/opt/netcdf/4.2/gnu/4.1.2/include -I../fortran  -I../f90 -g -c -o 
> > test_get.o test_get.F
> > ifort -DHAVE_CONFIG_H -I. -I.. -I../fortran   
> > -I/opt/netcdf/4.2/gnu/4.1.2/include -I../fortran  -I../f90 -g -c -o 
> > test_put.o test_put.F
> > ifort -DHAVE_CONFIG_H -I. -I.. -I../fortran   
> > -I/opt/netcdf/4.2/gnu/4.1.2/include -I../fortran  -I../f90 -g -c -o 
> > nf_error.o nf_error.F
> > ifort -DHAVE_CONFIG_H -I. -I.. -I../fortran   
> > -I/opt/netcdf/4.2/gnu/4.1.2/include -I../fortran  -I../f90 -g -c -o 
> > nf_test.o nf_test.F
> > ifort -DHAVE_CONFIG_H -I. -I.. -I../fortran   
> > -I/opt/netcdf/4.2/gnu/4.1.2/include -I../fortran  -I../f90 -g -c -o 
> > test_read.o test_read.F
> > ifort -DHAVE_CONFIG_H -I. -I.. -I../fortran   
> > -I/opt/netcdf/4.2/gnu/4.1.2/include -I../fortran  -I../f90 -g -c -o 
> > test_write.o test_write.F
> > ifort -DHAVE_CONFIG_H -I. -I.. -I../fortran   
> > -I/opt/netcdf/4.2/gnu/4.1.2/include -I../fortran  -I../f90 -g -c -o util.o 
> > util.F
> > depbase=`echo fortlib.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
> > /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I../fortran   
> > -I/opt/netcdf/4.2/gnu/4.1.2/include  -g -O1 -fPIC  -MT fortlib.o -MD -MP 
> > -MF $depbase.Tpo -c -o fortlib.o fortlib.c &&\
> > mv -f $depbase.Tpo $depbase.Po
> > /bin/sh ../libtool --tag=F77   --mode=link ifort -I../fortran  -I../f90 -g  
> > -L/opt/netcdf/4.2/gnu/4.1.2/lib -o nf_test test_get.o test_put.o nf_error.o 
> > nf_test.o test_read.o test_write.o util.o fortlib.o ../fortran/libnetcdff.la
> > libtool: link: ifort -I../fortran -I../f90 -g -o .libs/nf_test test_get.o 
> > test_put.o nf_error.o nf_test.o test_read.o test_write.o util.o fortlib.o  
> > -L/opt/netcdf/4.2/gnu/4.1.2/lib ../fortran/.libs/libnetcdff.so -Wl,-rpath 
> > -Wl,/opt/netcdf/4.2/intel/11.1.064/lib
> > /opt/intel/compiler/11.1.064/lib/intel64/libimf.so: warning: warning: 
> > feupdateenv is not implemented and will always fail
> > ../fortran/.libs/libnetcdff.so: undefined reference to `nc_put_vara_short'
> > ../fortran/.libs/libnetcdff.so: undefined reference to `nc_get_vara_short'
> 
> It looks like ifort is not finding the C library in the 
> /opt/netcdf/4.2/intel/11.1.064/lib/.
> Is there a netCDF-4.2 C library installed there, or did it get deleted when 
> you started over?
> 
> If it's there, I'm not sure what's going on ...
> 
> --Russ
> 
> > ../fortran/.libs/libnetcdff.so: undefined reference to `ncattdel'
> > ../fortran/.libs/libnetcdff.so: undefined reference to `nc_get_att_float'
> > <lots of undefined references snipped>
> > ../fortran/.libs/libnetcdff.so: undefined reference to `nc_inq_var'
> > ../fortran/.libs/libnetcdff.so: undefined reference to `nc_get_var_int'
> > ../fortran/.libs/libnetcdff.so: undefined reference to `nc__create_mp'
> > make[2]: *** [nf_test] Error 1
> > make[2]: Leaving directory `/opt/netcdf/4.2/intel/11.1.064/src/nf_test'
> > make[1]: *** [check-am] Error 2
> > make[1]: Leaving directory `/opt/netcdf/4.2/intel/11.1.064/src/nf_test'
> > make: *** [check-recursive] Error 1
> >
> > I can't even get to the point where I'm testing for v2 and v4 APIs!
> 
> 
> > On May 16, 2012, at 11:37 AM, Unidata netCDF Support wrote:
> >
> > > Hi Jennifer,
> > >
> > >> I have successfully built the C version of netcdf-4.2 with lots of
> > >> important features enabled, here is the output from nc-config:
> > >>
> > >> # /opt/netcdf/4.2/gnu/4.1.2/bin/nc-config --all
> > >>
> > >> This netCDF 4.2 has been built with the following features:
> > >> --cc        -> /usr/bin/gcc
> > >> --cflags    ->  -I/opt/netcdf/4.2/gnu/4.1.2/include 
> > >> -I/opt/hdf5/1.8.8/intel/11.1.064/include 
> > >> -I/opt/hdf/4.2.6/intel/11.1.064/include -I/opt/szip/2.1/include
> > >> --libs      -> -L/opt/netcdf/4.2/gnu/4.1.2/lib -lnetcdf
> > >> --cxx       -> @CXX@
> > >> --has-c++   -> @HAS_CXX@
> > >> --fc        -> @FC@
> > >> --fflags    -> @FFLAGS@ @MOD_FLAG@/opt/netcdf/4.2/gnu/4.1.2/include
> > >> --flibs     -> -L/opt/netcdf/4.2/gnu/4.1.2/lib @NC_FLIBS@
> > >> --has-f77   -> @HAS_F77@
> > >> --has-f90   -> @HAS_F90@
> > >> --has-dap   -> yes
> > >> --has-nc2   -> yes
> > >> --has-nc4   -> yes
> > >> --has-hdf5  -> yes
> > >> --has-hdf4  -> yes
> > >> --has-pnetcdf-> no
> > >> --has-szlib ->
> > >> --prefix    -> /opt/netcdf/4.2/gnu/4.1.2
> > >> --includedir-> /opt/netcdf/4.2/gnu/4.1.2/include
> > >> --version   -> netCDF 4.2
> > >>
> > >> We use a module system to set paths and the right environment, here is
> > >> the output from the 'env | grep netcdf' command:
> > >>
> > >> PATH=/opt/netcdf/4.2/gnu/4.1.2/bin:/opt/hdf/4.2.6/intel/11.1.064/bin:/opt/hdf5/1.8.8/intel/11.1.064/bin:/opt/intel/compiler/11.1.064/bin/intel64:/homes/jma/bin:/homes/jma/ncl-6.0.0/bin:/homes/colagds/bin:/usr/local/grads/2.0:/usr/local/grads:/usr/kerberos/bin:/usr/java/default/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:.
> > >> PWD=/opt/netcdf/4.2/intel/11.1.064
> > >> LD_LIBRARY_PATH=/opt/netcdf/4.2/gnu/4.1.2/lib:/opt/szip/2.1/gnu/4.1.2/lib:/opt/hdf/4.2.6/intel/11.1.064/lib:/opt/hdf5/1.8.8/intel/11.1.064/lib:/opt/intel/compiler/11.1.064/ipp/em64t/sharedlib:/opt/intel/compiler/11.1.064/mkl/lib/em64t:/opt/intel/compiler/11.1.064/tbb/intel64/cc4.1.0_libc2.4_kernel2.6.16.21/lib:/opt/intel/compiler/11.1.064/lib/intel64:/opt/udunits/2.1.23/lib
> > >> MANPATH=/opt/netcdf/4.2/gnu/4.1.2/share/man:/opt/intel/compiler/11.1.064/mkl/man:/opt/intel/compiler/11.1.064/man:/usr/java/default/man:
> > >> LOADEDMODULES=intel/11.1.064:hdf5/1.8.8/intel/11.1.064:hdf/4.2.6/intel/11.1.064:szip/2.1/gnu/4.1.2:netcdf/4.2/gnu/4.1.2
> > >> INCLUDE=/opt/netcdf/4.2/gnu/4.1.2/include:/opt/szip/2.1/gnu/4.1.2/include:/opt/hdf/4.2.6/intel/11.1.064/include:/opt/hdf5/1.8.8/intel/11.1.064/include:/opt/intel/compiler/11.1.064/ipp/em64t/include:/opt/intel/compiler/11.1.064/mkl/include
> > >> INFOPATH=/opt/netcdf/4.2/gnu/4.1.2/share/info
> > >> LIBRARY_PATH=/opt/netcdf/4.2/gnu/4.1.2/lib:/opt/szip/2.1/gnu/4.1.2/lib:/opt/hdf/4.2.6/intel/11.1.064/lib:/opt/hdf5/1.8.8/intel/11.1.064/lib:/opt/intel/compiler/11.1.064/ipp/em64t/lib:/opt/intel/compiler/11.1.064/mkl/lib/em64t:/opt/intel/compiler/11.1.064/tbb/intel64/cc4.1.0_libc2.4_kernel2.6.16.21/lib
> > >> NETCDF=/opt/netcdf/4.2/gnu/4.1.2
> > >> NETCDF_HOME=/opt/netcdf/4.2/gnu/4.1.2
> > >> _LMFILES_=/opt/Modules/modulefiles/intel/11.1.064:/opt/Modules/modulefiles/hdf5/1.8.8/intel/11.1.064:/opt/Modules/modulefiles/hdf/4.2.6/intel/11.1.064:/opt/Modules/modulefiles/szip/2.1/gnu/4.1.2:/opt/Modules/modulefiles/netcdf/4.2/gnu/4.1.2
> > >>
> > >>
> > >> Now I am trying to build the fortran version of 4.2. We have the intel
> > >> fortran compiler, ifort, version 11.1.064. Before I begin I set three
> > >> environment vars, then run ./configure with only the --prefix option:
> > >>
> > >> setenv FC ifort
> > >> setenv CPPFLAGS -I/opt/netcdf/4.2/gnu/4.1.2/include
> > >> setenv LDFLAGS -I/opt/netcdf/4.2/gnu/4.1.2/lib
> > >> ./configure --prefix=/opt/netcdf/4.2/intel/11.1.064
> > >>
> > >> Configure and make all work fine, but nf-config says I don't have nc4
> > >> support:
> > >>
> > >> is6[jma]:/opt/netcdf/4.2/intel/11.1.064/src # ../bin/nf-config --all
> > >> This netCDF-Fortran 4.2 has been built with the following features:
> > >> --cc        -> /usr/bin/gcc
> > >> --cflags    ->  -I/opt/netcdf/4.2/intel/11.1.064/include 
> > >> -I/opt/netcdf/4.2/gnu/4.1.2/include
> > >> --libs      -> -L/opt/netcdf/4.2/intel/11.1.064/lib 
> > >> -I/opt/netcdf/4.2/gnu/4.1.2/lib -lnetcdf
> > >> --fc        -> ifort
> > >> --fflags    -> -g -I/opt/netcdf/4.2/intel/11.1.064/include
> > >> --flibs     -> -L/opt/netcdf/4.2/intel/11.1.064/lib -lnetcdff 
> > >> -I/opt/netcdf/4.2/gnu/4.1.2/lib -lnetcdf
> > >> --has-f90   -> yes
> > >> --has-nc2   -> no
> > >> --has-nc4   -> no
> > >> --prefix    -> /opt/netcdf/4.2/intel/11.1.064
> > >> --includedir-> /opt/netcdf/4.2/intel/11.1.064/include
> > >> --version   -> netCDF-Fortran 4.2
> > >>
> > >> It doesn't say whether the fortran library is dap-enabled, but I need
> > >> that too. The --enable-netcdf-4 option does not appear to be valid with
> > >> the fortran version of the configure script. I am primarily a C
> > >> programmer, not all that experienced in building fortran code. Can you
> > >> see what I am doing wrong here? Let me know if you need any more
> > >> information...
> > >
> > > These are symptoms of bugs in nc-config and nf-config, not calling each 
> > > other
> > > to determine what features are supported.  We need to get out a bug-fix 
> > > release
> > > for netcdf-fortran soon, because I think these bugs are fixed in the 
> > > current snapshot.
> > > Unfortunately, there's no bundled snapshot release of netcdf-fortran yet, 
> > > only
> > > an svn source tree. The issue for tracking is here:
> > >
> > >  https://www.unidata.ucar.edu/jira/browse/NCF-165
> > >
> > > I believe running "make check" for the Fortran release should verify that 
> > > you actually
> > > have support for version 2 interfaces and for the netCDF-4 APIs.  Let me 
> > > know if your
> > > "make check" for Fortran does not include these lines:
> > >
> > >  *** Testing netCDF v2 api for F77.
> > >  *** SUCCESS!
> > > PASS: tst_f77_v2
> > >
> > > *** Testing definition of netCDF-4 vars from Fortran 77.
> > > *** SUCCESS!
> > > PASS: ftst_vars
> > >
> > > *** Testing netCDF-4 vars from F77 with new types.
> > > *** SUCCESS!
> > > PASS: ftst_vars2
> > >
> > > *** Testing enum and opaque types.
> > > *** SUCCESS!
> > > PASS: ftst_vars3
> > >
> > > *** Testing VLEN types.
> > > *** SUCCESS!
> > > PASS: ftst_vars4
> > >
> > > *** Testing compound types.
> > > *** SUCCESS!
> > > PASS: ftst_vars5
> > >
> > > If you see all those, then that verifies "nf-config --all" is wrong
> > > about the supported features.  Also, DAP access is supported in the
> > > Fortran APIs as a consequence of support in the separate C library,
> > > but I see it's not explicitly tested for when "make check" is run.
> > >
> > > The current versions of nc-config.in for the C release and nf-config.in
> > > for the Fortran release are available here:
> > >
> > >  http://svn.unidata.ucar.edu/repos/netcdf/trunk/nc-config.in
> > >  http://svn.unidata.ucar.edu/repos/netcdf-fortran/trunk/nf-config.in
> > >
> > > Unfortunately to fix nc-config and nf-config requires starting over by
> > > copying the two files above into the top source directory of the 
> > > respective
> > > releases, rerunning configure, make check, make install for the C release,
> > > then rerunning configure, make check, make install for the Fortran 
> > > release.
> > >
> > > Please let us know if that doesn't fix the problems with nf-config 
> > > returning
> > > the wrong information, and thanks for reporting the bugs!
> > >
> > > --Russ
> > >
> > > Russ Rew                                         UCAR Unidata Program
> > > address@hidden                      http://www.unidata.ucar.edu
> > >
> > >
> > >
> > > Ticket Details
> > > ===================
> > > Ticket ID: ASX-279014
> > > Department: Support netCDF
> > > Priority: Normal
> > > Status: Closed
> > >
> >
> > --
> > Jennifer M. Adams
> > IGES/COLA
> > 4041 Powder Mill Road, Suite 302
> > Calverton, MD 20705
> > address@hidden
> >
> >
> >
> >
> >
> Russ Rew                                         UCAR Unidata Program
> address@hidden                      http://www.unidata.ucar.edu
> 
> 
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: ASX-279014
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.