Skip to content

Commit ab927a5

Browse files
committed
fixing setup
1 parent 1670f58 commit ab927a5

File tree

2 files changed

+75
-44
lines changed

2 files changed

+75
-44
lines changed

.github/workflows/temp.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,12 @@ jobs:
4343
conda config --add channels conda-forge
4444
conda config --set channel_priority strict
4545
conda install -y sleef numpy
46-
conda list
47-
if [ ! -f "$CONDA_PREFIX/Library/include/sleef.h" ]; then
48-
echo "sleef.h not found. Installation may have failed."
49-
exit 1
50-
fi
51-
ls -l "$CONDA_PREFIX/Library/include/sleef.h"
52-
ls -l "$CONDA_PREFIX/Library/lib/sleef"*
5346
54-
- name: Install build dependencies
47+
- name: Install cibuildwheel
5548
shell: bash -l {0}
5649
run: |
5750
pip install -U pip
58-
pip install cibuildwheel==2.20.0 ninja meson meson-python numpy delvewheel pytest
51+
pip install cibuildwheel==2.20.0
5952
6053
- name: Build wheels
6154
env:
@@ -66,14 +59,11 @@ jobs:
6659
DISTUTILS_USE_SDK: '1'
6760
MSSdk: '1'
6861
CIBW_BEFORE_BUILD: |
69-
pip install meson meson-python ninja numpy
70-
echo %CONDA_PREFIX%
71-
dir %CONDA_PREFIX%\Library\include
72-
dir %CONDA_PREFIX%\Library\lib
62+
pip install meson meson-python ninja numpy delvewheel pytest
7363
CIBW_REPAIR_WHEEL_COMMAND: 'delvewheel repair -w {dest_dir} {wheel}'
7464
CIBW_TEST_COMMAND: |
7565
pip install {package}[test]
76-
pytest {project}/tests
66+
python -m pytest -v ./quaddtype/tests
7767
CIBW_TEST_EXTRAS: 'test'
7868
CIBW_TEST_FAIL_FAST: 1
7969
shell: pwsh

temp.yml

Lines changed: 71 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,65 +9,106 @@ on:
99
pull_request:
1010

1111
jobs:
12-
build_wheels_windows:
13-
name: Build wheels on Windows
14-
runs-on: windows-latest
12+
build_wheels_linux:
13+
name: Build wheels on Linux
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '>=3.10.0'
22+
23+
- name: Install cibuildwheel
24+
run: pip install cibuildwheel==2.20.0
25+
26+
- name: Build wheels
27+
env:
28+
CIBW_BUILD: 'cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64'
29+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
30+
CIBW_BUILD_VERBOSITY: '3'
31+
CIBW_BEFORE_ALL: |
32+
git clone https://github.com/shibatch/sleef.git
33+
cd sleef
34+
cmake -S . -B build -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
35+
cmake --build build/ --clean-first -j
36+
cmake --install build --prefix /usr/local
37+
CIBW_ENVIRONMENT: >
38+
CFLAGS="-I/usr/local/include $CFLAGS"
39+
CXXFLAGS="-I/usr/local/include $CXXFLAGS"
40+
LDFLAGS="-L/usr/local/lib64 $LDFLAGS"
41+
LD_LIBRARY_PATH="/usr/local/lib64:$LD_LIBRARY_PATH"
42+
CIBW_REPAIR_WHEEL_COMMAND: |
43+
auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel}
44+
CIBW_TEST_COMMAND: |
45+
pip install {package}[test]
46+
pytest {project}/tests
47+
CIBW_TEST_EXTRAS: 'test'
48+
run: |
49+
python -m cibuildwheel --output-dir wheelhouse
50+
working-directory: ./quaddtype
51+
52+
- uses: actions/upload-artifact@v4
53+
with:
54+
path: ./quaddtype/wheelhouse/*.whl
55+
name: wheels-linux
56+
57+
build_wheels_macos:
58+
name: Build wheels on ${{ matrix.os }}
59+
runs-on: ${{ matrix.os }}
1560
strategy:
1661
matrix:
17-
architecture: [x64, x86]
62+
os: [macos-13, macos-14]
1863

1964
steps:
2065
- uses: actions/checkout@v3
2166

22-
- name: Setup MSVC
23-
uses: ilammy/msvc-dev-cmd@v1
24-
with:
25-
arch: ${{ matrix.architecture }}
26-
2767
- name: Set up Python
2868
uses: actions/setup-python@v4
2969
with:
3070
python-version: '3.10'
31-
architecture: ${{ matrix.architecture }}
3271

33-
- name: Install build dependencies
34-
run: |
35-
python -m pip install --upgrade pip
36-
pip install cmake ninja
37-
38-
- name: Build SLEEF
39-
shell: cmd
72+
- name: Install SLEEF
73+
env:
74+
MACOSX_DEPLOYMENT_TARGET: '11.0'
4075
run: |
4176
git clone https://github.com/shibatch/sleef.git
4277
cd sleef
43-
cmake -G Ninja -S . -B build -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
44-
cmake --build build --config Release
45-
cmake --install build --prefix C:\sleef
46-
78+
cmake -S . -B build \
79+
-DSLEEF_BUILD_QUAD:BOOL=ON \
80+
-DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \
81+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
82+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
83+
-DCMAKE_INSTALL_RPATH="@loader_path/../lib" \
84+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
85+
cmake --build build/ --clean-first -j
86+
sudo cmake --install build --prefix /usr/local
4787
- name: Install cibuildwheel
4888
run: pip install cibuildwheel==2.20.0
4989

5090
- name: Build wheels
5191
env:
5292
CIBW_BUILD: 'cp310-* cp311-* cp312-*'
53-
CIBW_ARCHS_WINDOWS: ${{ matrix.architecture == 'x86' && 'x86' || 'AMD64' }}
93+
CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }}
5494
CIBW_BUILD_VERBOSITY: '1'
55-
DISTUTILS_USE_SDK: '1'
56-
MSSdk: '1'
57-
PATH: C:\sleef\bin;${{ env.PATH }}
95+
CIBW_ENVIRONMENT: >
96+
MACOSX_DEPLOYMENT_TARGET="11.0"
97+
DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH"
98+
CFLAGS="-I/usr/local/include $CFLAGS"
99+
CXXFLAGS="-I/usr/local/include $CXXFLAGS"
100+
LDFLAGS="-L/usr/local/lib $LDFLAGS"
58101
CIBW_REPAIR_WHEEL_COMMAND: >
59-
delvewheel repair -w {dest_dir} {wheel}
60-
CIBW_BEFORE_BUILD: pip install delvewheel
102+
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
61103
CIBW_TEST_COMMAND: |
62104
pip install {package}[test]
63-
pytest {project}\tests
105+
pytest {project}/tests
64106
CIBW_TEST_EXTRAS: 'test'
65-
shell: bash
66107
run: |
67108
python -m cibuildwheel --output-dir wheelhouse
68109
working-directory: ./quaddtype
69110

70111
- uses: actions/upload-artifact@v4
71112
with:
72113
path: ./quaddtype/wheelhouse/*.whl
73-
name: wheels-windows-${{ matrix.architecture }}
114+
name: wheels-${{ matrix.os }}

0 commit comments

Comments
 (0)