-
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #930 from xmatthias/ci/hdf5_from_source
Build hdf5 from source when building wheels
- Loading branch information
Showing
2 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
# vendored from https://github.com/h5py/h5py/blob/master/ci/get_hdf5_if_needed.sh | ||
|
||
set -e | ||
|
||
if [ -z ${HDF5_DIR+x} ]; then | ||
echo "Using OS HDF5" | ||
else | ||
echo "Using downloaded HDF5" | ||
if [ -z ${HDF5_MPI+x} ]; then | ||
echo "Building serial" | ||
EXTRA_MPI_FLAGS='' | ||
else | ||
echo "Building with MPI" | ||
EXTRA_MPI_FLAGS="--enable-parallel --enable-shared" | ||
fi | ||
|
||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
lib_name=libhdf5.dylib | ||
else | ||
lib_name=libhdf5.so | ||
fi | ||
|
||
if [ -f $HDF5_DIR/lib/$lib_name ]; then | ||
echo "using cached build" | ||
else | ||
pushd /tmp | ||
# Remove trailing .*, to get e.g. '1.12' ↓ | ||
curl -fsSLO "https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_VERSION%.*}/hdf5-$HDF5_VERSION/src/hdf5-$HDF5_VERSION.tar.gz" | ||
tar -xzvf hdf5-$HDF5_VERSION.tar.gz | ||
pushd hdf5-$HDF5_VERSION | ||
chmod u+x autogen.sh | ||
if [[ "${HDF5_VERSION%.*}" = "1.12" ]]; then | ||
./configure --prefix $HDF5_DIR $EXTRA_MPI_FLAGS --enable-build-mode=production | ||
else | ||
./configure --prefix $HDF5_DIR $EXTRA_MPI_FLAGS | ||
fi | ||
make -j $(nproc) | ||
make install | ||
popd | ||
popd | ||
fi | ||
fi |