From 7ac43a4c73b73d25774eb6b4d71f3765fa66f00b Mon Sep 17 00:00:00 2001 From: Chris Harris Date: Fri, 13 Sep 2024 13:22:34 +0000 Subject: [PATCH 1/5] Add CIBW_BEFORE_ALL_MACOS to build HDF5 The brew installed version has a too new min os version --- .github/scripts/install.sh | 2 +- .github/scripts/install_hdf5_macos.sh | 18 ++++++++++++++++++ .github/workflows/build_wheels.yml | 8 ++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .github/scripts/install_hdf5_macos.sh diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index 1c2944b9..bed4f25a 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -6,5 +6,5 @@ pip install cibuildwheel if [[ $RUNNER_OS == "Windows" ]]; then git clone --recursive -b 3.3.9 --depth 1 https://gitlab.com/libeigen/eigen /c/eigen elif [[ $RUNNER_OS == "macOS" ]]; then - brew install eigen hdf5 ninja + brew install eigen ninja fi diff --git a/.github/scripts/install_hdf5_macos.sh b/.github/scripts/install_hdf5_macos.sh new file mode 100644 index 00000000..8e15ad93 --- /dev/null +++ b/.github/scripts/install_hdf5_macos.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -ev + +VERSION="1.14.4" +PATCH_LABEL="3" +VERSION_PATH="hdf5_$VERSION.$PATCH_LABEL" +NAME="hdf5-$VERSION-$PATCH_LABEL" +TARBALL="$NAME.tar.gz" +wget https://github.com/HDFGroup/hdf5/releases/download/$VERSION_PATH/$TARBALL +tar -xzf $TARBALL +mkdir build +cd build +cmake -GNinja ../$NAME -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF -DBUILD_TESTING:BOOL=OFF +ninja +sudo ninja install +# We create a symlink to the install directory that doesn't include the version number, so +# we can use it elsewhere without having to change the version number. +sudo ln -s /usr/local/HDF_Group/HDF5/$VERSION /usr/local/HDF_Group/HDF5/current diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index dd6e66b0..6a5ecb9a 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -20,11 +20,13 @@ env: # Specify eigen location for windows, and force it to use python in the path... CIBW_ENVIRONMENT_WINDOWS: > - EXTRA_CMAKE_ARGS="-DEIGEN3_INCLUDE_DIR=C:\\eigen;-Dstempy_ENABLE_HDF5=OFF" + EXTRA_CMAKE_ARGS="-DEIGEN3_DIR=C:\\PROGRA~2\\Eigen3\\share\\eigen3\\cmake\\;-Dstempy_ENABLE_HDF5=OFF" USE_PYTHON_IN_PATH=1 # Get cmake to use python in the path... - CIBW_ENVIRONMENT_MACOS: USE_PYTHON_IN_PATH=1 + CIBW_ENVIRONMENT_MACOS: > + EXTRA_CMAKE_ARGS="-DHDF5_DIR=/usr/local/HDF_Group/HDF5/current/cmake" + USE_PYTHON_IN_PATH=1 CIBW_BEFORE_TEST: pip install -r {project}/tests/requirements.txt @@ -32,6 +34,8 @@ env: CIBW_ARCHS_MACOS: x86_64 arm64 + CIBW_BEFORE_ALL_MACOS: . .github/scripts/install_hdf5_macos.sh + # Use bash by default for the run command defaults: run: From 02f864483a70b547bb928f187f2ca71b0a7c3154 Mon Sep 17 00:00:00 2001 From: Chris Harris Date: Fri, 13 Sep 2024 16:35:12 +0000 Subject: [PATCH 2/5] Build Eigen on Windows --- .github/scripts/install.sh | 2 +- .github/scripts/install_eigen_windows.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .github/scripts/install_eigen_windows.sh diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index bed4f25a..fed93ab1 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -4,7 +4,7 @@ set -ev pip install cibuildwheel if [[ $RUNNER_OS == "Windows" ]]; then - git clone --recursive -b 3.3.9 --depth 1 https://gitlab.com/libeigen/eigen /c/eigen + .github/scripts/install_eigen_windows.sh elif [[ $RUNNER_OS == "macOS" ]]; then brew install eigen ninja fi diff --git a/.github/scripts/install_eigen_windows.sh b/.github/scripts/install_eigen_windows.sh new file mode 100644 index 00000000..b9c14b0b --- /dev/null +++ b/.github/scripts/install_eigen_windows.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -ev + +choco install ninja +git clone --recursive -b 3.3.9 --depth 1 https://gitlab.com/libeigen/eigen /c/eigen +mkdir /c/build +cd /c/build +cmake -GNinja /c/eigen +ninja install From 440464161c9b72fa5a2e3224ca4c3ed9dbbb9bf4 Mon Sep 17 00:00:00 2001 From: Chris Harris Date: Fri, 13 Sep 2024 16:35:45 +0000 Subject: [PATCH 3/5] Use Eigen target --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e19343b3..2b00f851 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,6 @@ include_directories( ) find_package(Eigen3 REQUIRED) -include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR}) find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module) add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/pybind11) @@ -39,7 +38,7 @@ set(PYBIND11_CPP_STANDARD "-std=c++14" CACHE STRING "") option(BUILD_SHARED_LIBS "Build shared libraries" ON) -set(_libs Threads::Threads) +set(_libs Threads::Threads Eigen3::Eigen) option(stempy_ENABLE_MPI "Build with MPI" OFF) if (stempy_ENABLE_MPI) From 28d2a73fdc113c9c35a9f86f61e037d91b5715de Mon Sep 17 00:00:00 2001 From: Chris Harris Date: Fri, 13 Sep 2024 16:37:37 +0000 Subject: [PATCH 4/5] Relax pin on sckit-build --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8af79e3d..bcd2d41d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools", "wheel", "scikit-build==0.14.1", "setuptools_scm[toml]"] +requires = ["setuptools", "wheel", "scikit-build", "setuptools_scm[toml]"] From deb307cb3161cc46831de1b79e077535cb8bb9e8 Mon Sep 17 00:00:00 2001 From: Chris Harris Date: Fri, 13 Sep 2024 17:39:17 +0000 Subject: [PATCH 5/5] Bump actions versions For depreciated Node.js version --- .github/workflows/build_wheels.yml | 2 +- .github/workflows/docker.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 6a5ecb9a..d1362836 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -58,7 +58,7 @@ jobs: fetch-depth: 0 submodules: recursive - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 name: Install Python with: python-version: '3.10' diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f4a8dee6..1321c40f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 submodules: 'recursive'