Skip to content

Commit 308f42b

Browse files
committed
Force lib name to libdeepwave_C on Windows, pre-install CPU-only PyTorch on Linux, set more environment variables for CUDA on Windows (including CUDACXX), and add some dir commands to try to find out why it is not finding Intel OpenMP
1 parent 704d917 commit 308f42b

3 files changed

Lines changed: 32 additions & 18 deletions

File tree

.github/workflows/build.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ jobs:
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [ubuntu-latest, windows-2022, macos-13, macos-14]
11+
os: [windows-2022]
12+
#os: [ubuntu-latest, windows-2022, macos-13, macos-14]
1213

1314
steps:
1415
- uses: actions/checkout@v5
@@ -35,27 +36,32 @@ jobs:
3536
nuget install intelopenmp.redist.win -DirectDownload -NonInteractive
3637
cp intelopenmp.devel.win*/build/native/win-x64/libiomp5md.lib .
3738
cp intelopenmp.redist.win*/runtimes/win-x64/native/libiomp5md.dll .
39+
echo "dir lib"
40+
dir libiomp5md.lib
41+
echo "dir dll"
42+
dir libiomp5md.dll
43+
echo "dir"
44+
dir
3845
curl https://developer.download.nvidia.com/compute/cuda/12.4.0/network_installers/cuda_12.4.0_windows_network.exe -o cuda_12.4.0_windows_network.exe
3946
chmod +x ./cuda_12.4.0_windows_network.exe
4047
./cuda_12.4.0_windows_network.exe -s nvcc_12.4 cudart_12.4
4148
echo "CUDA_PATH=C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4" >> $GITHUB_ENV
4249
echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4\\bin" >> $GITHUB_PATH
43-
CIBW_ENVIRONMENT_WINDOWS: CUDA_PATH="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4" PATH="$PATH:C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4\\bin"
44-
CUDAToolkit_ROOT: ${{ env.CUDA_PATH }}
50+
CIBW_ENVIRONMENT_WINDOWS: PATH="$PATH:C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4\\bin" CUDA_PATH="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4" CUDA_HOME="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4" CUDACXX="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4\\bin\\nvcc"
4551

4652
- uses: actions/upload-artifact@v4
4753
with:
4854
path: ./wheelhouse/*.whl
4955

50-
build_sdist:
51-
name: Build source distribution
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v5
55-
56-
- name: Build sdist
57-
run: pipx run build --sdist
58-
59-
- uses: actions/upload-artifact@v4
60-
with:
61-
path: dist/*.tar.gz
56+
# build_sdist:
57+
# name: Build source distribution
58+
# runs-on: ubuntu-latest
59+
# steps:
60+
# - uses: actions/checkout@v5
61+
#
62+
# - name: Build sdist
63+
# run: pipx run build --sdist
64+
#
65+
# - uses: actions/upload-artifact@v4
66+
# with:
67+
# path: dist/*.tar.gz

CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,16 @@ else()
8888
endif()
8989

9090
# Add warning flags for GCC/Clang
91+
#add_compile_options(
92+
# $<$<C_COMPILER_ID:GNU,Clang>:-Wall>
93+
# $<$<C_COMPILER_ID:GNU,Clang>:-Wextra>
94+
# $<$<C_COMPILER_ID:GNU,Clang>:-pedantic>
95+
#)
9196
add_compile_options(
92-
$<$<C_COMPILER_ID:GNU,Clang>:-Wall>
93-
$<$<C_COMPILER_ID:GNU,Clang>:-Wextra>
94-
$<$<C_COMPILER_ID:GNU,Clang>:-pedantic>
97+
$<$<C_COMPILER_ID:MSVC>:/w>
9598
)
9699

100+
97101
if(CMAKE_BUILD_TYPE MATCHES Release)
98102
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|Intel")
99103
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Ofast")
@@ -221,6 +225,9 @@ endif()
221225

222226
# --- Final Library Build ---
223227
add_library(deepwave_C SHARED ${DEEPWAVE_OBJECTS})
228+
if(WIN32)
229+
set_target_properties(deepwave_C PROPERTIES OUTPUT_NAME "libdeepwave_C")
230+
endif()
224231
set_target_properties(deepwave_C PROPERTIES
225232
C_VISIBILITY_PRESET default
226233
CUDA_VISIBILITY_PRESET default

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ test-requires = "pytest scipy torch"
5252
test-command = "pytest {project}/tests"
5353
# Don't bundle CUDA libraries with the wheel
5454
repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel} --exclude libcuda.so.1 --exclude 'libcudart.so.*'"
55+
before-test = "pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu"
5556

5657
[tool.cibuildwheel.windows]
5758
test-command = "pytest {project}/tests/test_scalar.py"

0 commit comments

Comments
 (0)