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

[netCDF #FLE-841916]: Testsuite summary for netCDF 4.3.2



Ben,

> I was able to compile an older version of fortran netcdf 4.2 and it worked 
> with pgf90.
> i thought momentarily that i was in the clear. but another program that 
> relies not he netcdf libraries is not compiling properly. i is giving me some 
> ‘unidentified reference’ message, for example:
> /mnt/data/bweinste/MEGAN/MEGANv2.10/local/IOAPI2/Linux2_x86_64pg_gcc_nomp/libnetcdff.a(fort-attio.o):
>  In function `nf_get_att_text_':
> /home/bweinste/WORK/MEGAN/MEGANv2.10/local/NETCDF/netcdf-fortran-4.2/fortran/fort-attio.c:22:
>  undefined reference to `nc_get_att_text'
> 
> does this indicate that it can’t find the libraries?  one interesting thing 
> is that when I go to the directory where i built netcdf and cetcdff and type:
> bweinste@bora2:~/WORK/MEGAN/MEGANv2.10/local/NETCDF/bin$ nc-config --all
> 
> This netCDF 4.3.2 has been built with the following features:
> 
> --cc        -> gcc
> --cflags    ->  -I/usr/local/include
> --libs      -> -L/usr/local/lib -lnetcdf
> 
> --has-c++   -> no
> --cxx       ->
> --has-c++4  -> no
> --cxx4      ->
> 
> --fc        ->
> --fflags    ->
> --flibs     ->
> --has-f90   -> no
> 
> --has-dap   -> no
> --has-nc2   -> yes
> --has-nc4   -> yes
> --has-hdf5  -> yes
> --has-hdf4  -> no
> --has-pnetcdf-> no
> 
> --prefix    -> /usr/local
> --includedir-> /usr/local/include
> --version   -> netCDF 4.3.2
> 
> this tells me that the cflags and libraries are pointing to the library you 
> set up. 

Yes, that means you have /usr/local/bin in your PATH (you can verify by running 
the command "which nc-config") or by looking at "echo $PATH" output.

So when you type "nc-config --all", the shell is finding 
/usr/local/bin/nc-config, 
which was built with all the infomation about the netCDF-C library configured 
with 
"--prefix=/usr/local".

> ... but when I type:
> 
> bweinste@bora2:~/WORK/MEGAN/MEGANv2.10/local/NETCDF/bin$ ./nc-config --all
> 
> This netCDF 4.3.2 has been built with the following features:
> 
> --cc        -> gcc
> --cflags    ->  -I/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/include 
> -I/mnt/data/bweinste/MEGAN/MEGANv2.10/local/hdf5/include
> --libs      -> -L/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/lib -lnetcdf
> 
> --has-c++   -> no
> --cxx       ->
> --has-c++4  -> no
> --cxx4      ->
> 
> --fc        ->
> --fflags    ->
> --flibs     ->
> --has-f90   -> no
> 
> --has-dap   -> no
> --has-nc2   -> yes
> --has-nc4   -> yes
> --has-hdf5  -> yes
> --has-hdf4  -> no
> --has-pnetcdf-> no
> 
> --prefix    -> /mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF
> --includedir-> /mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/include
> --version   -> netCDF 4.3.2
> 
> I don’t know why the' ./ ‘ makes a difference. notice how the cflags, libs, 
> prefix, included are pointing at two different places? the place where I want 
> them to be pointing to is the ../MEGAN/MEGANv2.10/local/NETCDF directory.

When you run "./nc-config", that tells the shell to run the nc-config
command in the current working directory (that is what "./" means), so
the shell doesn't look in directories located in your PATH for the
nc-config command.  So in this case, you are using the nc-config that
was installed when you built netCDF-C with
"--prefix=/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF".

> It’s the same for the fortran configuration nf-config.
> 
> bweinste@bora2:~/WORK/MEGAN/MEGANv2.10/local/NETCDF/bin$ ./nf-config --all
> 
> This netCDF-Fortran 4.2 has been built with the following features:
> 
> --cc        -> gcc
> --cflags    ->  -I/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/include 
> -I/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/include
> --libs      -> -L/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/lib 
> -L/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/lib -lnetcdf -lnetcdf
> 
> --fc        -> pgf90
> --fflags    -> -g -I/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/include
> --flibs     -> -L/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/lib 
> -lnetcdff -L/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/lib -lnetcdf 
> -lnetcdf
> --has-f90   -> yes
> 
> --has-nc2   -> yes
> --has-nc4   -> yes
> 
> --prefix    -> /mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF
> --includedir-> /mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF/include
> --version   -> netCDF-Fortran 4.2
> 
> bweinste@bora2:~/WORK/MEGAN/MEGANv2.10/local/NETCDF/bin$ nf-config --all
> 
> This netCDF-Fortran 4.2 has been built with the following features:
> 
> --cc        -> gcc
> --cflags    ->  -I/usr/local/include
> --libs      -> -L/usr/local/lib  -lnetcdf -lnetcdf
> 
> --fc        -> pgf95
> --fflags    -> -g -I/usr/local/include
> --flibs     -> -L/usr/local/lib -lnetcdff  -lnetcdf -lnetcdf
> --has-f90   -> yes
> 
> --has-nc2   -> yes
> --has-nc4   -> yes
> 
> --prefix    -> /usr/local
> --includedir-> /usr/local/include
> --version   -> netCDF-Fortran 4.2
> 
> I have a feeling like this could be part of why the model i need to run is 
> still not recognizing where all the libraries are. do you have any idea how 
> to fix this? do i need to recompile again but somehow differently? or is 
> there a way to tell the server that the only nc-config it needs to think 
> about is the one i built in the directory i want it to be in

If you have several versions of a command or library installed in
different directories, the shell has to know which ones to use.  The
PATH environment variable tells it where to look for executable
commands, such as ncdump and nc-config.  Similarly, the
LD_LIBRARY_PATH environment variable tells the run-time linker where
to look for libraries loaded at run time.  If you want to build a
netCDF-Fortran application to find libraries in some place where the
system doesn't look by default, you have to either use the -L flag to
specify some particular directory to look in for libraries, or you
have to set the LD_LIBRARY_PATH environment variable to tell the
run-time linker where to look for shared libraries during execution.

You can use the nf-config application to help you build a Fortran
library that calls netCDF functions.  For example, if you have the
environment variable NFDIR set to
/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF, and you have a
Fortran program foo.f90, then you can see what compiler flags to use
like this:

  $ PATH=$NFDIR/bin:$PATH      # look in $NFDIR for executables first
  $ nf-config --fflags --flibs       # show Fortran compile flags and Fortran 
libraries needed for netCDF

or you can just use the same PATH as above and compile directly like
this (note use of back-quotes " ` " instead of ordinary quotes " ' "):

  $ gfortran -o foo foo.f90 `nf-config --fflags --flibs`

If you used a different Fortran compiler than gfortran, you could even
use nf-config to use the same compiler the library was built for like
this:

  $ `nf-config --fc`  -o foo foo.f90 `nf-config --fflags --flibs`

See the output of "nf-config --help" for other options.

--Russ

> On Sep 23, 2014, at 11:46 AM, Unidata netCDF Support <address@hidden> wrote:
> 
> > Ben,
> >
> >> thanks for this email and your previous help.
> >>> /usr/local/bin/nc-config --has-hdf5
> >>> /usr/local/bin/nc-config --has-dap
> >>
> >>
> >> these both return yes. so I gather that the netcdf library was installed 
> >> with hdf5.
> >>
> >> i’ve moved on to installing the netCDF fortran library and we are again 
> >> running into problems.
> >>
> >> the air quality models i hope to run are built for pgf90 as opposed to 
> >> gfortran. my hope is to compile netcdf-fortran-4.4.1
> >> with pgf90. we were able to successfully change the compiler in the 
> >> Makefile but then we get an error stating:
> >>
> >> PGF90-S-0081-Illegal selector - KIND value must be non-negative 
> >> (module_netcdf_nc_data.F90: 175)
> >>
> >> do you know how to work around this problem?
> >
> > We don't have access to PGI C or Fortran compilers here, so don't test with 
> > them.
> > PGI provides its own guide to building netCDF Fortran with their compilers, 
> > though
> > it may be a little out of date, and shows csh rather than bash shell syntax 
> > for
> > setting environment variables:
> >
> >  http://www.pgroup.com/resources/netcdf/netcdf411_pgi2011.htm
> >
> > However, the error message you showed above indicates that the pgf90 Fortran
> > compiler doesn't support the KIND (primitive data type) used in the 
> > referenced
> > statement, which is a parameter named C_SIGNED_CHAR that's provided by the
> > ISO_C_BINDING standard intrinsic module. If a particular C type has no
> > matching Fortran kind, the parameter value will be negative.
> >
> > You might try to make sure the following Fortran program can be compiled
> > correctly, or adjust the pgf90 configuration or flags until it does:
> >
> > PROGRAM testit
> > USE,INTRINSIC :: ISO_C_BINDING
> > INTEGER(KIND=C_SIGNED_CHAR) :: j = -127_C_SIGNED_CHAR
> > IF(j /= -127) THEN
> >  PRINT *, 'Compiler does not support standard ISO_C_BINDING'
> > ELSE
> >  PRINT *, 'Success'
> > ENDIF
> > END PROGRAM testit
> >
> > --Russ
> >
> >>
> >> On Sep 14, 2014, at 2:36 PM, Unidata netCDF Support <address@hidden> wrote:
> >>
> >>> Ben,
> >>>
> >>>> an IT person at UBC may have done what i needed. I don’t understand how, 
> >>>> as when i run make check the program still crashes.
> >>>>
> >>>> I want to check to see if all the programs / libraries were installed in 
> >>>> netCDF 4.3.2:
> >>>>
> >>>> from what i can tell here is what was installed:
> >>>> usr/local/bin:
> >>>> nc-config
> >>>> nccopy
> >>>> ncdump
> >>>> ncgen
> >>>> ncgen3
> >>>
> >>> Yes, that's all the executables installed by netCDF 4.3.2.
> >>>
> >>>> usr/local/lib
> >>>> libnetcdf.la
> >>>> libnetcdf.so
> >>>> libnetcdf.so.7
> >>>> libnetcdf.so.7.2.0
> >>>
> >>> Yup, that's all that's needed for the netCDF-C library.  However, our
> >>> netcdf-4.3.2 installation also has a subdirectory named pkgconfig/
> >>> with the file pkgconfig/netcdf.pc that gets installed if your system
> >>> has the pkg-config software installed (see the Wikipedia entry).  It's
> >>> not necessary, just a convenience for other software that depends
> >>> on netCDF and uses pkg-config to find out how to link with it.
> >>>
> >>>> usr/local/include
> >>>> netcdf.h
> >>>
> >>> Yes, that's the only include file installed.
> >>>
> >>>> is there anything else that is missing or didn’t install?
> >>>> does anything else get installed in a parent directory?
> >>>
> >>> By default, the man page documentation is also installed in
> >>> /usr/local/share/man/{man1,man3} on our Linux systems.
> >>>
> >>> Just having those directories and files installed in /usr/local
> >>> doesn't tell you whether the libraries and utility programs were
> >>> built and configured right for your use.  For example, if you
> >>> need features of netCDF-4 such as compression and chunking,
> >>> then HDF5 must have bee installed and the netCDF libraries
> >>> must have been built with HDF5-support.  You could determine
> >>> this most easily by just running the program
> >>>
> >>> /usr/local/bin/nc-config --has-hdf5
> >>>
> >>> which should output "yes", and similarly for determining whether
> >>> it was built with support for DAP, the data access protocol that
> >>> makes it possible to access netCDF data from remote DAP servers
> >>>
> >>> /usr/local/bin/nc-config --has-dap
> >>>
> >>> should return "yes".  You can see everything supported by using --all.
> >>>
> >>> --Russ
> >>>
> >>>> On Sep 12, 2014, at 10:36 AM, Unidata netCDF Support <address@hidden> 
> >>>> wrote:
> >>>>
> >>>>> Ben,
> >>>>>
> >>>>>> I do have the HDF5version 1.8.13,
> >>>>>> I took the steps you mentioned:
> >>>>>>
> >>>>>> 1) H5DIR=/mnt/data/bweinste/MEGAN/MEGANv2.10/local/hdf5
> >>>>>> 2) CPPFLAGS=-I${H5DIR}/include
> >>>>>> 3) LDFLAGS=-L${H5DIR}/lib
> >>>>>>
> >>>>>> for
> >>>>>> 4) ./configure ...
> >>>>>> I did ./configure 
> >>>>>> --prefix=/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF
> >>>>>>
> >>>>>> …yet the problem persists. are there any other things that need to be 
> >>>>>> pointed tot he H5DIR?
> >>>>>
> >>>>> Maybe this is a simple problem with the Unix shell you are using
> >>>>> and setting environment variables that shell scripts like
> >>>>> configure can access.
> >>>>>
> >>>>> You don't have to worry about this if you set CPPFLAGS and
> >>>>> LDFLAGS as part of the list of arguments to configure, as
> >>>>> in
> >>>>>
> >>>>> ./configure --prefix=/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF 
> >>>>> CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib
> >>>>>
> >>>>> In that case, the configure script sees the settings and uses
> >>>>> them.
> >>>>>
> >>>>> Instead, you can precede the configure command with the
> >>>>> environment variable settings if you are using bash, ksh,
> >>>>> zsh, or a similar POSIX-standard command shell, as in:
> >>>>>
> >>>>> CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib ./configure 
> >>>>> --prefix=/mnt/data/bweinste/MEGAN/MEGANv2.10/local/NETCDF
> >>>>>
> >>>>> If you set the environment variables separately from the configure
> >>>>> command line, they are local to that shell, so to make them
> >>>>> accessible to subshells such as script files like configure, you
> >>>>> have to explicitly export them, as in
> >>>>>
> >>>>> H5DIR=/mnt/data/bweinste/MEGAN/MEGANv2.10/local/hdf5
> >>>>> CPPFLAGS=-I${H5DIR}/include
> >>>>> LDFLAGS=-L${H5DIR}/lib
> >>>>> export CPPFLAGS LDFLAGS
> >>>>>
> >>>>> If you are instead using a non-POSIX shell such as csh, you
> >>>>> need to instead use the setenv command, as in
> >>>>>
> >>>>> setenv H5DIR /mnt/data/bweinste/MEGAN/MEGANv2.10/local/hdf5
> >>>>> setenv CPPFLAGS -I${H5DIR}/include
> >>>>> setenv LDFLAGS -L${H5DIR}/lib
> >>>>>
> >>>>> I hope one of those works ...
> >>>>>
> >>>>> --Russ
> >>>>>
> >>>>>> On Sep 11, 2014, at 8:12 PM, Unidata netCDF Support <address@hidden> 
> >>>>>> wrote:
> >>>>>>
> >>>>>>> Hi Ben,
> >>>>>>>
> >>>>>>>> sorry to bombard your with questions.
> >>>>>>>
> >>>>>>> No problem ...
> >>>>>>>
> >>>>>>>> have you had a minute to consider my last one?
> >>>>>>>> I have installed hdf5 into the directory:
> >>>>>>>>
> >>>>>>>> /mnt/data/bweinste/MEGAN/MEGANv2.10/local/hdf5
> >>>>>>>
> >>>>>>> OK, but are you sure that's HDF5 version 1.8.8 or later, preferably 
> >>>>>>> 1.8.13?
> >>>>>>> You can check by looking in the file
> >>>>>>>
> >>>>>>> /mnt/data/bweinste/MEGAN/MEGANv2.10/local/hdf5/lib/libhdf5.settings
> >>>>>>>
> >>>>>>> for a line like:
> >>>>>>>
> >>>>>>>                  HDF5 Version: 1.8.13
> >>>>>>>
> >>>>>>> which identifies the installed version.  An error message you're 
> >>>>>>> getting when
> >>>>>>> trying to run the netCDF tests seems to indicate an older HDF5 
> >>>>>>> version,
> >>>>>>> 1.8.4 (patch1), which is too old to pass the stringent tests in 
> >>>>>>> netCDF 4.3.2.
> >>>>>>>
> >>>>>>>>> =========================================
> >>>>>>>>>
> >>>>>>>>> netCDF 4.3.2: ncdump/test-suite.log
> >>>>>>>>>
> >>>>>>>>> =========================================
> >>>>>>>>>
> >>>>>>>>> # TOTAL: 39
> >>>>>>>>> # PASS:  37
> >>>>>>>>> # SKIP:  0
> >>>>>>>>> # XFAIL: 0
> >>>>>>>>> # FAIL:  2
> >>>>>>>>> # XPASS: 0
> >>>>>>>>> # ERROR: 0
> >>>>>>>>>
> >>>>>>>>> .. contents:: :depth: 2
> >>>>>>>>>
> >>>>>>>>> FAIL: tst_h_scalar
> >>>>>>>>>
> >>>>>>>>> ==================
> >>>>>>>>>
> >>>>>>>>> HDF5-DIAG: Error detected in HDF5 (1.8.4-patch1) thread 
> >>>>>>>>> 47514256252672:
> >>>>>>>>> #000: ../../../src/H5T.c line 1595 in H5Tcreate(): unable to create 
> >>>>>>>>> type
> >>>>>>>
> >>>>>>> To build netCDF, you need to set CPPFLAGS and LDFLAGS to point to 
> >>>>>>> your HDF5
> >>>>>>> installation directories, something like
> >>>>>>>
> >>>>>>> H5DIR=/mnt/data/bweinste/MEGAN/MEGANv2.10/local/hdf5
> >>>>>>> CPPFLAGS=-I${H5DIR}/include  LDFLAGS=-L${H5DIR}/lib ./configure ...
> >>>>>>> make check
> >>>>>>> make install # (or sudo make install)
> >>>>>>>
> >>>>>>> --Russ
> >>>>>>>
> >>>>>>> Russ Rew                                         UCAR Unidata Program
> >>>>>>> address@hidden                      http://www.unidata.ucar.edu
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> Ticket Details
> >>>>>>> ===================
> >>>>>>> Ticket ID: FLE-841916
> >>>>>>> Department: Support netCDF
> >>>>>>> Priority: Normal
> >>>>>>> Status: Closed
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>> Russ Rew                                         UCAR Unidata Program
> >>>>> address@hidden                      http://www.unidata.ucar.edu
> >>>>>
> >>>>>
> >>>>>
> >>>>> Ticket Details
> >>>>> ===================
> >>>>> Ticket ID: FLE-841916
> >>>>> Department: Support netCDF
> >>>>> Priority: Normal
> >>>>> Status: Closed
> >>>>
> >>>>
> >>>
> >>> Russ Rew                                         UCAR Unidata Program
> >>> address@hidden                      http://www.unidata.ucar.edu
> >>>
> >>>
> >>>
> >>> Ticket Details
> >>> ===================
> >>> Ticket ID: FLE-841916
> >>> Department: Support netCDF
> >>> Priority: Normal
> >>> Status: Closed
> >>
> >>
> >>
> >
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: FLE-841916
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> 
> 
> 
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: FLE-841916
Department: Support netCDF
Priority: Normal
Status: Closed