Skip to content

Commit

Permalink
CI: make floess_lib a dependency [wheel build]
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Jul 8, 2024
1 parent 8d9bf7c commit 75a68b3
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ jobs:
# so easier to separate out here.
- [ubuntu-22.04, manylinux_x86_64, ""]
- [macos-13, macosx_x86_64, openblas]
- [macos-13, macosx_x86_64, accelerate]
- [macos-14, macosx_arm64, accelerate] # always use accelerate
- [windows-2019, win_amd64, ""]
# - [macos-13, macosx_x86_64, accelerate]
# - [macos-14, macosx_arm64, accelerate] # always use accelerate
# - [windows-2019, win_amd64, ""]

# python: ["cp310", "cp311", "cp312", "cp13"]
python: ["cp312"]
Expand Down Expand Up @@ -183,6 +183,13 @@ jobs:
DYLD="$DYLD_LIBRARY_PATH:/$PWD/.openblas/lib"
echo "CIBW_ENVIRONMENT_MACOS=$CIBW PKG_CONFIG_PATH=$PKG_CONFIG_PATH DYLD_LIBRARY_PATH=$DYLD" >> "$GITHUB_ENV"
fi
- name: Linux - Setup
if: runner.os == 'Linux'
run: |
CIBW="RUNNER_OS=macOS"
PKG_CONFIG_PATH="/project/.openblas"
LD="$LD_LIBRARY_PATH:/project/.openblas/lib"
echo "CIBW_ENVIRONMENT_LINUX=$CIBW PKG_CONFIG_PATH=$PKG_CONFIG_PATH LD_LIBRARY_PATH=$LD" >> "$GITHUB_ENV"
- name: Build wheels
uses: pypa/[email protected]
Expand All @@ -195,7 +202,7 @@ jobs:
run: |
pushd wheelhouse
unzip *.whl
nm -g skmisc/loess/*.so
nm -gu skmisc/loess/*.so
popd
- name: Check Package Version
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,11 @@ manylinux-aarch64-image = "manylinux2014"
# RUNNER_OS is a GitHub Actions specific env var; define it here so it works on Cirrus CI too
RUNNER_OS="Linux"
# /project will be the $PWD equivalent inside the docker used to build the wheel
# PKG_CONFIG_PATH="/project/.openblas"
PKG_CONFIG_PATH="/project/.openblas"
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/project/.openblas/lib"


[tool.cibuildwheel.macos]
# universal2 wheels are not supported (see gh-21233), use `delocate-fuse` if you need them
# note that universal2 wheels are not built, they're listed in the tool.cibuildwheel.skip
Expand Down
3 changes: 2 additions & 1 deletion skmisc/loess/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ loess_cython_gen = generator(
###

#### Fortran Loess into a static library

floess_lib = static_library(
'floess',
sources: [
'src/loessf.f',
'src/linpack_lite.f'
],
dependencies: [blas_dep, lapack_dep],
fortran_args: [fortran_ignore_warnings],
dependencies: [blas_dep, lapack_dep],
)
###

Expand Down
2 changes: 2 additions & 0 deletions skmisc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ endif

# MKL-specific options
mkl_version_req = '>=2023.0' # see gh-24824
mkl_opts = []

# Note that we can only use a BLAS which provides a CBLAS interface. So disable
# BLAS completely if CBLAS is not found.
Expand Down Expand Up @@ -242,6 +243,7 @@ else
endif
###

message(f'BLAS name : @blas_name@')
#### Dependencies Information
dependency_map = {
'BLAS': blas,
Expand Down
1 change: 1 addition & 0 deletions tools/wheels/cibw_before_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ srcdir = os.path.join(os.path.dirname(scipy_openblas64.__file__), ".dylibs")
if os.path.exists(srcdir): # macosx delocate
shutil.copytree(srcdir, os.path.join("$PKG_CONFIG_PATH", ".dylibs"))
EOF
cat $PKG_CONFIG_PATH/scipy-openblas.pc
# pkg-config scipy-openblas --print-provides
fi
if [[ $RUNNER_OS == "Windows" ]]; then
Expand Down
15 changes: 15 additions & 0 deletions tools/wheels/cibw_test_command.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
set -xe

if [[ $RUNNER_OS == "Windows" ]]; then
# GH 20391
PY_DIR=$(python -c "import sys; print(sys.prefix)")
mkdir $PY_DIR/libs
fi

if [[ $RUNNER_OS == "macOS" && $RUNNER_ARCH == "X64" ]]; then
# Not clear why this is needed but it seems on x86_64 this is not the default
# and without it f2py tests fail
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/local/lib"
# Needed so gfortran (not clang) can find system libraries like libm (-lm)
# in f2py tests
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
fi

python -c "import sys; import skmisc; sys.exit(skmisc.test())"

0 comments on commit 75a68b3

Please sign in to comment.