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 61fe65c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
8 changes: 5 additions & 3 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 @@ -195,6 +195,8 @@ jobs:
run: |
pushd wheelhouse
unzip *.whl
nm -g skmisc/loess/*.a
echo '--------------------'
nm -g skmisc/loess/*.so
popd
Expand Down
9 changes: 6 additions & 3 deletions skmisc/loess/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ floess_lib = static_library(
'src/loessf.f',
'src/linpack_lite.f'
],
dependencies: [blas_dep, lapack_dep],
fortran_args: [fortran_ignore_warnings],
dependencies: [blas_dep, lapack_dep],
install: true,
install_dir: py3.get_install_dir() / 'skmisc/loess'
)

floess_dep = declare_dependency(link_with: floess_lib)
###

#### Loess Extenstion Module
Expand All @@ -38,8 +42,7 @@ py3.extension_module(
loess_cython_gen.process('src/_loess.pyx')
],
c_args: [cython_c_args],
dependencies: [py3_dep, npymath_lib, np_dep],
link_with: [floess_lib],
dependencies: [py3_dep, npymath_lib, np_dep, floess_dep],
link_args: [cython_c_link_args],
link_language: 'c',
install: true,
Expand Down
17 changes: 16 additions & 1 deletion tools/wheels/cibw_test_command.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
set -xe

python -c "import sys; import skmisc; sys.exit(skmisc.test())"
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 61fe65c

Please sign in to comment.