Skip to content

Commit aed7e6a

Browse files
less PATH is more PATH
1 parent 47361d1 commit aed7e6a

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

.github/workflows/testing_wheels.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ jobs:
3737
architecture: x64
3838
cibw:
3939
build: "cp36-win_amd64 cp37-win_amd64 cp38-win_amd64 cp39-win_amd64"
40+
env:
41+
# Note: Location of env does not matter.
42+
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
43+
CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}"
44+
CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
45+
CIBW_BEFORE_ALL_LINUX: "bash build_tools/cuda_install.sh && echo $PATH"
46+
# overwriting PATH is breaking Python - need to add to PATH somehow?
47+
CIBW_ENVIRONMENT_LINUX: PATH=/usr/local/cuda-11/bin:$PATH LD_LIBRARY_PATH=/usr/local/cuda-11/lib64:$LD_LIBRARY_PATH
48+
CIBW_ENVIRONMENT_PASS_LINUX: PATH LD_LIBRARY_PATH
49+
CIBW_BEFORE_BUILD_MACOS: "brew install libomp"
50+
# *cuda.so was not built, suspect `which nvcc` is null
51+
CIBW_BEFORE_BUILD_LINUX: "echo $PATH && which nvcc"
52+
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
53+
# due to package and module name conflict have to temporarily move it away to run tests
54+
CIBW_BEFORE_TEST: "mv {package}/qsimcirq /tmp"
55+
CIBW_TEST_COMMAND: "pytest {package}/qsimcirq_tests/qsimcirq_test.py && mv /tmp/qsimcirq {package}"
4056
steps:
4157
- uses: actions/checkout@v2
4258

@@ -85,21 +101,6 @@ jobs:
85101
# run: bash build_tools/test_libs.sh
86102

87103
- name: Build wheels
88-
env:
89-
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
90-
CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}"
91-
CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
92-
CIBW_BEFORE_ALL_LINUX: "source build_tools/cuda_install.sh && echo $PATH"
93-
CIBW_ENVIRONMENT_LINUX: PATH=/usr/local/cuda-11/bin:$PATH
94-
# overwriting PATH is breaking Python - need to add to PATH somehow?
95-
CIBW_ENVIRONMENT_PASS_LINUX: PATH
96-
CIBW_BEFORE_BUILD_MACOS: "brew install libomp"
97-
# *cuda.so was not built, suspect `which nvcc` is null
98-
CIBW_BEFORE_BUILD_LINUX: "echo $PATH && which nvcc"
99-
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
100-
# due to package and module name conflict have to temporarily move it away to run tests
101-
CIBW_BEFORE_TEST: "mv {package}/qsimcirq /tmp"
102-
CIBW_TEST_COMMAND: "pytest {package}/qsimcirq_tests/qsimcirq_test.py && mv /tmp/qsimcirq {package}"
103104
run: python -m cibuildwheel --output-dir wheelhouse
104105

105106
- uses: actions/upload-artifact@v2

build_tools/cuda_install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ yum -y install cuda-drivers
1717

1818
# post-install actions
1919

20-
export PATH=/usr/local/cuda-11/bin:$PATH
21-
export LD_LIBRARY_PATH=/usr/local/cuda-11/lib64:$LD_LIBRARY_PATH
20+
# commented to allow outer PATH-setting
21+
# export PATH=/usr/local/cuda-11/bin:$PATH
22+
# export LD_LIBRARY_PATH=/usr/local/cuda-11/lib64:$LD_LIBRARY_PATH
2223

2324
# works here, does not escape to build process
2425
nvcc --version

0 commit comments

Comments
 (0)