diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index 1c2944b9..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 hdf5 ninja + 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 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..d1362836 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: @@ -54,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' 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) 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]"]