Skip to content

Commit 2706d1f

Browse files
committed
Fix Linux wheel compiler
1 parent 4b42fc8 commit 2706d1f

1 file changed

Lines changed: 28 additions & 7 deletions

File tree

.github/workflows/python-release.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ jobs:
9191
fail-fast: false
9292
matrix:
9393
include:
94-
# Linux x86_64 with CUDA support. Use the manylinux 2.34 image's
95-
# default GCC 11 toolchain: CUDA 12.6 supports GCC 6.x-13.2, while
96-
# GCC 13 emits libstdc++ symbols newer than auditwheel's
97-
# manylinux_2_35 policy allows.
94+
# Linux x86_64 with CUDA support. The manylinux 2.34 image's default
95+
# compiler is GCC 14, which emits libstdc++ symbols newer than
96+
# auditwheel's manylinux_2_35 policy allows. Install and pin the
97+
# AlmaLinux system GCC 11 toolchain in the Linux build environment.
9898
- os: ubuntu-latest
9999
architecture: x86_64
100100
cibw_archs: x86_64
@@ -215,11 +215,21 @@ jobs:
215215
LIBCLANG_PATH=$HOME/.pecos/deps/llvm-21.1/lib
216216
CMAKE=$HOME/.pecos/deps/cmake-${{ env.PECOS_CMAKE_VERSION }}/bin/cmake
217217
CUDA_PATH=/usr/local/cuda-12.6
218+
CC=/usr/bin/gcc
219+
CXX=/usr/bin/g++
220+
CUDAHOSTCXX=/usr/bin/g++
221+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/gcc
222+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/gcc
218223
MATURIN_PEP517_ARGS="--locked --features=extension-module,mwpf"
219224
CIBW_BEFORE_ALL_LINUX: |
220225
bash scripts/ci/ensure-rust.sh stable minimal
221226
export PATH=$HOME/.cargo/bin:$PATH
222-
dnf install -y bzip2 libffi-devel xz
227+
dnf install -y bzip2 gcc gcc-c++ libffi-devel xz
228+
export CC=/usr/bin/gcc
229+
export CXX=/usr/bin/g++
230+
export CUDAHOSTCXX=/usr/bin/g++
231+
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/gcc
232+
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/gcc
223233
# Install CUDA Toolkit for GPU support on x86_64 (compile-time only, no GPU needed)
224234
if [ "${{ matrix.install_cuda }}" = "true" ]; then
225235
echo "Installing CUDA Toolkit from NVIDIA repos..."
@@ -231,10 +241,11 @@ jobs:
231241
export PATH=$CUDA_PATH/bin:$PATH
232242
echo "CUDA installed at $CUDA_PATH"
233243
nvcc --version
234-
gcc --version
235244
else
236245
echo "Skipping CUDA installation (GPU support not enabled for this build)"
237246
fi
247+
"$CC" --version
248+
"$CXX" --version
238249
bash scripts/ci/install-llvm-21-conda-linux.sh
239250
cargo run --locked --release -p pecos-cli -- llvm configure "$HOME/.pecos/deps/llvm-21.1"
240251
cargo run --locked --release -p pecos-cli -- install cmake --force
@@ -316,10 +327,20 @@ jobs:
316327
LD_LIBRARY_PATH=$HOME/.pecos/deps/llvm-21.1/lib:$LD_LIBRARY_PATH
317328
LLVM_SYS_211_PREFIX=$HOME/.pecos/deps/llvm-21.1
318329
LIBCLANG_PATH=$HOME/.pecos/deps/llvm-21.1/lib
330+
CC=/usr/bin/gcc
331+
CXX=/usr/bin/g++
332+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/gcc
333+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/gcc
319334
CIBW_BEFORE_ALL_LINUX: |
320335
bash scripts/ci/ensure-rust.sh stable minimal
321336
export PATH=$HOME/.cargo/bin:$PATH
322-
dnf install -y bzip2 libffi-devel xz
337+
dnf install -y bzip2 gcc gcc-c++ libffi-devel xz
338+
export CC=/usr/bin/gcc
339+
export CXX=/usr/bin/g++
340+
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/gcc
341+
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/gcc
342+
"$CC" --version
343+
"$CXX" --version
323344
bash scripts/ci/install-llvm-21-conda-linux.sh
324345
cargo run --locked --release -p pecos-cli -- llvm configure "$HOME/.pecos/deps/llvm-21.1"
325346
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >

0 commit comments

Comments
 (0)