Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Mixed Language linking capitalization

Martin_D_1
Beginner
709 Views

Dear fellow developers,

I've recently came across a compilation problem when using the HDF5 library with the Intel compiler suite (ifort 16.0). I'm using a rather complex setup on Ubuntu 14.04:

What I did
1) Install MPICH using the Intel compilers
2) Install HDF5 using the Intel compilers with MPICH wrappers
3) Install PETSc using the MPICH compilers and telling PETSc where HDF5
is located
4) Trying to compile my application with the PETSc makefile. That Fails :(

I'm pretty sure that I link against the 4 libraries from HDF5 in the correct order. The location to the shared objects are given with -L and even as -Wl,rpath.

However, I get a bunch of these messages:

/nethome/storage/raid4/m.diehl/DAMASK/code/HDF5_Utilities.f90:58:
undefined reference to `h5lib_MP_h5open_f_'

even though the verbose compiler command
-Wl,--verbose
tells that it finds the libraries:

attempt to
open /opt//hdf5-1.8.16/Intel/16.0/MPICH/3.2/lib/libhdf5hl_fortran.so
succeeded
-lhdf5hl_fortran
(/opt//hdf5-1.8.16/Intel/16.0/MPICH/3.2/lib/libhdf5hl_fortran.so)

Inspecting the library with readelf shows that the missing references are in there:

readelf -Ws /opt/hdf5-1.8.16/Intel/16.0/MPICH/3.2/lib/libhdf5_fortran.so | grep -i h5lib_MP_h5open_f_'
   916: 0000000000024600    80 FUNC    GLOBAL DEFAULT   12 h5lib_mp_h5open_f_'
   969: 0000000000024600    80 FUNC    GLOBAL DEFAULT   12 h5lib_mp_h5open_f_'

What puzzles me is the capitalization: The linker is searching for all lowercase functions, except for the added "_MP_". However in the library, only small letters are used.

Did anyone encounter similar problems (not only related to HDF5) before? I assume linking is case sensitive due to its strong connection to C/C++ rather than to Fortran. HDF5 is written in C.

P.S using the GNU compiler suite (v 5.3) in exactly the same order works fine

 

 

0 Kudos
2 Replies
Lorri_M_Intel
Employee
709 Views

I'm going to guess that when you built HDF5 the makefile used the "-standard-semantics" command line switch, but that when you built PETSc, the makefile did not have the -standard-semantics switch.

If the HDF5 makefile did not explicitly use -standard-semantics, please list the command flags passed to ifort for both HDF5 and for PETSc.

                          --Lorri

0 Kudos
Martin_D_1
Beginner
709 Views

Dear Lorri,

thanks a lot, that solved the issues

best regards,

Martin

0 Kudos
Reply