Skip to content

Commit

Permalink
macOS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwweber committed Nov 4, 2024
1 parent 9410165 commit 1c3c1e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cache
hdf5-*
HighFive-*
*.tar.gz
11 changes: 6 additions & 5 deletions cibw_before_all_macos.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit 1c3c1e0

Please sign in to comment.