Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 37 additions & 17 deletions scripts/custom/install_hdf5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,17 @@ elif (version_ge "${version}" '1.12.2' && version_lt "${version}" '1.12.4') ||
wget -nc https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-${ver_si_on}.tar.gz
tar -xzf hdf5-${ver_si_on}.tar.gz -C ${src_dir} --strip-components=1

else
# HDF5 >=1.10.12, <1.11
# HDF5 >=1.12.4, <1.13
# HDF5 >=1.14.4, <1.15
# + catch-all
elif (version_ge "${version}" '1.10.12' && version_lt "${version}" '1.11') || # HDF5 >=1.10.12, <1.11
(version_ge "${version}" '1.12.4' && version_lt "${version}" '1.13') || # HDF5 >=1.12.4, <1.13
(version_ge "${version}" '1.14.4' && version_lt "${version}" '1.15'); then # HDF5 >=1.14.4, <1.15
wget -nc https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_${version}.tar.gz
tar -xzf hdf5_${version}.tar.gz -C ${src_dir} --strip-components=1

else
# HDF5 >=2.0.0
# + catch-all
wget -nc https://github.com/HDFGroup/hdf5/archive/refs/tags/${version}.tar.gz
tar -xzf ${version}.tar.gz -C ${src_dir} --strip-components=1
fi

# Build and install
Expand All @@ -100,18 +104,34 @@ mkdir -p ${install_dir}

cd ${src_dir}

./configure \
--prefix=${install_dir} \
--enable-parallel \
--enable-shared \
CFLAGS=-fPIC \
LDFLAGS=-fPIC \
CPPFLAGS=-fPIC \
CXXFLAGS=-fPIC \
CC=mpicc \
CXX=mpic++ &&
make -j $parallel all &&
make install
if version_lt "${version}" '2.0.0'; then # HDF5 < 2.0.0
./configure \
--prefix=${install_dir} \
--enable-parallel \
--enable-shared \
CFLAGS=-fPIC \
LDFLAGS=-fPIC \
CPPFLAGS=-fPIC \
CXXFLAGS=-fPIC \
CC=mpicc \
CXX=mpic++ &&
make -j $parallel all &&
make install

else # HDF5 >= 2.0.0
CC=mpicc CXX=mpic++ cmake \
-DCMAKE_BUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${install_dir} \
-DHDF5_BUILD_HL_LIB=ON \
-DHDF5_BUILD_TOOLS=OFF \
-DHDF5_ENABLE_PARALLEL=ON \
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON \
-DHDF5_ENABLE_SZIP_SUPPORT=ON \
-DHDF5_ENABLE_UNSUPPORTED=OFF .. &&
make -j ${parallel} &&
make install
fi

# Add modulefile
mkdir -p ${base_dir}/modulefiles/hdf5
Expand Down
Loading