Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

Mixed Language linking capitalization

$
0
0

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

 

 


Viewing all articles
Browse latest Browse all 2746


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>