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

[netCDF #WFW-324794]: Fortran libraries for NetCDF4



Arjen,

Sorry about the original misdiagnosis of the problem having to do with
parallel-I/O functions.  Since what you tried works fine for us on
Unix systems without parallel I/O enabled, and the missing Fortran
functions with "_PAR" in their names are definitely only used for
parallel I/O, it seemed like the most likely cause of the problem.
However, now I think the problem you're seeing is Windows-specific.

We don't have access to ifort on Windows, and don't yet have a release
for netCDF-Fortran that's tested and supported on Windows, so we can't
duplicate the problem you're seeing and must do some guessing.

> As we do not need the new API for NetCDF4, I used the option 
> ENABLE_NETCDF4=OFF in the configuration process. This solved the problems 
> with the parallel I/O routines. However, two unresolved externals, ncerr and 
> ncopts continue to persist, even though I also added the option 
> ENABLE_NETCDF_V2=OFF. The file nf_v2compat.c is still included in the build.

As you've figured out, the ncerr and ncopts global externals are
vestiges left over from the netCDF version 2 API, which is still
included by default in the netCDF-C library.  There is some code in
the C library netcdf.h header file that determines whether ncerr and
ncopts are exported or imported, depending on whether the macro
DLL_NETCDF is defined or not:

  /* When netCDF is built as a DLL, this will export ncerr and
   * ncopts. When it is used as a DLL, it will import them. */
  #if defined(DLL_NETCDF)
  MSC_EXTRA int ncerr;
  MSC_EXTRA int ncopts;
  #endif

I'm not sure whether CMake compiles with DLL_NETCDF set when
netCDF is built as a DLL, but it should. In non-DLL builds, MSC_EXTRA 
is defined to nothing, and EXTERNL to extern.

--Russ

> Regards,
> 
> Arjen
> 
> 
> > -----Original Message-----
> > From: Unidata netCDF Support [mailto:address@hidden]
> > Sent: Monday, January 26, 2015 6:46 PM
> > To: Arjen Markus
> > Cc: address@hidden
> > Subject: [netCDF #WFW-324794]: Fortran libraries for NetCDF4
> >
> > Hi Arjen,
> >
> > > I am trying to build the NetCDF4 libraries for Intel Fortran 2014
> > > (Windows 7, 64-bits), as that is the compiler we are using at the
> > > moment for our programs. I am familiar with the CMake build
> > > configuration tool, so I used that to start the building process.
> > > However, I had to make some adjustments because of failures in the
> > > build process and finally I got a number of messages about unresolved 
> > > external
> > symbols.
> > >
> > > Here is what I did:
> > >
> > > - I downloaded the precompiled version of HDF5 (1.8.14), as NetCDF4
> > > requires this package and installed the libraries.
> >
> > The unresolved external symbols you encountered are related to parallel I/O 
> > support
> > in the netCDF-C library, which requires parallel I/O support in the
> > HDF5 library. Building with parallel I/O support is often not required and 
> > complicates
> > later linking with the libraries.  For example, shared libraries must be 
> > disabled to
> > make use of the HDF5 parallel I/O support.
> >
> > Do you really need parallel I/O?  If so, have you already installed a 
> > parallel file
> > system and the necessary compilers or compiler wrappers (such as mpicc and
> > mpif90) to support parallel I/O?
> >
> > If you don't need parallel I/O, it would simplify your build and 
> > installation process to
> > start with an HDF5-1.8.14 library that is not configured for parallel I/O.
> >
> > If you do require parallel I/O support in netCDF Fortran, that requires 
> > that the HDF5
> > C library and netCDF-C library are built with parallel I/O support.
> >
> > CMake-oriented instructions for building hdf5 and netcdf-c with parallel io 
> > support are
> > here:
> >
> >   http://www.unidata.ucar.edu/software/netcdf/docs/cmake_faq.html
> >
> >
> > Autoconf-oriented instructions for building HDF5 and netCDF-C with parallel 
> > I/O
> > support are here:
> >
> >
> > http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html#
> > build_parallel
> >
> > In either case, if you are building and installing on Windows, you will be 
> > attempting
> > to build and install with parallel I/O on an as yet untested and hence 
> > unsupported
> > configuration.
> >
> > > - I downloaded the sources for NetCDF4-C (4.3.2)
> > >
> > > - I downloaded the sources for NetCDF4-Fortran (4.4.1)
> > >
> > > - Using CMake 2.8.10.2 with the NMake Makefile generator, I created
> > > the C libraries. That took some experimenting with the various CMake
> > > configuration variables, but that succeeded. I turned DAP support off.
> > >
> > > - Running the tests via "nmake test", I noticed 27 failing tests -
> > > from the assertion messages, most of them had to do with heap space
> > > problems. I have not recorded the precise messages, but I can send you 
> > > the report.
> > >
> > > - Then I moved on to the Fortran bindings, ignoring the failing tests:
> > >
> > > o CMake was complaining about a file "netcdf-targets.cmake", so I
> > > changed the CMake file that it referred to manually - according to the
> > > message it was looking for "d://share/cmake/netcdf-targets.cmake". By
> > > replacing the reference to "${_prefix}" by the expanded value I got
> > > the configuration to continue.
> > >
> > > o The build then failed on the netcdf.h include file. Examination of
> > > the various generated files did not reveal how I could amend for this
> > > (I had specified NETCDF_C_INCLUDE_DIR at the command-line, but its
> > > value was not present in the flags.make file.) To work around this
> > > problem I simply copied the header files from the netcdf/include
> > > directory to netcdf-fortran/fortran .
> > >
> > > o That did the trick in as far as the compilation succeeded. However,
> > > building the libraries themselves failed with several missing references:
> > >
> > > §  nc_create_par_fortran in NF_CREATE_PAR (nf_nc4.f90)
> > >
> > > §  nc_open_par_fortran in NF_OPEN_PAR
> > >
> > > §  nc_var_par_access in NF_VAR_PAR_ACCESS
> > >
> > > §  ncerr and ncopts in nf_v2compat.c
> > >
> > > I hope you can advise me how to proceed with this, as we want to use
> > > the NetCDF4 library instead of a legacy library we are currently using.
> >
> > The netCDF-Fortran parallel I/O configuration has as yet only been tested 
> > on Unix-
> > based platforms, using an autoconf-oriented build process. So please let us 
> > know if
> > you get a different configuration working!
> >
> > --Russ
> >
> > > Kind regards,
> > >
> > > Arjen Markus
> > > Sr. Adviseur/Onderzoeker
> > > T
> > >
> > > 088 - 33 58 273
> > >
> > > E
> > >
> > > address@hidden
> > >
> > >
> > >
> > >
> > > [Logo]<http://www.deltares.com/>
> > >
> > > www.deltares.com<http://www.deltares.com/>
> > >
> > > Postbus 177
> > > 2600 MH Delft
> > >
> > > [Deltares Twitter]
> > > <http://www.twitter.com/deltares>
> > >
> > > [Deltares LinkedIn]<http://www.linkedin.com/company/217430>
> > >
> > > [Deltares
> > > Facebook]<https://www.facebook.com/pages/Deltares/154189334634001>
> > >
> > >
> > >
> > > [Think before printing]Please consider the environment before printing
> > > this email
> > > DISCLAIMER: This message is intended exclusively for the addressee(s) and 
> > > may
> > contain confidential and privileged information. If you are not the 
> > intended recipient
> > please notify the sender immediately and destroy this message. Unauthorized 
> > use,
> > disclosure or copying of this message is strictly prohibited. The 
> > foundation 'Stichting
> > Deltares', which has its seat at Delft, The Netherlands, Commercial 
> > Registration
> > Number 41146461, is not liable in any way whatsoever for consequences and/or
> > damages resulting from the improper, incomplete and untimely dispatch, 
> > receipt
> > and/or content of this e-mail.
> > >
> > >
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: WFW-324794
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> >
> 
> DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
> contain confidential and privileged information. If you are not the intended 
> recipient please notify the sender immediately and destroy this message. 
> Unauthorized use, disclosure or copying of this message is strictly 
> prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, 
> The Netherlands, Commercial Registration Number 41146461, is not liable in 
> any way whatsoever for consequences and/or damages resulting from the 
> improper, incomplete and untimely dispatch, receipt and/or content of this 
> e-mail.
> 
> 
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: WFW-324794
Department: Support netCDF
Priority: Normal
Status: Closed