Error building parallel hdf5 1.8.5-patch1 with --enable-fortran/intel 11.1.20091130

Hello,

I'm trying to build h5pfc for hdf5-1.8.5-patch1 using the Intel 11.1
compilers (specifically for intel 11.1 20091130 with mpich2 1.2.1).

My configure line looks like 'CC=mpicc FC=mpif90 ./configure
--enable-shared --enable-fortran --enable-parallel'

I see a problem within fortran/src when running make. Specifically
this libtool command

/bin/bash ../../libtool --tag=FC --mode=link mpif90 -fPIC -O3
-I../../src -I../../fortran/src -version-info 6:4:0 -o
libhdf5_fortran.la -rpath
/org/centers/pecos/LIBRARIES/HDF5/hdf5-1.8.5-p1-intel-11.1-mpich2-1.2.1/lib
H5f90global.lo H5fortran_types.lo H5_ff.lo H5Aff.lo H5Dff.lo H5Eff.lo
H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Off.lo H5Pff.lo H5Rff.lo
H5Sff.lo H5Tff.lo H5Zff.lo H5_DBLE_InterfaceInclude.lo H5f90kit.lo
H5_f.lo H5Af.lo H5Df.lo H5Ef.lo H5Ff.lo H5Gf.lo H5If.lo H5Lf.lo
H5Of.lo H5Pf.lo H5Rf.lo H5Sf.lo H5Tf.lo H5Zf.lo H5FDmpiof.lo
HDF5mpio.lo H5FDmpioff.lo -lz -lm

generates this link line

libtool: link: mpif90 -shared .libs/H5f90global.o
.libs/H5fortran_types.o .libs/H5_ff.o .libs/H5Aff.o .libs/H5Dff.o
.libs/H5Eff.o .libs/H5Fff.o .libs/H5Gff.o .libs/H5Iff.o .libs/H5Lff.o
.libs/H5Off.o .libs/H5Pff.o .libs/H5Rff.o .libs/H5Sff.o .libs/H5Tff.o
.libs/H5Zff.o .libs/H5_DBLE_InterfaceInclude.o .libs/H5f90kit.o
.libs/H5_f.o .libs/H5Af.o .libs/H5Df.o .libs/H5Ef.o .libs/H5Ff.o
.libs/H5Gf.o .libs/H5If.o .libs/H5Lf.o .libs/H5Of.o .libs/H5Pf.o
.libs/H5Rf.o .libs/H5Sf.o .libs/H5Tf.o .libs/H5Zf.o .libs/H5FDmpiof.o
.libs/HDF5mpio.o .libs/H5FDmpioff.o -lz -lm -soname
libhdf5_fortran.so.6 -o .libs/libhdf5_fortran.so.6.0.4
ifort: command line warning #10156: ignoring option '-s'; no argument required
ifort: error #10236: File not found: 'libhdf5_fortran.so.6'

which then bombs out.

From some digging, it appears the problem is an Intel 11.1-ism around

-soname (http://software.intel.com/en-us/articles/intel-compiler-error-10236-with-soname-corrupts-shared-library-on-linux/)
where an -Xlinker argument should be present near -soname. This seems
to be libtool's job. I noticed that HDF5 1.8.5-patch1 ships with
libtool 2.2.6b, which seems to be a bit stale relative to the current
2.4 version.

Would someone please point me to how to upgrade libtool within the
HDF5 source tree? I have grepped around but cannot seem to find the
usual 'bootstrap' or 'autogen.sh' script that pulls in a new libtool
version. I'd like to confirm or deny that upgrading libtool fixes
this linker error.

Thanks for your time,
Rhys

Rhys,

Support for shared libraries (and especially for Fortran and parallel) is really tricky. It just hard to make it to work.
Have you tried to build static libraries and see if they work for you?

I would also suggest to try the pre-released 1.8.6 source. For the new release libtool was upgraded to 2.2.10 (2.4 came when we had internal code freeze, too late).

Elena

···

On Sep 24, 2010, at 6:10 PM, Rhys Ulerich wrote:

Hello,

I'm trying to build h5pfc for hdf5-1.8.5-patch1 using the Intel 11.1
compilers (specifically for intel 11.1 20091130 with mpich2 1.2.1).

My configure line looks like 'CC=mpicc FC=mpif90 ./configure
--enable-shared --enable-fortran --enable-parallel'

I see a problem within fortran/src when running make. Specifically
this libtool command

/bin/bash ../../libtool --tag=FC --mode=link mpif90 -fPIC -O3
-I../../src -I../../fortran/src -version-info 6:4:0 -o
libhdf5_fortran.la -rpath
/org/centers/pecos/LIBRARIES/HDF5/hdf5-1.8.5-p1-intel-11.1-mpich2-1.2.1/lib
H5f90global.lo H5fortran_types.lo H5_ff.lo H5Aff.lo H5Dff.lo H5Eff.lo
H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Off.lo H5Pff.lo H5Rff.lo
H5Sff.lo H5Tff.lo H5Zff.lo H5_DBLE_InterfaceInclude.lo H5f90kit.lo
H5_f.lo H5Af.lo H5Df.lo H5Ef.lo H5Ff.lo H5Gf.lo H5If.lo H5Lf.lo
H5Of.lo H5Pf.lo H5Rf.lo H5Sf.lo H5Tf.lo H5Zf.lo H5FDmpiof.lo
HDF5mpio.lo H5FDmpioff.lo -lz -lm

generates this link line

libtool: link: mpif90 -shared .libs/H5f90global.o
.libs/H5fortran_types.o .libs/H5_ff.o .libs/H5Aff.o .libs/H5Dff.o
.libs/H5Eff.o .libs/H5Fff.o .libs/H5Gff.o .libs/H5Iff.o .libs/H5Lff.o
.libs/H5Off.o .libs/H5Pff.o .libs/H5Rff.o .libs/H5Sff.o .libs/H5Tff.o
.libs/H5Zff.o .libs/H5_DBLE_InterfaceInclude.o .libs/H5f90kit.o
.libs/H5_f.o .libs/H5Af.o .libs/H5Df.o .libs/H5Ef.o .libs/H5Ff.o
.libs/H5Gf.o .libs/H5If.o .libs/H5Lf.o .libs/H5Of.o .libs/H5Pf.o
.libs/H5Rf.o .libs/H5Sf.o .libs/H5Tf.o .libs/H5Zf.o .libs/H5FDmpiof.o
.libs/HDF5mpio.o .libs/H5FDmpioff.o -lz -lm -soname
libhdf5_fortran.so.6 -o .libs/libhdf5_fortran.so.6.0.4
ifort: command line warning #10156: ignoring option '-s'; no argument required
ifort: error #10236: File not found: 'libhdf5_fortran.so.6'

which then bombs out.

From some digging, it appears the problem is an Intel 11.1-ism around
-soname (http://software.intel.com/en-us/articles/intel-compiler-error-10236-with-soname-corrupts-shared-library-on-linux/)
where an -Xlinker argument should be present near -soname. This seems
to be libtool's job. I noticed that HDF5 1.8.5-patch1 ships with
libtool 2.2.6b, which seems to be a bit stale relative to the current
2.4 version.

Would someone please point me to how to upgrade libtool within the
HDF5 source tree? I have grepped around but cannot seem to find the
usual 'bootstrap' or 'autogen.sh' script that pulls in a new libtool
version. I'd like to confirm or deny that upgrading libtool fixes
this linker error.

Thanks for your time,
Rhys

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Hi Elena,

I'm trying to build h5pfc for hdf5-1.8.5-patch1 using the Intel 11.1
compilers (specifically for intel 11.1 20091130 with mpich2 1.2.1).

My configure line looks like 'CC=mpicc FC=mpif90 ./configure
--enable-shared --enable-fortran --enable-parallel'

Have you tried to build static libraries and see if they work for you?

Static libraries seem to build okay and pass make check.

I would also suggest to try the pre-released 1.8.6 source. For the new release libtool was upgraded to 2.2.10 (2.4 came when we had internal code freeze, too late).

No luck building shared, parallel Fortran libraries using Intel
11.1.20091130 with the pre-release 1.8.6 link sent a few days back.
The same error message ("ifort: error #10236: File not found:
'libhdf5_fortran.so.6'") occurs.

Support for shared libraries (and especially for Fortran and parallel) is really tricky.

I definitely appreciate the trouble involved. I ask because I'm
trying to build a shared, parallel Fortran library atop HDF5. :slight_smile: At
least I now know that updating libtool doesn't seem to solve the
problem. Would you be willing to add a very low priority feature
request to get shared, parallel Fortran libraries working for Intel
11.1?

Thanks for your response,
Rhys

Hi Elena,

I'm trying to build h5pfc for hdf5-1.8.5-patch1 using the Intel 11.1
compilers (specifically for intel 11.1 20091130 with mpich2 1.2.1).

My configure line looks like 'CC=mpicc FC=mpif90 ./configure
--enable-shared --enable-fortran --enable-parallel'

Have you tried to build static libraries and see if they work for you?

Static libraries seem to build okay and pass make check.

I would also suggest to try the pre-released 1.8.6 source. For the new release libtool was upgraded to 2.2.10 (2.4 came when we had internal code freeze, too late).

No luck building shared, parallel Fortran libraries using Intel
11.1.20091130 with the pre-release 1.8.6 link sent a few days back.
The same error message ("ifort: error #10236: File not found:
'libhdf5_fortran.so.6'") occurs.

Support for shared libraries (and especially for Fortran and parallel) is really tricky.

I definitely appreciate the trouble involved. I ask because I'm
trying to build a shared, parallel Fortran library atop HDF5. :slight_smile: At
least I now know that updating libtool doesn't seem to solve the
problem. Would you be willing to add a very low priority feature
request to get shared, parallel Fortran libraries working for Intel
11.1?

Done.

Elena

···

On Sep 27, 2010, at 10:39 PM, Rhys Ulerich wrote:

Thanks for your response,
Rhys

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

I believe I've pinpointed the bug underneath this old question.
Fixing it requires changing only a single character!

To recap, building HDF 1.8.5 patch 1 and 1.8.6 fails on Intel 11.1 when
configuring with --enable-fortran --enable-shared --enable-parallel. The
problem is that down within the Fortran sources libtool generates a link line

    libtool: link: mpif90 -shared .libs/H5f90global.o
    .libs/H5fortran_types.o .libs/H5_ff.o .libs/H5Aff.o .libs/H5Dff.o
    .libs/H5Eff.o .libs/H5Fff.o .libs/H5Gff.o .libs/H5Iff.o .libs/H5Lff.o
    .libs/H5Off.o .libs/H5Pff.o .libs/H5Rff.o .libs/H5Sff.o .libs/H5Tff.o
    .libs/H5Zff.o .libs/H5_DBLE_InterfaceInclude.o .libs/H5f90kit.o
    .libs/H5_f.o .libs/H5Af.o .libs/H5Df.o .libs/H5Ef.o .libs/H5Ff.o
    .libs/H5Gf.o .libs/H5If.o .libs/H5Lf.o .libs/H5Of.o .libs/H5Pf.o
    .libs/H5Rf.o .libs/H5Sf.o .libs/H5Tf.o .libs/H5Zf.o .libs/H5FDmpiof.o
    .libs/HDF5mpio.o .libs/H5FDmpioff.o -lz -lm -soname
    libhdf5_fortran.so.6 -o .libs/libhdf5_fortran.so.6.0.4
    ifort: command line warning #10156: ignoring option '-s'; no
argument required
    ifort: error #10236: File not found: 'libhdf5_fortran.so.6'

The problem is that Intel 11.1 demands '-Xlinker -soname -Xlinker
libhdf5_fortran.so.6' be specified (see
http://software.intel.com/en-us/articles/intel-compiler-error-10236-with-soname-corrupts-shared-library-on-linux/).

New since last time...

From some testing, using '-Wl,' works too. The libtool configuration generated

by configure appears to have been stitched up to appropriately add '-Wl,' on
non-GCC systems around line 20091 of HDF5 1.8.6's configure.ac:

    case $host_os in
      linux* | freebsd* )
        # If gcc is not used, need to set $wl to use "-Wl,"
        if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then
          : using gcc
        else
          echo 'fixing $wl in' $ofile
    ed - $ofile <<EOF 2> /dev/null
    /^wl=""/s//wl="-Wl,"/
    w
    q
    EOF
        fi
        ;;
    esac

which results in the displayed line

    fixing $wl in libtool

at configure time on this platform. The bug is is that the ed snippet only
replaces the first wl="" literal in the generated ./libtool. Replacing all of
them must occur for --enable-fortran --enable-shared to work on this platform.
You can observe this by seeing that the 'FC' tag in libtool still contains
wl="".

Revising this ed snippet to read

    ed - $ofile <<EOF 2> /dev/null
    g/^wl=""/s//wl="-Wl,"/
    w
    q
    EOF

fixes the problem. I've added the 'g' prefix to ensure all lines are changed.

Thanks,
Rhys

Fixing it requires changing only a single character!

Nope. Definitely not. Sorry for being overzealous.

Revising this ed snippet to read

ed - $ofile <<EOF 2> /dev/null
g/^wl=""/s//wl="-Wl,"/
w
q
EOF

fixes the problem.

Performing a global replace in libtool a la the 'g' character is the
right idea but apparently the wrong fix.

That ed snippet seems to run well before ./libtool ever exists from
what I can tell. Does it have any effect whatsoever?

- Rhys