Building shared libraries on the Cray XE6

Hi Folks,

Does anybody have any experience building shared libraries on the Cray XE6?

I've been wrestling with HDF5 installation on a Cray XE6 today, and am
having particular trouble getting the configure system to handle the
sensitive needs of the Cray compilers.

For example, to create a dynamically-linked executable, this requires the
"-dynamic" flag to the Cray C compiler.

cc -o test.exe -dynamic -lfoo

I don't actually need hdf5 to build dynamic executables for me, what I
really need is it to not fail when trying to build the test executables.

There's a configure option that seems to allow the building of static
executables,

AC_ARG_ENABLE([static_exec],
              [AS_HELP_STRING([--enable-static-exec],
                              [Install only statically linked executables
                               [default=no]])],
              [STATIC_EXEC=$enableval])

This then goes on to enable:

  LT_STATIC_EXEC="-all-static"

This variable is used in quite a few places in the build tree, but it
doesn't appear to be used at all in the ./test directory. Is this
deliberate? The executables built here are susceptible to the same errors
as elsewhere.

My current inclination is to simply patch the flags in the ./test
subdirectory to the (more appropriate) "-static" build flag, but I'm not
very familiar with building a shared version of HDF5 on supercomputers.
Any advice on how to move forward here would be appreciated.

Cheers,
Aron

Hi Folks,

I ended up using the following script to inject static builds where needed.
Please pardon the ancient version of Bash installed on these machines :slight_smile:

    for f in {test,testpar,tools/*,perform,hl/*,hl/*/*}/Makefile
    do
      sed -i 's/CCLD = $(CC)/CCLD = $(CC) -static/g' $f
    done

Cheers,
Aron

···

On Mon, Feb 3, 2014 at 2:59 PM, Aron Ahmadia <aron@ahmadia.net> wrote:

Hi Folks,

Does anybody have any experience building shared libraries on the Cray XE6?

I've been wrestling with HDF5 installation on a Cray XE6 today, and am
having particular trouble getting the configure system to handle the
sensitive needs of the Cray compilers.

For example, to create a dynamically-linked executable, this requires the
"-dynamic" flag to the Cray C compiler.

cc -o test.exe -dynamic -lfoo

I don't actually need hdf5 to build dynamic executables for me, what I
really need is it to not fail when trying to build the test executables.

There's a configure option that seems to allow the building of static
executables,

AC_ARG_ENABLE([static_exec],
              [AS_HELP_STRING([--enable-static-exec],
                              [Install only statically linked executables
                               [default=no]])],
              [STATIC_EXEC=$enableval])

This then goes on to enable:

  LT_STATIC_EXEC="-all-static"

This variable is used in quite a few places in the build tree, but it
doesn't appear to be used at all in the ./test directory. Is this
deliberate? The executables built here are susceptible to the same errors
as elsewhere.

My current inclination is to simply patch the flags in the ./test
subdirectory to the (more appropriate) "-static" build flag, but I'm not
very familiar with building a shared version of HDF5 on supercomputers.
Any advice on how to move forward here would be appreciated.

Cheers,
Aron

Configure seems to assume the default is dynamic linking even thought the default on XE6s is static linking. I had better luck setting "export XTPE_LINK_TYPE=dynamic" to force dynamic linking without using a flag. If your system is upgraded to CrayPE from xt-asynce you should switch this to "CRAYPE_LINK_TYPE."

Sean B.

···

From: Aron Ahmadia <aron@ahmadia.net<mailto:aron@ahmadia.net>>
Reply-To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Date: Monday, February 3, 2014 1:59 PM
To: "hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>" <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Subject: [Hdf-forum] Building shared libraries on the Cray XE6

Hi Folks,

Does anybody have any experience building shared libraries on the Cray XE6?

I've been wrestling with HDF5 installation on a Cray XE6 today, and am having particular trouble getting the configure system to handle the sensitive needs of the Cray compilers.

For example, to create a dynamically-linked executable, this requires the "-dynamic" flag to the Cray C compiler.

cc -o test.exe -dynamic -lfoo

I don't actually need hdf5 to build dynamic executables for me, what I really need is it to not fail when trying to build the test executables.

There's a configure option that seems to allow the building of static executables,

AC_ARG_ENABLE([static_exec],
              [AS_HELP_STRING([--enable-static-exec],
                              [Install only statically linked executables
                               [default=no]])],
              [STATIC_EXEC=$enableval])

This then goes on to enable:

  LT_STATIC_EXEC="-all-static"

This variable is used in quite a few places in the build tree, but it doesn't appear to be used at all in the ./test directory. Is this deliberate? The executables built here are susceptible to the same errors as elsewhere.

My current inclination is to simply patch the flags in the ./test subdirectory to the (more appropriate) "-static" build flag, but I'm not very familiar with building a shared version of HDF5 on supercomputers. Any advice on how to move forward here would be appreciated.

Cheers,
Aron

Hi Sean,

Thanks for the quick feedback! That was actually one of the first things I
tried, but the hdf5 autoconf build script by default tries to execute test
programs on the front-end node, and so using:

export XTPE_LINK_TYPE=dynamic

caused the configure script to build dynamically-loaded test executables in
the configure state that then failed due to broken shared library links.

Is this a configuration problem in our system? If so, please ping me
off-list so I can notify our application environment administrators.

Regards,
Aron

I don't know which libraries it's not finding for you but you could set LD_LIBRARY_PATH to point to them ? You could also add "--host=cray" to your configure opts to prevent it from executing the conftest (very useful if you set —enable-parallel because it can't execute MPI-linked applications locally on a login node). The configure summery will report an extremely old type of Cray but all of the test should pass.

Sean B

···

From: Aron Ahmadia <aron@ahmadia.net<mailto:aron@ahmadia.net>>
Reply-To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Date: Tuesday, February 4, 2014 10:35 AM
To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Subject: Re: [Hdf-forum] Building shared libraries on the Cray XE6

Hi Sean,

Thanks for the quick feedback! That was actually one of the first things I tried, but the hdf5 autoconf build script by default tries to execute test programs on the front-end node, and so using:

export XTPE_LINK_TYPE=dynamic

caused the configure script to build dynamically-loaded test executables in the configure state that then failed due to broken shared library links.

Is this a configuration problem in our system? If so, please ping me off-list so I can notify our application environment administrators.

Regards,
Aron