From 1c3c1e0aade454b6518bf20a31c07576e63c8f4c Mon Sep 17 00:00:00 2001 From: Bryan Weber Date: Sun, 3 Nov 2024 21:26:01 -0500 Subject: [PATCH] macOS fixes --- .github/workflows/python-package.yml | 9 +++++---- .gitignore | 4 ++++ cibw_before_all_macos.sh | 11 ++++++----- 3 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 .gitignore mode change 100644 => 100755 cibw_before_all_macos.sh diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d449812..51a70f9 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -236,8 +236,8 @@ jobs: if: runner.os != 'Linux' uses: actions/cache@v4 with: - key: ${{ matrix.os }}-${{ matrix.arch }}-0 - path: ${{ runner.temp }}/cache + key: ${{ matrix.os }}-${{ matrix.arch }}-1 + path: ${{ github.workspace }}/cache # Windows-only steps - name: Set Up Nuget @@ -247,7 +247,8 @@ jobs: with: python-version: 3.12 if: runner.os == 'Windows' - - run: bash ./cibw_before_all_windows.sh "${{ runner.temp }}" + - name: Build required libraries + run: bash ./cibw_before_all_windows.sh "${{ github.workspace }}" if: runner.os == 'Windows' - name: Set up CIBW environment # On Windows, Boost_ROOT needs to have \ replaced by / because that's what @@ -263,7 +264,7 @@ jobs: # macOS-only steps - name: Build required libraries - run: bash ./cibw_before_all_macos.sh "${{ runner.temp }}" + run: bash ./cibw_before_all_macos.sh "${{ github.workspace }}" if: runner.os == 'macOS' # Force installation to resolve Python 3.8 bug (https://github.com/pypa/cibuildwheel/pull/1871#issuecomment-2161613619) - name: Hack for 3.8 bug diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0763929 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +cache +hdf5-* +HighFive-* +*.tar.gz \ No newline at end of file diff --git a/cibw_before_all_macos.sh b/cibw_before_all_macos.sh old mode 100644 new mode 100755 index 9aa8ce6..60ec528 --- a/cibw_before_all_macos.sh +++ b/cibw_before_all_macos.sh @@ -49,7 +49,6 @@ if [[ "$1" == "" ]] ; then exit 1 fi PROJECT_PATH="$1" -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) ARCH=$(uname -m) HDF5_VERSION="1.14.5" @@ -75,8 +74,9 @@ else fi lib_name=libhdf5.dylib +inc_name=highfive.hpp -if [ -f ${HDF5_DIR}/lib/${lib_name} ]; then +if [ -f ${HDF5_DIR}/lib/${lib_name} ] && [ -f ${HIGHFIVE_DIR}/include/highfive/${inc_name} ]; then echo "using cached build" setup_github_env exit 0 @@ -93,7 +93,7 @@ tar -xzf hdf5-${HDF5_PATCH_VERSION}.tar.gz mkdir -p hdf5-${HDF5_PATCH_VERSION}/build pushd hdf5-${HDF5_PATCH_VERSION}/build -cmake -G Ninja --log-level verbose \ +cmake -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${HDF5_DIR} \ -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON \ @@ -121,10 +121,11 @@ tar -xzf v${HIGHFIVE_VERSION}.tar.gz mkdir -p HighFive-${HIGHFIVE_VERSION}/build pushd HighFive-${HIGHFIVE_VERSION}/build -cmake -G Ninja --log-level verbose \ +cmake -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ + -DHDF5_ROOT=${HDF5_DIR} \ -DCMAKE_INSTALL_PREFIX=${HIGHFIVE_DIR} \ - -DHIGHFIVE_USE_BOOST:BOOL=ON \ + -DHIGHFIVE_USE_BOOST:BOOL=OFF \ -DHIGHFIVE_UNIT_TESTS:BOOL=OFF \ -DHIGHFIVE_EXAMPLES:BOOL=OFF \ -DHIGHFIVE_BUILD_DOCS:BOOL=OFF \