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

[netCDF #XNT-421372]: NetCDF fortran libraries compilation with MPICH2

Hi Petr,

> I have just a few spots from todays installation of NetCDF Fortran Source
> Code Stable Release (4.2) compilation and also from previous NetCDF
> installation. I don't need any help, just pointing out the wholes in
> install docs and configure scripts.

Thanks for taking the time to write us about possible problems in our
documentation and configure scripts/

> We use for our grid environment the MPICH2 libraries to enable parallel
> execution of several programs. Currently it is version 1.4.1, but maybe
> it is not relevant. I tried to compile NetCDF ( with mpich2
> compiled by intel compiler (intelcdk-12).
> I would like to say that it would be great if I can read somewhere in
> the documentation, that when compiling supporting libraries like zlib
> or hdf5 I should use the -fPIC C and CPP flags. Originally I compiled
> all the required libraries without this flag and I receved an error:
> "relocation R_X86_64_32 against `a local symbol' can not be used when
> making a shared object; recompile with -fPIC" while linking almost default
> NetCDF configuration with them. Please let others know in install docs,
> that this parameter should be used even for the compiler itself, in my
> case for MPICH2.

Thanks, I didn't know about that.  We build hdf5 and zlib without
specifying -fPIC (although maybe the configure script determines it's
needed) and netCDF-4 builds using gcc without errors.  Do you know if
this problem only shows up when using mpich2 and an Intel compiler?  We
currently don't test with that combination.

There is no mention of using -fPIC on the Intel article about building
netCDF with Intel compilers, but it also makes no mention of enabling
parallel I/O:


> The other thing is little bit difficult because it should be ideally
> fixed by you in the code. The configure scripts do not count with mpich
> compiler, specially with mpich fortran compiler (mpif77 and mpif90
> compiled itself by ifort). When building NetCDF fortran libraries I had
> to add mpif77 and mpif90 to every line in configure script containing
> 'ifort', otherwise I got an error:

Did you set the environment variables before running configure (or as
arguments to configure):

  export CC=mpicc
  export CXX=mpicxx
  export FC=mpif90
  export F77=mpif77
  export F90=mpif90
  export CPP='icpc -E'
  export CXXCPP='icpc -E'

I would have thought that would make the configure script use those
compilers.  From your description, I'm not sure if you're saying this
is a problem we can fix by changing our configure.in, or a problem
with the autoconf software (developed and maintained elsewhere) in
creating the configure script from our configure.in and environment
variable settings ...

> libtool: link: mpif90 -shared .libs/fort-attio.o .libs/fort-control.o 
> .libs/fort-dim.o .libs/fort-genatt.o .libs/fort-geninq.o .libs/fort-genvar.o 
> .libs/fort-lib.o .libs/fort-misc.o .libs/fort-v2compat.o .libs/fort-vario.o 
> .libs/fort-var1io.o .libs/fort-varaio.o .libs/fort-varmio.o 
> .libs/fort-varsio.o .libs/fort-nc4.o --whole-archive 
> ../f90/.libs/libnetcdff90.a --no-whole-archive -rpath 
> /storage/plzen1/home/hanousek/prg/nco_project/netcdf- -rpath 
> /storage/plzen1/home/hanousek/prg/nco_project/curl-7.29.0/lib -rpath 
> /storage/plzen1/home/hanousek/prg/nco_project/netcdf- -rpath 
> /storage/plzen1/home/hanousek/prg/nco_project/curl-7.29.0/lib 
> -L/storage/plzen1/home/hanousek/prg/nco_project/netcdf- 
> -L/storage/plzen1/home/hanousek/prg/nco_project/curl-7.29.0/lib 
> -L/storage/plzen1/home/hanousek/prg/nco_project/hdf5-1.8.9/lib 
> -L/storage/plzen1/home/hanousek/prg/nco_project/zlib-1.2.7/lib 
> -L/storage/plzen1/home/hanousek/prg/nco_project/pnetcdf-1.3.1/lib 
/usr/lib/libidn.so -lssh2 -lssl -lcrypto -lldap -lrt 
/storage/plzen1/home/hanousek/prg/nco_project/hdf5-1.8.9/lib/libhdf5.a -lz -lm 
-soname libnetcdff.so.5 -o .libs/libnetcdff.so.5.3.1
> ifort: command line warning #10006: ignoring unknown option '-fwhole-archive'
> ifort: command line warning #10006: ignoring unknown option 
> '-fno-whole-archive'
> ifort: command line warning #10006: ignoring unknown option '-rpath'
> ifort: command line warning #10006: ignoring unknown option '-rpath'
> ifort: command line warning #10006: ignoring unknown option '-rpath'
> ifort: command line warning #10006: ignoring unknown option '-rpath'
> ifort: command line warning #10006: ignoring unknown option '-soname'
> ifort: error #10236: File not found: 'libnetcdff.so.5'
> make[2]: *** [libnetcdff.la] Error 1
> Regardless of used LDFLAGS or LD_LIBRARY_PATH or lt_cv_ld_force_load=no
> option. I am afraid that mpif fortran compiler is not recognized in
> all of netcdf libraries because if I run for example nc-config --all,
> I get the as the FC program gfortran.
> Anyway thank you for the good work with docs, it is quite comprehensive
> and worth for use. I've been able to solve many problems using it.

Thanks again for reporting the problems you encountered.  It sounds
like we need to add a test case that uses mpich with Intel compilers.
Any fixes won't be in the upcoming 4.3.0 release, as that's getting 
pretty close ...

> Sincerely Petr Hanousek


Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu

Ticket Details
Ticket ID: XNT-421372
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.