Skip to content

Commit 732c5f5

Browse files
committed
Merge remote-tracking branch 'origin/feat/pecos-deps' into bug/issues-213-and-89
2 parents 5610072 + 85e5054 commit 732c5f5

File tree

115 files changed

+12287
-3826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+12287
-3826
lines changed

.github/workflows/go-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
os: [ubuntu-latest, windows-latest, macOS-latest]
41-
go-version: ["1.21", "1.22"] # Test on recent stable versions
41+
go-version: ["stable"] # Latest stable (experimental bindings)
4242

4343
steps:
4444
- uses: actions/checkout@v4

.github/workflows/julia-release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,35 +106,35 @@ jobs:
106106
- name: Install LLVM 14.0.6 using pecos-llvm (Unix)
107107
if: runner.os != 'Windows'
108108
run: |
109-
echo "Installing LLVM using pecos-llvm-utils..."
110-
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install
109+
echo "Installing LLVM using pecos-dev..."
110+
cargo run -p pecos-dev --release -- llvm install
111111
112112
echo "Setting LLVM environment variables..."
113-
export PECOS_LLVM=$(cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>/dev/null)
113+
export PECOS_LLVM=$(cargo run -p pecos-dev --release -- llvm find 2>/dev/null)
114114
export LLVM_SYS_140_PREFIX="$PECOS_LLVM"
115115
116116
echo "PECOS_LLVM=$PECOS_LLVM" >> $GITHUB_ENV
117117
echo "LLVM_SYS_140_PREFIX=$LLVM_SYS_140_PREFIX" >> $GITHUB_ENV
118118
119119
echo "Verifying LLVM installation..."
120-
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check
120+
cargo run -p pecos-dev --release -- llvm check
121121
122122
- name: Install LLVM 14.0.6 using pecos-llvm (Windows)
123123
if: runner.os == 'Windows'
124124
shell: pwsh
125125
run: |
126-
Write-Host "Installing LLVM using pecos-llvm-utils..."
127-
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install
126+
Write-Host "Installing LLVM using pecos-dev..."
127+
cargo run -p pecos-dev --release -- llvm install
128128
129129
Write-Host "Setting LLVM environment variables..."
130-
$env:PECOS_LLVM = (cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>$null)
130+
$env:PECOS_LLVM = (cargo run -p pecos-dev --release -- llvm find 2>$null)
131131
$env:LLVM_SYS_140_PREFIX = $env:PECOS_LLVM
132132
133133
"PECOS_LLVM=$env:PECOS_LLVM" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
134134
"LLVM_SYS_140_PREFIX=$env:LLVM_SYS_140_PREFIX" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
135135
136136
Write-Host "Verifying LLVM installation..."
137-
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check
137+
cargo run -p pecos-dev --release -- llvm check
138138
139139
- name: Install Rust target
140140
run: |

.github/workflows/julia-test.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
os: [ubuntu-latest, windows-latest, macOS-latest]
41-
julia-version: ["1.10", "1"] # 1.10 = LTS, 1 = latest stable
41+
julia-version: ["1"] # Latest stable (experimental bindings)
4242

4343
steps:
4444
- uses: actions/checkout@v4
@@ -57,35 +57,35 @@ jobs:
5757
# - name: Install LLVM 14.0.6 using pecos-llvm (Unix)
5858
# if: runner.os != 'Windows'
5959
# run: |
60-
# echo "Installing LLVM using pecos-llvm-utils..."
61-
# cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install
60+
# echo "Installing LLVM using pecos-dev..."
61+
# cargo run -p pecos-dev --release -- llvm install
6262
#
6363
# echo "Setting LLVM environment variables..."
64-
# export PECOS_LLVM=$(cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>/dev/null)
64+
# export PECOS_LLVM=$(cargo run -p pecos-dev --release -- llvm find 2>/dev/null)
6565
# export LLVM_SYS_140_PREFIX="$PECOS_LLVM"
6666
#
6767
# echo "PECOS_LLVM=$PECOS_LLVM" >> $GITHUB_ENV
6868
# echo "LLVM_SYS_140_PREFIX=$LLVM_SYS_140_PREFIX" >> $GITHUB_ENV
6969
#
7070
# echo "Verifying LLVM installation..."
71-
# cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check
71+
# cargo run -p pecos-dev --release -- llvm check
7272
#
7373
# - name: Install LLVM 14.0.6 using pecos-llvm (Windows)
7474
# if: runner.os == 'Windows'
7575
# shell: pwsh
7676
# run: |
77-
# Write-Host "Installing LLVM using pecos-llvm-utils..."
78-
# cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install
77+
# Write-Host "Installing LLVM using pecos-dev..."
78+
# cargo run -p pecos-dev --release -- llvm install
7979
#
8080
# Write-Host "Setting LLVM environment variables..."
81-
# $env:PECOS_LLVM = (cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>$null)
81+
# $env:PECOS_LLVM = (cargo run -p pecos-dev --release -- llvm find 2>$null)
8282
# $env:LLVM_SYS_140_PREFIX = $env:PECOS_LLVM
8383
#
8484
# "PECOS_LLVM=$env:PECOS_LLVM" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
8585
# "LLVM_SYS_140_PREFIX=$env:LLVM_SYS_140_PREFIX" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
8686
#
8787
# Write-Host "Verifying LLVM installation..."
88-
# cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check
88+
# cargo run -p pecos-dev --release -- llvm check
8989

9090
- name: Cache Rust
9191
uses: Swatinem/rust-cache@v2

.github/workflows/python-release.yml

Lines changed: 118 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,71 @@ jobs:
7171
fail-fast: false
7272
matrix:
7373
include:
74+
# Linux x86_64 with CUDA support (uses GCC Toolset 13 for CUDA compatibility)
7475
- os: ubuntu-latest
7576
architecture: x86_64
76-
- os: ubuntu-latest
77-
architecture: aarch64
78-
runner: ubuntu-latest
77+
cibw_archs: x86_64
78+
cuda_feature: "--features cuda"
79+
install_cuda: true
80+
# GCC Toolset 13 paths for CUDA compatibility
81+
gcc_path_prefix: "/opt/rh/gcc-toolset-13/root/usr/bin:"
82+
gcc_ld_path: "/opt/rh/gcc-toolset-13/root/usr/lib64:/opt/rh/gcc-toolset-13/root/usr/lib:"
83+
gcc_cc: "/opt/rh/gcc-toolset-13/root/usr/bin/gcc"
84+
gcc_cxx: "/opt/rh/gcc-toolset-13/root/usr/bin/g++"
85+
# Linux aarch64 - DISABLED: LLVM 14 not available in manylinux_2_28 (AlmaLinux 8)
86+
# The prebuilt LLVM 14 binary is incompatible with the container, and
87+
# the llvm-toolset module only provides LLVM 13. Re-enable when we have
88+
# a solution (custom Docker image, build from source, or inkwell LLVM 13 support)
89+
# - os: ubuntu-24.04-arm
90+
# architecture: aarch64
91+
# runner: ubuntu-24.04-arm
92+
# cibw_archs: aarch64
93+
# cuda_feature: ""
94+
# install_cuda: false
95+
# gcc_path_prefix: ""
96+
# gcc_ld_path: ""
97+
# gcc_cc: ""
98+
# gcc_cxx: ""
99+
# macOS without CUDA (NVIDIA dropped macOS CUDA support in 2019)
79100
- os: macos-14
80101
architecture: aarch64
102+
cuda_feature: ""
103+
install_cuda: false
81104
- os: macos-15-intel
82105
architecture: x86_64
106+
cuda_feature: ""
107+
install_cuda: false
108+
# Windows x86_64 with CUDA support
109+
# Note: Uses specific sub-packages to avoid VS integration bug (see Jimver/cuda-toolkit#382)
83110
- os: windows-2022
84111
architecture: x86_64
112+
cuda_feature: "--features cuda"
113+
install_cuda: true
85114

86115
steps:
87116
- uses: actions/checkout@v4
88117
with:
89118
ref: ${{ inputs.sha || github.sha }}
90119
submodules: recursive
91120

121+
# Set up Visual Studio environment on Windows (required for nvcc to find cl.exe)
122+
- name: Set up Visual Studio environment (Windows)
123+
if: runner.os == 'Windows' && matrix.install_cuda
124+
uses: ilammy/msvc-dev-cmd@v1
125+
with:
126+
arch: x64
127+
128+
# Install CUDA on Windows before cibuildwheel (cibuildwheel runs on host, not in containers)
129+
# Uses specific sub-packages to avoid VS 17.3.x bug that hangs on NSight/VS Integration
130+
# See: https://github.com/Jimver/cuda-toolkit/issues/382
131+
- name: Install CUDA Toolkit (Windows)
132+
if: runner.os == 'Windows' && matrix.install_cuda
133+
uses: Jimver/cuda-toolkit@v0.2.29
134+
with:
135+
cuda: '12.5.1'
136+
method: 'local'
137+
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust"]'
138+
92139
- name: Build wheels
93140
uses: pypa/cibuildwheel@v3.2.1
94141
with:
@@ -98,17 +145,37 @@ jobs:
98145
# Build configuration
99146
CIBW_BUILD: "cp310-*"
100147
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
148+
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs }}
101149
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"
102150
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28"
103-
# Linux configuration
151+
# Linux configuration - GCC Toolset and CUDA paths are conditional via matrix variables
104152
CIBW_ENVIRONMENT_LINUX: >
105-
PATH=$HOME/.cargo/bin:$HOME/.pecos/llvm/bin:$PATH
153+
PATH=${{ matrix.gcc_path_prefix }}$HOME/.cargo/bin:$HOME/.pecos/llvm/bin:/usr/local/cuda-12.6/bin:$PATH
154+
LD_LIBRARY_PATH=${{ matrix.gcc_ld_path }}$LD_LIBRARY_PATH
106155
LLVM_SYS_140_PREFIX=$HOME/.pecos/llvm
156+
CUDA_PATH=/usr/local/cuda-12.6
157+
MATURIN_PEP517_ARGS="${{ matrix.cuda_feature }}"
107158
CIBW_BEFORE_ALL_LINUX: |
108159
curl -sSf https://sh.rustup.rs | sh -s -- -y
109160
source $HOME/.cargo/env
110161
dnf install libffi-devel -y
111-
cargo run --release -p pecos-llvm-utils --bin pecos-llvm -- install --force
162+
# Install CUDA Toolkit for GPU support on x86_64 (compile-time only, no GPU needed)
163+
if [ "${{ matrix.install_cuda }}" = "true" ]; then
164+
echo "Installing GCC 13 (required for CUDA 12.6 compatibility)..."
165+
dnf install -y gcc-toolset-13
166+
source /opt/rh/gcc-toolset-13/enable
167+
echo "Installing CUDA Toolkit from NVIDIA repos..."
168+
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
169+
dnf install -y cuda-nvcc-12-6 cuda-cudart-devel-12-6 libcublas-devel-12-6
170+
export CUDA_PATH=/usr/local/cuda-12.6
171+
export PATH=$CUDA_PATH/bin:$PATH
172+
echo "CUDA installed at $CUDA_PATH"
173+
nvcc --version
174+
gcc --version
175+
else
176+
echo "Skipping CUDA installation (GPU support not enabled for this build)"
177+
fi
178+
cargo run --release -p pecos-dev -- llvm install --force
112179
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
113180
auditwheel repair -w {dest_dir} {wheel} &&
114181
pipx run abi3audit --strict --report {wheel}
@@ -121,7 +188,7 @@ jobs:
121188
curl -sSf https://sh.rustup.rs | sh -s -- -y
122189
source $HOME/.cargo/env
123190
rustup update
124-
cargo run --release -p pecos-llvm-utils --bin pecos-llvm -- install --force
191+
cargo run --release -p pecos-dev -- llvm install --force
125192
# Create a codesign wrapper that strips DYLD_LIBRARY_PATH to prevent
126193
# crashes on macOS 15 when bundled libc++ conflicts with system libc++
127194
mkdir -p $HOME/.pecos/bin
@@ -130,22 +197,29 @@ jobs:
130197
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
131198
PATH=$HOME/.pecos/bin:$PATH DYLD_LIBRARY_PATH=$HOME/.pecos/llvm/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} &&
132199
pipx run abi3audit --strict --report {wheel}
133-
# Windows configuration
200+
# Windows configuration - CUDA via Jimver/cuda-toolkit (installed before cibuildwheel)
134201
CIBW_ENVIRONMENT_WINDOWS: >
135202
PATH="C:\\Users\\runneradmin\\.pecos\\llvm\\bin;$PATH"
136203
LLVM_SYS_140_PREFIX="C:\\Users\\runneradmin\\.pecos\\llvm"
204+
MATURIN_PEP517_ARGS="${{ matrix.cuda_feature }}"
137205
CIBW_BEFORE_ALL_WINDOWS: >
138-
echo "=== Installing LLVM using pecos-llvm-utils ===" &&
206+
echo "=== Installing LLVM using pecos-dev ===" &&
139207
rustup update &&
140208
echo "=== Running pecos-llvm install ===" &&
141-
cargo run --release -p pecos-llvm-utils --bin pecos-llvm -- install --force &&
209+
cargo run --release -p pecos-dev -- llvm install --force &&
142210
echo "=== Checking LLVM installation ===" &&
143211
(test -d "C:\\Users\\runneradmin\\.pecos\\llvm" && echo "LLVM directory exists" && ls -la "C:\\Users\\runneradmin\\.pecos\\llvm" && (ls -la "C:\\Users\\runneradmin\\.pecos\\llvm\\bin" || echo "bin directory not found")) || (echo "ERROR: LLVM directory not found!" && exit 1) &&
144212
echo "=== Verifying LLVM_SYS_140_PREFIX ===" &&
145213
echo "LLVM_SYS_140_PREFIX will be set to: C:\\Users\\runneradmin\\.pecos\\llvm"
146-
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
214+
# Install delvewheel and patch it to ignore ext-ms-win-* API sets
215+
# (delvewheel ignores api-ms-win-* but not ext-ms-win-* which are also Windows API sets)
216+
CIBW_BEFORE_BUILD_WINDOWS: >
217+
pip install delvewheel &&
218+
python -c "import delvewheel._dll_list as d,inspect,re as r;p=inspect.getfile(d);c=open(p).read();n=chr(10);open(p,'w').write(c.replace(r\"re.compile('api-.*'),\",r\"re.compile('api-.*'),\"+n+r\" re.compile('ext-.*'),\")) if 'ext-.*' not in c else None"
219+
# Note: --no-dll excludes Windows system DLLs that should not be bundled
220+
# combase.dll and rmclient.dll are core Windows components that fail when bundled
147221
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
148-
delvewheel repair -w {dest_dir} {wheel} &&
222+
delvewheel repair -v --add-path "C:\\Users\\runneradmin\\.pecos\\llvm\\bin" --no-dll "combase.dll;rmclient.dll" -w {dest_dir} {wheel} &&
149223
pipx run abi3audit --strict --report {wheel}
150224
151225
- name: Upload wheels
@@ -201,6 +275,38 @@ jobs:
201275
python -c 'import pecos_rslib; print(f"pecos_rslib version: {pecos_rslib.__version__}")'
202276
python -c 'import sys; print(f"Python version: {sys.version}")'
203277
278+
- name: Debug DLL loading (Windows)
279+
if: failure() && runner.os == 'Windows'
280+
shell: pwsh
281+
run: |
282+
Write-Host "=== Listing wheel contents ==="
283+
$wheelFile = Get-ChildItem -Path ./pecos-rslib-wheel/*.whl | Select-Object -First 1
284+
python -m zipfile -l $wheelFile
285+
286+
Write-Host "`n=== Finding pecos_rslib installation ==="
287+
$sitePackages = python -c "import site; print(site.getsitepackages()[0])"
288+
Write-Host "Site packages: $sitePackages"
289+
290+
Write-Host "`n=== Listing pecos_rslib directory ==="
291+
Get-ChildItem -Path "$sitePackages\pecos_rslib*" -Recurse | Select-Object FullName, Length
292+
293+
Write-Host "`n=== Checking DLL dependencies with dumpbin ==="
294+
$pydFile = Get-ChildItem -Path "$sitePackages\pecos_rslib\*.pyd" -ErrorAction SilentlyContinue | Select-Object -First 1
295+
if ($pydFile) {
296+
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\dumpbin.exe" /dependents $pydFile.FullName 2>&1 | Select-Object -First 50
297+
}
298+
299+
Write-Host "`n=== Checking pecos_rslib.libs directory ==="
300+
$libsDir = "$sitePackages\pecos_rslib.libs"
301+
if (Test-Path $libsDir) {
302+
Get-ChildItem -Path $libsDir | ForEach-Object {
303+
Write-Host "DLL: $($_.Name)"
304+
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\dumpbin.exe" /dependents $_.FullName 2>&1 | Select-Object -First 30
305+
}
306+
} else {
307+
Write-Host "No pecos_rslib.libs directory found"
308+
}
309+
204310
build_sdist_quantum_pecos:
205311
needs: build_wheelspecos_rslib
206312
if: |

.github/workflows/python-test.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ jobs:
9898
- name: Set up Rust
9999
run: rustup show
100100

101+
- name: Install just
102+
uses: extractions/setup-just@v2
103+
101104
- name: Cache Rust
102105
uses: Swatinem/rust-cache@v2
103106
with:
@@ -106,35 +109,35 @@ jobs:
106109
- name: Install LLVM 14.0.6 using pecos-llvm (Unix)
107110
if: runner.os != 'Windows'
108111
run: |
109-
echo "Installing LLVM using pecos-llvm-utils..."
110-
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install
112+
echo "Installing LLVM using pecos-dev..."
113+
cargo run -p pecos-dev --release -- llvm install
111114
112115
echo "Setting LLVM environment variables..."
113-
export PECOS_LLVM=$(cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>/dev/null)
116+
export PECOS_LLVM=$(cargo run -p pecos-dev --release -- llvm find 2>/dev/null)
114117
export LLVM_SYS_140_PREFIX="$PECOS_LLVM"
115118
116119
echo "PECOS_LLVM=$PECOS_LLVM" >> $GITHUB_ENV
117120
echo "LLVM_SYS_140_PREFIX=$LLVM_SYS_140_PREFIX" >> $GITHUB_ENV
118121
119122
echo "Verifying LLVM installation..."
120-
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check
123+
cargo run -p pecos-dev --release -- llvm check
121124
122125
- name: Install LLVM 14.0.6 using pecos-llvm (Windows)
123126
if: runner.os == 'Windows'
124127
shell: pwsh
125128
run: |
126-
Write-Host "Installing LLVM using pecos-llvm-utils..."
127-
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install
129+
Write-Host "Installing LLVM using pecos-dev..."
130+
cargo run -p pecos-dev --release -- llvm install
128131
129132
Write-Host "Setting LLVM environment variables..."
130-
$env:PECOS_LLVM = (cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>$null)
133+
$env:PECOS_LLVM = (cargo run -p pecos-dev --release -- llvm find 2>$null)
131134
$env:LLVM_SYS_140_PREFIX = $env:PECOS_LLVM
132135
133136
"PECOS_LLVM=$env:PECOS_LLVM" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
134137
"LLVM_SYS_140_PREFIX=$env:LLVM_SYS_140_PREFIX" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
135138
136139
Write-Host "Verifying LLVM installation..."
137-
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check
140+
cargo run -p pecos-dev --release -- llvm check
138141
139142
- name: Build and test PECOS (Windows)
140143
if: runner.os == 'Windows'
@@ -219,8 +222,8 @@ jobs:
219222
$env:LLVM_SYS_140_PREFIX = $env:LLVM_SYS_140_PREFIX
220223
221224
# Build and test
222-
make build-debug
223-
make pytest-all
225+
just build-debug
226+
just pytest-all
224227
225228
- name: Build and test PECOS (non-Windows)
226229
if: runner.os != 'Windows'
@@ -266,7 +269,7 @@ jobs:
266269
fi
267270
268271
# Build the project
269-
make build-debug
272+
just build-debug
270273
271274
# After build, verify the extension module on macOS
272275
if [[ "${{ runner.os }}" == "macOS" ]]; then
@@ -281,9 +284,9 @@ jobs:
281284
fi
282285
fi
283286
284-
make pytest-all
287+
just pytest-all
285288
286289
- name: Run linting
287290
run: |
288291
# Run all linting checks
289-
make lint # Rust checks + Python pre-commit
292+
just lint # Rust checks + Python pre-commit

0 commit comments

Comments
 (0)