Skip to content
Merged
Show file tree
Hide file tree
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
59 changes: 42 additions & 17 deletions scripts/custom/install_hdf5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,21 @@ 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

elif version_lt "${version}" '2.0.0'; then
# + catch-all for remaining HDF5 1.x versions
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
wget -nc https://github.com/HDFGroup/hdf5/archive/refs/tags/${version}.tar.gz
tar -xzf ${version}.tar.gz -C ${src_dir} --strip-components=1
Comment thread
kwabenantim marked this conversation as resolved.
Comment thread
kwabenantim marked this conversation as resolved.
fi

# Build and install
Expand All @@ -100,18 +108,35 @@ 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
# Check cmake version (HDF5 2.0+ requires cmake >= 3.26)
cmake --version

mkdir -p build && cd build
CC=mpicc CXX=mpic++ cmake \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${install_dir} \
-DHDF5_BUILD_HL_LIB=ON \
-DHDF5_BUILD_TOOLS=ON \
-DHDF5_ENABLE_PARALLEL=ON .. &&
make -j ${parallel} &&
make install
fi

# Add modulefile
mkdir -p ${base_dir}/modulefiles/hdf5
Expand Down
5 changes: 3 additions & 2 deletions scripts/custom/setup_custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ apt-get install -y --no-install-recommends \
# Build/dev dependencies
apt-get install -y --no-install-recommends \
build-essential \
cmake \
cmake-curses-gui \
doxygen \
git \
lcov \
Expand All @@ -32,6 +30,9 @@ apt-get install -y --no-install-recommends \
python3-venv \
valgrind

# Install cmake 3.26+ for HDF5 2.0+ (Ubuntu 22.04 has cmake 3.22)
python3 -m pip install --no-cache-dir "cmake>=3.26,<5"

# Chaste dependencies
apt-get install -y --no-install-recommends \
libfftw3-3 \
Expand Down