Skip to content

Commit

Permalink
Split out the build commands into a separate script.
Browse files Browse the repository at this point in the history
- Added support for customizing the tarball name.
- Added a whole bunch of suffixes to the ignore file.
  • Loading branch information
LTLA committed Oct 14, 2023
1 parent 4a1185a commit 858bd19
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 38 deletions.
45 changes: 7 additions & 38 deletions .github/workflows/build-libraries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,19 @@ jobs:
# arch: "arm64"

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up CMake
uses: lukka/get-cmake@latest

- name: Install wget
run: yum install -y wget

- name: Set up ZLIB
run: |
wget http://zlib.net/fossils/zlib-1.3.tar.gz -O zlib.tar.gz
tar -xvf zlib.tar.gz
cd zlib-1.3
cmake -S . -B build
cmake --build build
- name: Set up SZIP
run: |
git clone https://gitlab.dkrz.de/k202009/libaec
cd libaec
cmake -S . -B build
cmake --build build
- name: Set up HDF5
run: |
wget https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_12_2.tar.gz -O bundle.tar.gz
tar -xf bundle.tar.gz
cwd=$(pwd)
cd hdf5-hdf5-1_12_2/
cmake -S . -B build \
-DBUILD_SHARED_LIBS=OFF \
-DHDF5_BUILD_EXAMPLES=OFF \
-DHDF5_BUILD_TOOLS=OFF \
-DHDF5_BUILD_UTILS=OFF \
-DHDF5_BUILD_CPP_LIB=ON \
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON \
-DHDF5_ENABLE_SZIP_SUPPORT=ON \
-DBUILD_TESTING=OFF \
-DZLIB_INCLUDE_DIR=${cwd}/zlib-1.3 \
-DZLIB_LIBRARY=${cwd}/zlib-1.3/build/src/libz.a \
-DSZIP_INCLUDE_DIR=${cwd}/libaec/build/include \
-DSZIP_LIBRARY=${cwd}/libaec/build/src/libsz.a
cmake --build build
cpack -G TGZ --config build/CPackConfig.cmake
- name: Run the build
run: ./build.sh manylinux_x86_64.tar.gz

- name: Upload tarballs
- name: Upload tarball
uses: actions/upload-artifact@v3
with:
path: build/HDF5-*.tar.gz
path: hdf5/manylinux_x86_64.tar.gz
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.swp
*.tar.gz
hdf5-*
zlib-*
libaec/
47 changes: 47 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

set -e
set -u
output=$1 # output file name for the CPack bundle.

# Setting up ZLIB
wget http://zlib.net/fossils/zlib-1.3.tar.gz -O zlib.tar.gz
tar -xvf zlib.tar.gz
cd zlib-1.3
cmake -S . -B build
cmake --build build
cd -

# Setting up SZIP
git clone https://gitlab.dkrz.de/k202009/libaec
git checkout v1.0.6
cd libaec
cmake -S . -B build
cmake --build build
cd -

# Setting up HDF5.
wget https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_12_2.tar.gz -O bundle.tar.gz
tar -xf bundle.tar.gz
cwd=$(pwd)
mv hdf5-hdf5-1_12_2/ hdf5
cd hdf5

cmake -S . -B build \
-DBUILD_SHARED_LIBS=OFF \
-DHDF5_BUILD_EXAMPLES=OFF \
-DHDF5_BUILD_TOOLS=OFF \
-DHDF5_BUILD_UTILS=OFF \
-DHDF5_BUILD_CPP_LIB=ON \
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON \
-DHDF5_ENABLE_SZIP_SUPPORT=ON \
-DBUILD_TESTING=OFF \
-DUSE_LIBAEC=ON \
-DZLIB_INCLUDE_DIR=${cwd}/zlib-1.3 \
-DZLIB_LIBRARY=${cwd}/zlib-1.3/build/src/libz.a \
-DSZIP_INCLUDE_DIR=${cwd}/libaec/include \
-DSZIP_LIBRARY=${cwd}/libaec/build/src/libsz.a \
-DCPACK_PACKAGE_FILE_NAME=${output}

cmake --build build
cpack -G TGZ --config build/CPackConfig.cmake

0 comments on commit 858bd19

Please sign in to comment.