Skip to content

Commit c3aaa05

Browse files
committed
test-1: ci
1 parent babaa96 commit c3aaa05

File tree

6 files changed

+659
-226
lines changed

6 files changed

+659
-226
lines changed

.github/workflows/build_wheels.yml

Lines changed: 121 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build Wheels
33
on:
44
push:
55
branches:
6-
- main
6+
- dot
77
tags:
88
- "quaddtype-v*"
99
paths:
@@ -19,12 +19,44 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v3
22+
with:
23+
submodules: recursive
2224

2325
- name: Set up Python
2426
uses: actions/setup-python@v4
2527
with:
2628
python-version: ">=3.10.0"
2729

30+
- name: Install dependencies
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y cmake build-essential libomp-dev git pkg-config
34+
35+
- name: Verify QuadBLAS submodule
36+
run: |
37+
ls -la QuadBLAS/
38+
ls -la QuadBLAS/include/quadblas/
39+
40+
- name: Install SLEEF and setup QuadBLAS
41+
run: |
42+
# Install SLEEF
43+
git clone --branch 3.8 --depth 1 https://github.com/shibatch/sleef.git
44+
cd sleef
45+
cmake -S . -B build \
46+
-DSLEEF_BUILD_QUAD:BOOL=ON \
47+
-DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \
48+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
49+
cmake --build build/ --clean-first -j
50+
sudo cmake --install build --prefix /usr/local
51+
cd ..
52+
53+
# Install QuadBLAS headers from submodule (header-only)
54+
sudo cp -r QuadBLAS/include/quadblas /usr/local/include/
55+
56+
# Verify installation
57+
ls -la /usr/local/include/quadblas/
58+
ls -la /usr/local/lib/
59+
2860
- name: Install cibuildwheel
2961
run: pip install cibuildwheel==2.20.0
3062

@@ -34,16 +66,25 @@ jobs:
3466
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
3567
CIBW_BUILD_VERBOSITY: "3"
3668
CIBW_BEFORE_ALL: |
37-
git clone --branch 3.8 https://github.com/shibatch/sleef.git
69+
# Install SLEEF
70+
git clone --branch 3.8 --depth 1 https://github.com/shibatch/sleef.git
3871
cd sleef
39-
cmake -S . -B build -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
72+
cmake -S . -B build \
73+
-DSLEEF_BUILD_QUAD:BOOL=ON \
74+
-DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \
75+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
4076
cmake --build build/ --clean-first -j
4177
cmake --install build --prefix /usr/local
78+
cd ..
79+
80+
# Install QuadBLAS headers from submodule
81+
cp -r QuadBLAS/include/quadblas /usr/local/include/
4282
CIBW_ENVIRONMENT: >
43-
CFLAGS="-I/usr/local/include $CFLAGS"
44-
CXXFLAGS="-I/usr/local/include $CXXFLAGS"
45-
LDFLAGS="-L/usr/local/lib64 $LDFLAGS"
46-
LD_LIBRARY_PATH="/usr/local/lib64:$LD_LIBRARY_PATH"
83+
CFLAGS="-I/usr/local/include -I/usr/local/include/quadblas $CFLAGS"
84+
CXXFLAGS="-I/usr/local/include -I/usr/local/include/quadblas -std=c++17 $CXXFLAGS"
85+
LDFLAGS="-L/usr/local/lib64 -Wl,-rpath,/usr/local/lib64 -lsleef -lsleefquad -fopenmp -latomic -lpthread $LDFLAGS"
86+
LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH"
87+
PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
4788
CIBW_REPAIR_WHEEL_COMMAND: |
4889
auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel}
4990
CIBW_TEST_COMMAND: |
@@ -68,17 +109,29 @@ jobs:
68109

69110
steps:
70111
- uses: actions/checkout@v3
112+
with:
113+
submodules: recursive
71114

72115
- name: Set up Python
73116
uses: actions/setup-python@v4
74117
with:
75118
python-version: "3.10"
76119

77-
- name: Install SLEEF
120+
- name: Install dependencies
121+
run: |
122+
brew install cmake libomp git
123+
124+
- name: Verify QuadBLAS submodule
125+
run: |
126+
ls -la QuadBLAS/
127+
ls -la QuadBLAS/include/quadblas/
128+
129+
- name: Install SLEEF and setup QuadBLAS
78130
env:
79131
MACOSX_DEPLOYMENT_TARGET: "11.0"
80132
run: |
81-
git clone --branch 3.8 https://github.com/shibatch/sleef.git
133+
# Install SLEEF
134+
git clone --branch 3.8 --depth 1 https://github.com/shibatch/sleef.git
82135
cd sleef
83136
cmake -S . -B build \
84137
-DSLEEF_BUILD_QUAD:BOOL=ON \
@@ -89,6 +142,11 @@ jobs:
89142
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
90143
cmake --build build/ --clean-first -j
91144
sudo cmake --install build --prefix /usr/local
145+
cd ..
146+
147+
# Install QuadBLAS headers from submodule
148+
sudo cp -r QuadBLAS/include/quadblas /usr/local/include/
149+
92150
- name: Install cibuildwheel
93151
run: pip install cibuildwheel==2.20.0
94152

@@ -97,12 +155,30 @@ jobs:
97155
CIBW_BUILD: "cp310-* cp311-* cp312-*"
98156
CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }}
99157
CIBW_BUILD_VERBOSITY: "1"
158+
CIBW_BEFORE_ALL: |
159+
# Install SLEEF
160+
git clone --branch 3.8 --depth 1 https://github.com/shibatch/sleef.git
161+
cd sleef
162+
cmake -S . -B build \
163+
-DSLEEF_BUILD_QUAD:BOOL=ON \
164+
-DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \
165+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
166+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
167+
-DCMAKE_INSTALL_RPATH="@loader_path/../lib" \
168+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
169+
cmake --build build/ --clean-first -j
170+
cmake --install build --prefix /usr/local
171+
cd ..
172+
173+
# Install QuadBLAS headers from submodule
174+
cp -r QuadBLAS/include/quadblas /usr/local/include/
100175
CIBW_ENVIRONMENT: >
101176
MACOSX_DEPLOYMENT_TARGET="11.0"
102177
DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH"
103-
CFLAGS="-I/usr/local/include $CFLAGS"
104-
CXXFLAGS="-I/usr/local/include $CXXFLAGS"
105-
LDFLAGS="-L/usr/local/lib $LDFLAGS"
178+
CFLAGS="-I/usr/local/include -I/usr/local/include/quadblas $CFLAGS"
179+
CXXFLAGS="-I/usr/local/include -I/usr/local/include/quadblas -std=c++17 $CXXFLAGS"
180+
LDFLAGS="-L/usr/local/lib -lsleef -lsleefquad $LDFLAGS"
181+
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
106182
CIBW_REPAIR_WHEEL_COMMAND: >
107183
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
108184
CIBW_TEST_COMMAND: |
@@ -127,6 +203,8 @@ jobs:
127203

128204
steps:
129205
- uses: actions/checkout@v3
206+
with:
207+
submodules: recursive
130208

131209
- name: Setup MSVC
132210
uses: ilammy/msvc-dev-cmd@v1
@@ -142,19 +220,31 @@ jobs:
142220
- name: Install CMake
143221
uses: lukka/get-cmake@latest
144222

223+
- name: Verify QuadBLAS submodule
224+
shell: pwsh
225+
run: |
226+
Get-ChildItem QuadBLAS/
227+
Get-ChildItem QuadBLAS/include/quadblas/
228+
145229
- name: Clone and Build SLEEF
146230
shell: pwsh
147231
run: |
148-
git clone --branch 3.8 https://github.com/shibatch/sleef.git
232+
git clone --branch 3.8 --depth 1 https://github.com/shibatch/sleef.git
149233
cd sleef
150234
cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture == 'x86' && 'Win32' || 'x64' }} -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
151235
cmake --build build --config Release
152236
cmake --install build --prefix "C:/sleef" --config Release
153237
238+
- name: Install QuadBLAS headers from submodule
239+
shell: pwsh
240+
run: |
241+
New-Item -ItemType Directory -Force -Path "C:/quadblas/include"
242+
Copy-Item -Recurse -Force "QuadBLAS/include/quadblas" "C:/quadblas/include/"
243+
154244
- name: Setup build environment
155245
shell: pwsh
156246
run: |
157-
$env:INCLUDE += ";C:\sleef\include"
247+
$env:INCLUDE += ";C:\sleef\include;C:\quadblas\include"
158248
$env:LIB += ";C:\sleef\lib"
159249
$env:PATH = "C:\sleef\bin;$env:PATH"
160250
echo "INCLUDE=$env:INCLUDE" >> $env:GITHUB_ENV
@@ -175,8 +265,24 @@ jobs:
175265
CIBW_BUILD_VERBOSITY: "3"
176266
DISTUTILS_USE_SDK: "1"
177267
MSSdk: "1"
268+
CIBW_BEFORE_ALL: |
269+
git clone --branch 3.8 --depth 1 https://github.com/shibatch/sleef.git
270+
cd sleef
271+
cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture == 'x86' && 'Win32' || 'x64' }} -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
272+
cmake --build build --config Release
273+
cmake --install build --prefix "C:/sleef" --config Release
274+
cd ..
275+
mkdir -p C:/quadblas/include
276+
cp -r QuadBLAS/include/quadblas C:/quadblas/include/
178277
CIBW_BEFORE_BUILD: |
179278
pip install meson meson-python ninja numpy
279+
CIBW_ENVIRONMENT: >
280+
INCLUDE="C:/sleef/include;C:/quadblas/include;$INCLUDE"
281+
LIB="C:/sleef/lib;$LIB"
282+
PATH="C:/sleef/bin;$PATH"
283+
CFLAGS="/IC:/sleef/include /IC:/quadblas/include $CFLAGS"
284+
CXXFLAGS="/IC:/sleef/include /IC:/quadblas/include /std:c++17 $CXXFLAGS"
285+
LDFLAGS="C:/sleef/lib/sleef.lib C:/sleef/lib/sleefquad.lib $LDFLAGS"
180286
CIBW_REPAIR_WHEEL_COMMAND: 'delvewheel repair -w {dest_dir} {wheel} --add-path C:\sleef\bin'
181287
CIBW_TEST_COMMAND: |
182288
pip install {package}[test]
@@ -216,39 +322,4 @@ jobs:
216322
- name: Publish to PyPI
217323
uses: pypa/gh-action-pypi-publish@release/v1
218324
with:
219-
packages-dir: dist/*
220-
221-
# With the current setup, we are not creating a release on GitHub.
222-
# create_release:
223-
# name: Create Release
224-
# needs: [build_wheels_linux, build_wheels_macos, build_wheels_windows]
225-
# runs-on: ubuntu-latest
226-
# if: startsWith(github.ref, 'refs/tags/quaddtype-v')
227-
228-
# steps:
229-
# - name: Checkout code
230-
# uses: actions/checkout@v2
231-
232-
# - name: Download all workflow run artifacts
233-
# uses: actions/download-artifact@v4
234-
# with:
235-
# path: artifacts
236-
237-
# - name: Create Release
238-
# id: create_release
239-
# uses: actions/create-release@v1
240-
# env:
241-
# GITHUB_TOKEN: ${{ secrets.QUADDTYPE_GITHUB_TOKEN }}
242-
# with:
243-
# tag_name: ${{ github.ref }}
244-
# release_name: Release ${{ github.ref }}
245-
# draft: false
246-
# prerelease: false
247-
248-
# - name: Upload Release Assets
249-
# uses: softprops/action-gh-release@v1
250-
# if: startsWith(github.ref, 'refs/tags/')
251-
# with:
252-
# files: ./artifacts/**/*.whl
253-
# env:
254-
# GITHUB_TOKEN: ${{ secrets.QUADDTYPE_GITHUB_TOKEN }}
325+
packages-dir: dist/*

quaddtype/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ source temp/bin/activate
5353
# Install the package
5454
pip install meson-python numpy pytest
5555

56-
export LDFLAGS="-Wl,-rpath,$SLEEF_DIR/lib"
56+
export LDFLAGS="-Wl,-rpath,$SLEEF_DIR/lib -fopenmp -latomic -lpthread"
57+
export CFLAGS="-fPIC"
58+
export CXXFLAGS="-fPIC"
59+
5760
python -m pip install . -v --no-build-isolation -Cbuilddir=build -C'compile-args=-v'
5861

5962
# Run the tests

0 commit comments

Comments
 (0)