Skip to content

Instantly share code, notes, and snippets.

@jyalim
Last active February 20, 2024 05:40
Show Gist options
  • Save jyalim/eb944f7d63ae49062361 to your computer and use it in GitHub Desktop.
Save jyalim/eb944f7d63ae49062361 to your computer and use it in GitHub Desktop.
Build HDF5 with Intel Compilers
#!/usr/bin/env bash
# https://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-hdf5-with-intel-compilers
## PREREQS
# 1) szip 2.1
export CC=icc
export CXX=icpc
export FC=ifort
export CFLAGS='-O3 -xHost -ip'
export CXXFLAGS='-O3 -xHost -ip'
export FCFLAGS='-O3 -xHost -ip'
tar -zxvf szip-2.1.tar.gz
cd szip-2.1
./configure --prefix=/usr/local/szip-2.1
make
make check
make install
# 2) zlib 1.2.7
export CC=icc
export CFLAGS='-O3 -xHost -ip'
tar -zxvf zlib-1.2.7.tar.gz
cd zlib-1.2.7
./configure --prefix=/usr/local/zlib-1.2.7
make
make check
make install
## ENV
export CC=icc
export F9X=mpifort
export FC=mpifort
export CXX=icpc
### BUILD
njobs=$(( $(nproc) / 2 ))
tar -zxvf hdf5-1.8.8.tar.gz
cd hdf5-1.8.8
./configure --prefix=/usr/local/hdf5-1.8.8 --enable-fortran --enable-cxx --enable-hl --enable-shared \
--with-szip=/usr/local/szip-2.1 --with-zlib=/usr/local/zlib-1.2.7 --enable-parallel
make -j $njobs && make -j $njobs check
make -j $njobs install
#### USAGE
# -lhdf5
# #include <hdf5.h>
@m-a-saleh
Copy link

could you please replace --with-szip by --with-szlib as it is the flag used by the current version of hdf5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment