-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into full-multisolve
- Loading branch information
Showing
16 changed files
with
528 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,6 +201,7 @@ jobs: | |
if: needs.setup.outputs.do_macos == 'true' | ||
strategy: | ||
matrix: | ||
arch: ["arm64", "x86_64"] # NB: only x86_64 wheel will be tested as no macosx_arm64 github runner available | ||
os: ${{ fromJSON(needs.setup.outputs.build).macos }} | ||
python-version: ${{ fromJSON(needs.setup.outputs.python_version_per_os).macos }} | ||
fail-fast: false | ||
|
@@ -258,9 +259,6 @@ jobs: | |
if: steps.cache-build-dependencies.outputs.cache-hit != 'true' | ||
run: echo "SKDECIDE_SKIP_DEPS=0" >> $GITHUB_ENV | ||
|
||
- name: Install omp | ||
run: brew install libomp | ||
|
||
- name: Install and restore ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
|
@@ -273,30 +271,62 @@ jobs: | |
echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> ${GITHUB_ENV} | ||
- name: Build wheel | ||
env: | ||
ARCH: ${{ matrix.arch }} | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
run: | | ||
export "Boost_ROOT=$PWD/$BOOST_DIR" | ||
export "OpenMP_ROOT=$(brew --prefix)/opt/libomp" | ||
python -m pip install --upgrade pip | ||
pip install build poetry-dynamic-versioning | ||
# cross-compile for macosx-10.15 | ||
export MACOSX_DEPLOYMENT_TARGET=10.15 | ||
python -m build --sdist --wheel "--config-setting=--plat-name=macosx_10_15_x86_64" | ||
# hack wheel name to be recognized by macos 10.15 | ||
wheel_name=$(ls dist/*.whl) | ||
new_wheel_name=$(echo $wheel_name | sed -e 's/macosx_.*_x86_64.whl/macosx_10_15_x86_64.whl/') | ||
echo "mv $wheel_name $new_wheel_name" | ||
mv $wheel_name $new_wheel_name | ||
if [[ "$ARCH" == arm64 ]]; then | ||
# SciPy requires 12.0 on arm to prevent kernel panics | ||
# https://github.com/scipy/scipy/issues/14688 | ||
# We use the same deployment target to match SciPy. | ||
export MACOSX_DEPLOYMENT_TARGET=12.0 | ||
OPENMP_URL="https://anaconda.org/conda-forge/llvm-openmp/11.1.0/download/osx-arm64/llvm-openmp-11.1.0-hf3c4609_1.tar.bz2" | ||
else | ||
export MACOSX_DEPLOYMENT_TARGET=10.15 | ||
OPENMP_URL="https://anaconda.org/conda-forge/llvm-openmp/11.1.0/download/osx-64/llvm-openmp-11.1.0-hda6cdc1_1.tar.bz2" | ||
fi | ||
PYTHON_VERSION_WO_DOT=$(echo ${PYTHON_VERSION} | sed -e 's/\.//g') # remove "." | ||
MACOSX_DEPLOYMENT_TARGET_WO_DOT=$(echo ${MACOSX_DEPLOYMENT_TARGET} | sed -e 's/\./_/g') # replace "." by "_" | ||
# install appropriate version of openmp | ||
sudo conda create -n build $OPENMP_URL | ||
# make openmp and boost available | ||
export Boost_ROOT=$PWD/$BOOST_DIR | ||
export OpenMP_ROOT=$CONDA/envs/build | ||
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp" | ||
export CFLAGS="$CFLAGS -I$OpenMP_ROOT/include" | ||
export CXXFLAGS="$CXXFLAGS -I$OpenMP_ROOT/include" | ||
export LDFLAGS="$LDFLAGS -Wl,-rpath,$OpenMP_ROOT/lib -L$OpenMP_ROOT/lib -lomp" | ||
# cmake flag to cross-compile the c++ | ||
export CMAKE_OSX_ARCHITECTURES=${ARCH} | ||
python -m pip install cibuildwheel | ||
# cibuildwheel flags | ||
export CIBW_BUILD_FRONTEND="build" | ||
export CIBW_ARCHS=${ARCH} | ||
export CIBW_BUILD="cp${PYTHON_VERSION_WO_DOT}-macosx_${ARCH}" | ||
# build wheel | ||
python -m cibuildwheel --output-dir wheelhouse | ||
# set the proper platform tag | ||
# - with poetry build + cross-compilation for arm64, the tag could been still x64_64 (https://cibuildwheel.readthedocs.io/en/stable/faq/#how-to-cross-compile) | ||
# - we downgrade the displayed macosx version to ensure compatibility with lesser macosx than the ones used on this runner | ||
pip install "wheel>=0.40" | ||
wheel tags --platform-tag macosx_${MACOSX_DEPLOYMENT_TARGET_WO_DOT}_${ARCH} --remove wheelhouse/*.whl | ||
- name: Update build cache from wheels | ||
if: steps.cache-build-dependencies.outputs.cache-hit != 'true' | ||
run: 7z x dist/*.whl -y | ||
run: 7z x wheelhouse/*.whl -y | ||
|
||
- name: Upload as build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist/*.whl | ||
path: wheelhouse/*.whl | ||
|
||
build-ubuntu: | ||
needs: [setup] | ||
|
@@ -553,7 +583,7 @@ jobs: | |
- name: Install scikit-decide and test dependencies | ||
run: | | ||
python_version=${{ matrix.python-version }} | ||
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*macos*.whl) | ||
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*macos*x86_64.whl) | ||
pip install ${wheelfile}[all] pytest gymnasium[classic-control] | ||
- name: Test with pytest | ||
|
@@ -669,7 +699,7 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.8"] | ||
python-version: ["3.10"] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.