Rate This Document
Findability
Accuracy
Completeness
Readability

Installing HDF5

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Set the environment variables.
    export optflags="-O3"
    export ldflags="-Wl,--build-id"
  3. Create an installation directory.
    mkdir -p /path/to/hdf5
  4. Go to the installation directory.
    cd /path/to/hdf5
  5. Obtain the source code.
    wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.12/src/hdf5-1.8.12.tar.gz
  6. Decompress the HDF5 installation package.
    tar -zxvf hdf5-1.8.12.tar.gz
  7. Go to the directory generated after the decompression.
    cd hdf5-1.8.12
  8. Perform the configuration.
    ./configure --prefix=/path/to/hdf5 --build=aarch64-unknown-linux-gnu --enable-shared --enable-static=yes --enable-fortran CC=clang CXX=clang++ FC=flang F77=flang CFLAGS="$optflags -fPIC -Wno-incompatible-pointer-types-discards-qualifiers -Wno-non-literal-null-conversion" FCFLAGS="$optflags -fPIC" FFLAGS="$optflags -fPIC" LDFLAGS="$ldflags"

  9. Create a libtool.patch file.
    1. Create a libtool.patch file.
      vi libtool.patch
    2. Press i to enter the insert mode and add the following content:
      diff -ruN hdf5-1.10.1/libtool hdf5-1.10.1-new/libtool
      --- hdf5-1.10.1/libtool 2019-12-02 20:02:56.270676503 +0000
      +++ hdf5-1.10.1-new/libtool 2019-12-02 20:03:05.062708034 +0000
      @@ -11832,7 +11832,7 @@
      pic_flag=""
      # How to pass a linker flag through the compiler.
      -wl=""
      +wl="-Wl,"
      # Compiler flag to prevent dynamic linking.
      link_static_flag=""
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  10. Install the patch.
    patch -p1 < libtool.patch

  11. Perform the compilation and installation.
    make -j 8

    make install

  12. Set the environment variables.
    export PATH=/path/to/hdf5/bin:$PATH
    export LD_LIBRARY_PATH=/path/to/hdf5/lib:$LD_LIBRARY_PATH