Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
515 commits
Select commit Hold shift + click to select a range
0b43fa9
Commenting decompositions
nealerickson-qtm May 15, 2025
11c93f9
F4dg experiment
nealerickson-qtm May 15, 2025
6f511d7
feel the merge
ciaranra May 17, 2025
8e112b7
fixed RZ call on qir gate mapping
Jonhas-qtm May 19, 2025
c156ad8
Reduce requirements for numpy...
ciaranra May 22, 2025
9a3403e
Removing pyquest as it has been causing some issues...
ciaranra May 22, 2025
5c7159a
Add StateVecRs as a fallback for "state-vector" in Python PECOS.
ciaranra May 22, 2025
e9da908
Python cleanup...
ciaranra May 23, 2025
5393b93
Merge branch 'numpy-req' into python-lint
ciaranra May 23, 2025
e5bc590
More cleaning
ciaranra May 23, 2025
cc8e4f8
More cleaning
ciaranra May 24, 2025
a5a8705
More cleaning
ciaranra May 24, 2025
3617371
More cleaning
ciaranra May 27, 2025
da4d8c3
improved simulation output with formatter
ciaranra Jun 3, 2025
34596cc
Refactor new result code into module
ciaranra Jun 3, 2025
001af5c
Using BitVec as the basic creg data type in pecos-qasm
ciaranra Jun 3, 2025
bbee58e
Simplifying byte_message/
ciaranra Jun 4, 2025
21130af
More cleaning
ciaranra Jun 4, 2025
ee66ea7
Fix QIR testing?
ciaranra Jun 5, 2025
d9b36ff
Simplify the parser for pecos-qasm
ciaranra Jun 5, 2025
09eb1a6
Getting new llvm stuff working
ciaranra Jun 6, 2025
232dd50
Adding const folding
ciaranra Jun 6, 2025
1718d50
adding run_qasm_sim to Python
ciaranra Jun 7, 2025
cf1c951
lint
ciaranra Jun 8, 2025
c0c5e99
Merge branch 'python-lint' into polish-qasm
ciaranra Jun 10, 2025
90f4d72
Make lint helping
ciaranra Jun 10, 2025
6c79f5a
Update some docs + cleanup of ByteMessage to use .add_outcomes and .o…
ciaranra Jun 11, 2025
45c6d79
Simplify ByteMessage
ciaranra Jun 11, 2025
8ffcf6c
Update builder pattern Python doc
ciaranra Jun 12, 2025
35b1ddb
Removing biased measurement noise since biased depolarizing noise giv…
ciaranra Jun 12, 2025
c2d3e47
Update p_idle_linear_rate to use validate_non_negative + switched p_i…
ciaranra Jun 12, 2025
5410407
Merge remote-tracking branch 'Workflow/refactor-n-memory' into play-w…
ciaranra Jun 12, 2025
e949d91
Add binary output formatting to qasm_sim
ciaranra Jun 12, 2025
fa3da10
lint
ciaranra Jun 12, 2025
bbf723c
Improve qasm_sim Python API
ciaranra Jun 12, 2025
43f256c
Add config to qasm_sim
ciaranra Jun 13, 2025
cc9986e
Fixing some qasm include issues
ciaranra Jun 13, 2025
af668bb
Merge remote-tracking branch 'Workflow/refactor-n-memory' into play-w…
ciaranra Jun 16, 2025
8f9cea5
Getting Guppy->HUGR->QIR->PECOS exec initially working
ciaranra Jun 17, 2025
4655dc7
Fixed issue with quadratic idling sometimes issuing gates with no qubits
PabloAndresCQ Jun 18, 2025
2ed578b
Getting other pipeline working, dealing with segfaults
ciaranra Jun 20, 2025
9f6ff6c
temp
ciaranra Jun 20, 2025
f545a1e
Merge branch 'refactor-n-memory' into slr_qir_classical
ciaranra Jun 23, 2025
962aaa9
Fix permute issue?
ciaranra Jun 23, 2025
2b31ce1
temp 2
ciaranra Jun 23, 2025
0a650ca
Linting
ciaranra Jun 23, 2025
35dd12f
LLVM JIT fault?
ciaranra Jun 23, 2025
e9cc307
hmmm
ciaranra Jun 23, 2025
f1e898c
attempt
ciaranra Jun 24, 2025
ace466b
not hanging...
ciaranra Jun 25, 2025
b4ac574
Working?
ciaranra Jun 25, 2025
418235e
Clean
ciaranra Jun 25, 2025
65e3178
Have hugr and qir llvm-ir at the same level
ciaranra Jun 27, 2025
847a306
Improve general noise config
ciaranra Jun 27, 2025
571ef5e
Changed general noise model parameter from p2_idle_quadratic_rate to …
ciaranra Jun 27, 2025
a52f9a2
remove support for qir style llvm-ir
ciaranra Jun 27, 2025
431e2cc
renaming things
ciaranra Jun 28, 2025
60c39c6
Fixed recursive Permute issue
ciaranra Jun 30, 2025
d10e7c3
moving pmir stuff to its own crate
ciaranra Jun 30, 2025
ff162dc
clean up
ciaranra Jun 30, 2025
942a586
moving hugr-llvm code to its own crate
ciaranra Jun 30, 2025
673ac49
cleanup
ciaranra Jul 1, 2025
2b4675f
Refactoring noise configuration for qasm_sim + making noise builders …
ciaranra Jul 1, 2025
d745258
refactor
ciaranra Jul 3, 2025
88755be
Temporarily remove RON
ciaranra Jul 4, 2025
c1cfb3c
refactor
ciaranra Jul 5, 2025
15c4bdc
renaming pecos-qir to pecos-llvm-runtime
ciaranra Jul 6, 2025
a3c6abb
pecos-phir -> pecos-phir-json
ciaranra Jul 6, 2025
3889793
pecos-phir-ron
ciaranra Jul 6, 2025
24799fe
Added scaling to p_idle_linear_rate (fix #143)
PabloAndresCQ Jul 7, 2025
71604d5
Correcting mistake from previous commit: p_idle_linear_rate needs not…
PabloAndresCQ Jul 7, 2025
04d3f54
Fix `with_p_average` scaling (#148)
PabloAndresCQ Jul 9, 2025
e1f3fd4
Fix naming issues
ciaranra Jul 9, 2025
e1d9398
Qasm wasmtime (#150)
ciaranra Jul 9, 2025
5af6293
PhirEngine
ciaranra Jul 7, 2025
455a1cf
pecos-llvm-sim
ciaranra Jul 10, 2025
b288024
more guppy coverage
ciaranra Jul 11, 2025
e9254f1
Minimal Rust wrapper for PCG
ciaranra Jul 12, 2025
cfac02b
Add TODO to the rng_model.py
ciaranra Jul 12, 2025
fdda8ea
Renaming clibs/ to clib/ since a library is already a collection of t…
ciaranra Jul 12, 2025
95a6ddb
Fixing more clibs to clib references
ciaranra Jul 12, 2025
ae26acf
Resolving maturin build failure due to not including C files for sdist
ciaranra Jul 12, 2025
2942c70
Remove sdist building for pecos-rslib due to external C source issues…
ciaranra Jul 12, 2025
8ab18ab
Merge branch 'feat/minimal-pcg-wrapper' into refactor-n-memory
ciaranra Jul 13, 2025
2441cdb
Merge remote-tracking branch 'origin/slr_qir_classical' into refactor…
ciaranra Jul 13, 2025
81c082b
Adding external LDPC decoders project support in PECOS
ciaranra Jul 13, 2025
c4779f1
more guppy coverage
ciaranra Jul 13, 2025
133bd88
Initial Selene classical engine implementation
ciaranra Jul 15, 2025
c950f22
Merge remote-tracking branch 'GitHub/refactor-n-memory' into feat/hugr
ciaranra Jul 15, 2025
deaa1a3
Merge branch 'dev' into refactor-n-memory
ciaranra Jul 16, 2025
42abfc4
Lint
ciaranra Jul 16, 2025
3b7902c
Fix pecos-rng workflow
ciaranra Jul 16, 2025
195e3ab
Fix?
ciaranra Jul 16, 2025
eaca9cd
Fix?
ciaranra Jul 16, 2025
c1ea075
Fix?
ciaranra Jul 16, 2025
bcf5a6a
Fix?
ciaranra Jul 16, 2025
e7d75de
Fix?
ciaranra Jul 16, 2025
aaacff8
Fix?
ciaranra Jul 16, 2025
d8b8416
Fix?
ciaranra Jul 16, 2025
475d429
Fix?
ciaranra Jul 16, 2025
0a4ba24
Fix?
ciaranra Jul 16, 2025
6f5ccab
Fix?
ciaranra Jul 16, 2025
9d695b1
Fix?
ciaranra Jul 16, 2025
48833ba
Fix?
ciaranra Jul 16, 2025
4d5b0e8
Fix?
ciaranra Jul 16, 2025
7defd92
Fix?
ciaranra Jul 16, 2025
aa1c3d6
Fix?
ciaranra Jul 16, 2025
d958016
Fix?
ciaranra Jul 16, 2025
2af52c0
Fix?
ciaranra Jul 16, 2025
5fb9e4c
Fix?
ciaranra Jul 16, 2025
22afada
Fix?
ciaranra Jul 16, 2025
a5c1ad4
Fix?
ciaranra Jul 16, 2025
793f74c
Fix?
ciaranra Jul 16, 2025
dbd65af
Fix?
ciaranra Jul 16, 2025
af05879
Universal sim
ciaranra Jul 16, 2025
889360d
Merge remote-tracking branch 'GitHub/refactor-n-memory' into feat/hugr
ciaranra Jul 17, 2025
84b187b
Update color code
ciaranra Jul 18, 2025
e37a8a5
Polish
ciaranra Jul 18, 2025
cabc9a7
Fix CI
ciaranra Jul 19, 2025
014f206
Lint
ciaranra Jul 19, 2025
92dfd4f
Merge remote-tracking branch 'hubalt/refactor-n-memory' into feat/mor…
ciaranra Jul 19, 2025
4e3ee1f
Merge remote-tracking branch 'hubalt/refactor-n-memory' into feat/mor…
ciaranra Jul 19, 2025
0f358fa
Merge branch 'feat/more-qeclib' into refactor-n-memory
ciaranra Jul 19, 2025
ccf94f5
sim()
ciaranra Jul 19, 2025
0755da3
Merge remote-tracking branch 'GitHub/refactor-n-memory' into feat/hugr
ciaranra Jul 19, 2025
bac696b
Lint
ciaranra Jul 19, 2025
686cf46
Merge remote-tracking branch 'GitHub/refactor-n-memory' into feat/hugr
ciaranra Jul 19, 2025
d833e15
Merge remote-tracking branch 'GitHub/refactor-n-memory' into feat/hugr
ciaranra Jul 19, 2025
5d9ce0c
cleanup
ciaranra Jul 19, 2025
29b61d4
refactor
ciaranra Jul 20, 2025
3d13df6
Make PCG thread safe
ciaranra Jul 29, 2025
f39cf76
fix
ciaranra Jul 29, 2025
d482790
Merge remote-tracking branch 'origin/bug/thread-safe-pcg' into feat/hugr
ciaranra Jul 30, 2025
139a5d3
Merge remote-tracking branch 'origin/dev' into feat/hugr
ciaranra Jul 31, 2025
5f2dd62
Initial implementation
ciaranra Jul 30, 2025
817d5fc
Refactor
ciaranra Aug 2, 2025
35ce057
Refactor2...
ciaranra Aug 3, 2025
5867979
Merge remote-tracking branch 'origin/dev' into feat/guppy-gen-v2
ciaranra Aug 10, 2025
2fed5ed
Fix
ciaranra Aug 15, 2025
ec2b3b4
Merge remote-tracking branch 'origin/dev' into feat/guppy-gen-v2
ciaranra Aug 16, 2025
67af72e
Merge remote-tracking branch 'origin/dev' into feat/guppy-gen-v2
ciaranra Aug 16, 2025
69e7464
Fix
ciaranra Aug 17, 2025
a5a1ac2
Merge remote-tracking branch 'origin/feat/guppy-gen-v2' into feat/hugr
ciaranra Aug 17, 2025
3848359
fix
ciaranra Aug 24, 2025
fbf4309
selene-frontend
ciaranra Aug 24, 2025
ecbbe43
fix?
ciaranra Sep 8, 2025
0ec9d27
Merge branch 'dev' into feat/hugr
ciaranra Sep 8, 2025
dedc045
clean up
ciaranra Sep 8, 2025
d35fa6a
lint
ciaranra Sep 8, 2025
368ed3d
fix
ciaranra Sep 8, 2025
121fbe1
lint
ciaranra Sep 14, 2025
c48b6ab
move files
ciaranra Sep 18, 2025
01d8942
lint
ciaranra Sep 19, 2025
a63dcc5
cleanup
ciaranra Sep 20, 2025
6ef5408
Polish HUGR comp
ciaranra Sep 23, 2025
b60cb40
update to pyo3 0.26
ciaranra Sep 26, 2025
793e8ff
clean up
ciaranra Sep 27, 2025
e3021bf
lint
ciaranra Sep 27, 2025
0c682c0
tweak
ciaranra Sep 29, 2025
d964b2a
prototype using selene runtimes .so files in Rust
ciaranra Sep 30, 2025
625d18e
simplify qis running. experiment with jit
ciaranra Oct 2, 2025
a0a5571
refactor qis stuff
ciaranra Oct 6, 2025
1cc876a
clean
ciaranra Oct 8, 2025
58129b4
removing peocs-qis-native and pecos-qis-jit
ciaranra Oct 10, 2025
ef03a66
clean
ciaranra Oct 10, 2025
b74f6e5
Improved cuda support
ciaranra Oct 10, 2025
9e3af8d
fix not local repos
ciaranra Oct 12, 2025
4e7a091
Update pecos-hugr-qis to make tket2 compiler but without PyO3
ciaranra Oct 14, 2025
937a786
fix julia-test?
ciaranra Oct 14, 2025
c6442d9
fix julia llvm workflow?
ciaranra Oct 14, 2025
06afce6
making llvm optional
ciaranra Oct 14, 2025
0b1a22f
fix
ciaranra Oct 14, 2025
d583dc2
fix
ciaranra Oct 14, 2025
141eb1a
fix
ciaranra Oct 14, 2025
8ba80f4
fix
ciaranra Oct 14, 2025
bb409ea
fix
ciaranra Oct 15, 2025
c6a23c0
fix
ciaranra Oct 15, 2025
409454f
fix
ciaranra Oct 15, 2025
a6b9350
fix
ciaranra Oct 15, 2025
8f3c5a2
fix
ciaranra Oct 15, 2025
7fe159b
fix
ciaranra Oct 15, 2025
9f8e54b
fix
ciaranra Oct 15, 2025
fc358a0
fix
ciaranra Oct 15, 2025
ee8a6ea
fix
ciaranra Oct 15, 2025
9665e41
fix
ciaranra Oct 15, 2025
8fa6c10
fix
ciaranra Oct 15, 2025
c161131
fix
ciaranra Oct 15, 2025
504961c
fix
ciaranra Oct 15, 2025
1747bf1
fix
ciaranra Oct 15, 2025
e7ef4f8
fix
ciaranra Oct 15, 2025
740c7ef
fix
ciaranra Oct 15, 2025
76c9ce0
fix
ciaranra Oct 16, 2025
aec2d48
fix
ciaranra Oct 16, 2025
0116189
fix
ciaranra Oct 16, 2025
c543ae2
fix
ciaranra Oct 16, 2025
46ea2f0
fix
ciaranra Oct 16, 2025
d021075
fix
ciaranra Oct 16, 2025
1028733
fix
ciaranra Oct 16, 2025
e19af9b
fix
ciaranra Oct 16, 2025
4f9632c
fix
ciaranra Oct 16, 2025
43e064c
fix
ciaranra Oct 16, 2025
5334784
fix
ciaranra Oct 16, 2025
38097f7
fix
ciaranra Oct 16, 2025
141dfa6
fix
ciaranra Oct 16, 2025
edb5b8b
fix
ciaranra Oct 16, 2025
e7a3c50
fix
ciaranra Oct 16, 2025
6586dbb
fix
ciaranra Oct 16, 2025
64315c2
fix
ciaranra Oct 17, 2025
6ff50f4
fix
ciaranra Oct 17, 2025
7045e80
fix
ciaranra Oct 17, 2025
0d714e7
fix
ciaranra Oct 17, 2025
f35c2f1
fix
ciaranra Oct 17, 2025
0c6cc6a
fix
ciaranra Oct 17, 2025
a173c43
fix
ciaranra Oct 17, 2025
e59c4e7
fix
ciaranra Oct 17, 2025
c1f6e96
fix
ciaranra Oct 17, 2025
8ccaec0
fix
ciaranra Oct 18, 2025
b4ee567
fix
ciaranra Oct 18, 2025
509f28c
fix
ciaranra Oct 18, 2025
3be332c
fix
ciaranra Oct 18, 2025
455b4e4
fix
ciaranra Oct 18, 2025
26f52c7
fix
ciaranra Oct 18, 2025
5d408bc
fix
ciaranra Oct 19, 2025
327ec26
fix
ciaranra Oct 19, 2025
ff0018f
fix
ciaranra Oct 19, 2025
fcad133
fix
ciaranra Oct 19, 2025
bc59fbd
fix
ciaranra Oct 19, 2025
a7b34a9
fix
ciaranra Oct 19, 2025
7b8fe38
fix
ciaranra Oct 19, 2025
1e4560b
fix
ciaranra Oct 19, 2025
ed45382
fix
ciaranra Oct 19, 2025
69b72d9
fix
ciaranra Oct 19, 2025
e208bcc
fix
ciaranra Oct 19, 2025
cde4072
fix
ciaranra Oct 19, 2025
af89c34
fix
ciaranra Oct 19, 2025
5ddd67a
fix?
ciaranra Oct 20, 2025
31143f1
lint
ciaranra Oct 20, 2025
b4e3e7c
Help prevent race conditions in Windows...
ciaranra Oct 20, 2025
b860587
fix
ciaranra Oct 20, 2025
cba0edd
fixing runner target in workflow
ciaranra Oct 20, 2025
e0d2fbc
fix workflows
ciaranra Oct 20, 2025
eb84be3
fix
ciaranra Oct 20, 2025
448a385
fix
ciaranra Oct 20, 2025
be6659b
fix
ciaranra Oct 21, 2025
a7ecda6
fix
ciaranra Oct 21, 2025
9dfbcb9
fix
ciaranra Oct 21, 2025
dba6023
clean up
ciaranra Oct 21, 2025
f579560
fix
ciaranra Oct 21, 2025
99354dd
clean up
ciaranra Oct 22, 2025
aaccd79
lint
ciaranra Oct 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
97 changes: 97 additions & 0 deletions .github/actions/setup-llvm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: 'Setup LLVM 14.0.6'
description: 'Install prebuilt LLVM 14.0.6 binaries for all platforms'
outputs:
llvm-path:
description: 'Path to LLVM installation'
value: ${{ steps.setup.outputs.llvm-path }}

runs:
using: 'composite'
steps:
- name: Setup LLVM (Linux)
if: runner.os == 'Linux'
shell: bash
id: setup-linux
run: |
mkdir -p /tmp/llvm
if [ "$(uname -m)" = "x86_64" ]; then
echo "Installing LLVM 14.0.6 for x86_64..."
# Use RHEL 8.4 build (Ubuntu 18.04 build doesn't exist for x86_64 in LLVM 14.0.6)
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-x86_64-linux-gnu-rhel-8.4.tar.xz
tar xf clang+llvm-14.0.6-x86_64-linux-gnu-rhel-8.4.tar.xz -C /tmp/llvm --strip-components=1
else
echo "Installing LLVM 14.0.6 for aarch64..."
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-aarch64-linux-gnu.tar.xz
tar xf clang+llvm-14.0.6-aarch64-linux-gnu.tar.xz -C /tmp/llvm --strip-components=1
fi
echo "/tmp/llvm/bin" >> $GITHUB_PATH
echo "LLVM_SYS_140_PREFIX=/tmp/llvm" >> $GITHUB_ENV
echo "llvm-path=/tmp/llvm" >> $GITHUB_OUTPUT

# Verify installation
/tmp/llvm/bin/llc --version
/tmp/llvm/bin/clang --version

- name: Setup LLVM (macOS)
if: runner.os == 'macOS'
shell: bash
id: setup-macos
run: |
mkdir -p /tmp/llvm
if [ "$(uname -m)" = "arm64" ]; then
echo "Installing LLVM 14.0.6 for arm64..."
ARCH_PREFIX=arm64-apple-darwin22.3.0
else
echo "Installing LLVM 14.0.6 for x86_64..."
ARCH_PREFIX=x86_64-apple-darwin
fi
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-$ARCH_PREFIX.tar.xz
tar xf clang+llvm-14.0.6-$ARCH_PREFIX.tar.xz -C /tmp/llvm --strip-components=1

# FIX: LLVM 14.0.6 libunwind libraries have @rpath references to themselves
# This causes "Library not loaded: @rpath/libunwind.1.dylib" errors at runtime
# Fix by changing the install name to use the absolute path
echo "Fixing LLVM libunwind install names..."
for lib in /tmp/llvm/lib/libunwind*.dylib; do
if [ -f "$lib" ]; then
echo " Fixing $(basename $lib)"
# Change the self-reference from @rpath/libunwind.1.dylib to the absolute path
install_name_tool -id "$lib" "$lib"
fi
done
echo "LLVM libunwind libraries fixed"

echo "/tmp/llvm/bin" >> $GITHUB_PATH
echo "LLVM_SYS_140_PREFIX=/tmp/llvm" >> $GITHUB_ENV
echo "llvm-path=/tmp/llvm" >> $GITHUB_OUTPUT

# Verify installation
/tmp/llvm/bin/llc --version
/tmp/llvm/bin/clang --version

- name: Setup LLVM (Windows)
if: runner.os == 'Windows'
shell: pwsh
id: setup-windows
run: |
Write-Host "Installing LLVM 14.0.6 for Windows..."
curl.exe -LO https://github.com/PLC-lang/llvm-package-windows/releases/download/v14.0.6/LLVM-14.0.6-win64.7z
7z x LLVM-14.0.6-win64.7z "-oC:\LLVM" -y

echo "C:\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "LLVM_SYS_140_PREFIX=C:\LLVM" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "llvm-path=C:\LLVM" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append

# Verify installation
C:\LLVM\bin\llc.exe --version
C:\LLVM\bin\clang.exe --version

- name: Set output
shell: bash
id: setup
run: |
if [ "$RUNNER_OS" = "Linux" ] || [ "$RUNNER_OS" = "macOS" ]; then
echo "llvm-path=/tmp/llvm" >> $GITHUB_OUTPUT
else
echo "llvm-path=C:/LLVM" >> $GITHUB_OUTPUT
fi
97 changes: 57 additions & 40 deletions .github/workflows/julia-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,24 @@ jobs:
build_julia_binaries:
needs: check_pr_push
if: needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true'
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.runner || matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
architecture: [x86_64, aarch64]
exclude:
- os: windows-latest
include:
- os: ubuntu-latest
architecture: x86_64
- os: ubuntu-latest
architecture: aarch64
runner: ubuntu-latest
- os: macos-13
architecture: x86_64
runner: macos-13 # Intel Mac for x86_64
- os: macos-latest
architecture: aarch64
runner: macos-latest # ARM64 Mac
- os: windows-latest
architecture: x86_64

steps:
- uses: actions/checkout@v4
Expand All @@ -88,22 +97,14 @@ jobs:
- name: Set up Rust
run: rustup show

- name: Setup LLVM 14.0.6
uses: ./.github/actions/setup-llvm

- name: Install Rust target
run: |
if [ "${{ matrix.architecture }}" = "aarch64" ]; then
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
rustup target add aarch64-unknown-linux-gnu
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
rustup target add aarch64-apple-darwin
fi
else
# For x86_64 builds on ARM64 macOS
if [ "${{ matrix.os }}" = "macos-latest" ]; then
rustup target add x86_64-apple-darwin
fi
fi
# With native ARM64 runners, no cross-compilation setup is needed
# All builds are now native for their respective architectures
echo "Using native build for ${{ matrix.architecture }} on ${{ matrix.os }}"

- name: Set up Visual Studio environment on Windows
if: runner.os == 'Windows'
Expand Down Expand Up @@ -133,33 +134,49 @@ jobs:
run: |
cd julia/pecos-julia-ffi

if [ "${{ matrix.architecture }}" = "aarch64" ]; then
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
cargo build --release --target aarch64-unknown-linux-gnu
target_dir="../../target/aarch64-unknown-linux-gnu/release"
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
cargo build --release --target aarch64-apple-darwin
target_dir="../../target/aarch64-apple-darwin/release"
fi
else
# For x86_64 builds
if [ "${{ matrix.os }}" = "macos-latest" ]; then
# On ARM64 macOS, explicitly build for x86_64
cargo build --release --target x86_64-apple-darwin
target_dir="../../target/x86_64-apple-darwin/release"
else
cargo build --release
target_dir="../../target/release"
fi
# Set up build flags for macOS to avoid LLVM dependency issues
if [[ "${{ matrix.os }}" == macos-* ]]; then
# Prevent linking against LLVM's libunwind
export RUSTFLAGS="-C link-arg=-Wl,-dead_strip_dylibs -C link-arg=-Wl,-ld_classic"
# Remove LLVM from library paths during build
unset DYLD_LIBRARY_PATH
unset DYLD_FALLBACK_LIBRARY_PATH
# Explicitly exclude LLVM libraries from linking
export RUSTFLAGS="$RUSTFLAGS -L native=/usr/lib"
fi

# Native build for all platforms (no cross-compilation needed with native ARM64 runners)
cargo build --release
target_dir="../../target/release"

# Create artifact directory
mkdir -p ../../artifacts

# Copy the built library
if [ "${{ matrix.os }}" = "macos-latest" ]; then
if [[ "${{ matrix.os }}" == macos-* ]]; then
cp $target_dir/libpecos_julia.dylib ../../artifacts/

# Fix any remaining LLVM dependencies
echo "Checking and fixing library dependencies..."
otool -L ../../artifacts/libpecos_julia.dylib

# Check for any problematic dependencies
if otool -L ../../artifacts/libpecos_julia.dylib | grep -q "/tmp/llvm"; then
echo "ERROR: Binary has dependencies on /tmp/llvm which won't exist at runtime!"
echo "Attempting to fix..."

# For libunwind specifically, we'll strip it out by creating a new dylib without it
if otool -L ../../artifacts/libpecos_julia.dylib | grep -q "/tmp/llvm/lib/libunwind.dylib"; then
echo "Creating fixed library without LLVM libunwind dependency..."
# Use install_name_tool to remove the dependency by setting it to a weak import
# that can fail at runtime without crashing
install_name_tool -change /tmp/llvm/lib/libunwind.dylib /usr/lib/libSystem.B.dylib ../../artifacts/libpecos_julia.dylib || \
echo "Warning: Could not remap libunwind dependency"
fi
fi

echo "Final library dependencies:"
otool -L ../../artifacts/libpecos_julia.dylib
else
cp $target_dir/libpecos_julia.so ../../artifacts/
fi
Expand Down Expand Up @@ -200,7 +217,7 @@ jobs:
os: windows-latest
architecture: x86_64
- runner: macos-13
os: macos-latest
os: macos-13
architecture: x86_64
- runner: macos-latest
os: macos-latest
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/julia-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
- name: Set up Rust
run: rustup show

- name: Setup LLVM 14.0.6
uses: ./.github/actions/setup-llvm

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -72,13 +75,29 @@ jobs:
if: runner.os == 'Windows'
shell: pwsh
run: |
Write-Host "Building with LLVM_SYS_140_PREFIX: $env:LLVM_SYS_140_PREFIX"
cd julia/pecos-julia-ffi
cargo build --release

- name: Build Rust FFI library (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
# On macOS, prevent Homebrew library paths from being used during linking
if [[ "${{ runner.os }}" == "macOS" ]]; then
# CRITICAL: Prevent Homebrew library paths from being used during linking
# This fixes the "@rpath/libunwind.1.dylib" runtime error on macOS
# Reference: https://github.com/rust-lang/rust/issues/135372
unset LIBRARY_PATH
unset LD_LIBRARY_PATH
unset DYLD_LIBRARY_PATH
unset DYLD_FALLBACK_LIBRARY_PATH
unset PKG_CONFIG_PATH
export LIBRARY_PATH=/usr/lib

echo "RUSTFLAGS: $RUSTFLAGS"
fi

cd julia/pecos-julia-ffi
cargo build --release

Expand Down
78 changes: 23 additions & 55 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,72 +60,40 @@ jobs:
build_wheels_pecos_rslib:
needs: check_pr_push
if: needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true'
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.runner || matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
architecture: [ x86_64, aarch64 ]
exclude:
- os: windows-latest
include:
- os: ubuntu-latest
architecture: x86_64
- os: ubuntu-latest
architecture: aarch64
runner: ubuntu-latest
- os: macos-14
architecture: aarch64
- os: macos-13
architecture: x86_64
- os: windows-2022
architecture: x86_64

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.sha || github.sha }}
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Remove conflicting README.md
run: |
if [ -f crates/pecos-python/README.md ]; then
mv crates/pecos-python/README.md crates/pecos-python/README.md.bak
echo "Moved conflicting README.md to README.md.bak"
else
echo "No conflicting README.md found"
fi

- name: Build wheel
uses: PyO3/maturin-action@v1
- name: Build wheels
uses: pypa/[email protected]
with:
command: build
args: --release --out dist --interpreter python3.10 ${{ matrix.architecture == 'aarch64' && '--zig' || '' }}
working-directory: python/pecos-rslib
target: ${{ matrix.architecture == 'aarch64' && (matrix.os == 'macos-latest' && 'aarch64-apple-darwin' || 'aarch64-unknown-linux-gnu') || (matrix.os == 'macos-latest' && 'x86_64-apple-darwin' || '') }}
manylinux: auto

- name: Restore README.md
if: always()
run: |
if [ -f crates/pecos-python/README.md.bak ]; then
mv crates/pecos-python/README.md.bak crates/pecos-python/README.md
echo "Restored README.md from backup"
else
echo "No README.md backup found"
fi

- name: Test wheel is abi3
run: |
# Check that the wheel has abi3 tag
ls -la python/pecos-rslib/dist/
wheel_file=$(ls python/pecos-rslib/dist/*.whl)
echo "Built wheel: $wheel_file"
if [[ $wheel_file == *"abi3"* ]]; then
echo "Wheel has abi3 tag"
else
echo "ERROR: Wheel does not have abi3 tag!"
exit 1
fi
package-dir: python/pecos-rslib
output-dir: wheelhouse

- name: Upload wheel
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-pecos-rslib-${{ matrix.os }}-${{ matrix.architecture }}
path: python/pecos-rslib/dist/*.whl
path: ./wheelhouse/*.whl

test_abi3_wheels:
needs: build_wheels_pecos_rslib
Expand All @@ -142,13 +110,13 @@ jobs:
os: ubuntu-latest
architecture: x86_64
- runner: windows-latest
os: windows-latest
os: windows-2022
architecture: x86_64
- runner: macos-13
os: macos-latest
os: macos-13
architecture: x86_64
- runner: macos-latest
os: macos-latest
- runner: macos-14
os: macos-14
architecture: aarch64
steps:
- uses: actions/checkout@v4
Expand Down
Loading
Loading