Skip to content

Commit b36c55d

Browse files
committed
Fix before all syntax for Linux and add numpy to test requirements
1 parent fc59399 commit b36c55d

3 files changed

Lines changed: 28 additions & 88 deletions

File tree

.github/workflows/build.yml

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

1413
steps:
1514
- uses: actions/checkout@v5
@@ -19,47 +18,34 @@ jobs:
1918
env:
2019
# For Linux, install CUDA in the container. Note that manylinux2014
2120
# is specified in pyproject.toml
22-
CIBW_BEFORE_ALL_LINUX: |
23-
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
21+
CIBW_BEFORE_ALL_LINUX: >
22+
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo &&
2423
yum install -y cuda-nvcc-11-8 cuda-cudart-devel-11-8
25-
export PATH=$PATH:/usr/local/cuda-11.8/bin
26-
export CUDA_PATH=/usr/local/cuda-11.8/bin
27-
export CUDA_HOME=/usr/local/cuda-11.8
28-
export CUDA_ROOT=/usr/local/cuda-11.8
29-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.8/lib64
30-
export CUDACXX=/usr/local/cuda-11.8/bin/nvcc
3124
CIBW_ENVIRONMENT_LINUX: PATH="$PATH:/usr/local/cuda-11.8/bin" CUDA_PATH="/usr/local/cuda-11.8/bin" CUDA_HOME="/usr/local/cuda-11.8" CUDA_ROOT="/usr/local/cuda-11.8" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-11.8/lib64" CUDACXX="/usr/local/cuda-11.8/bin/nvcc"
3225
# For Windows, install CUDA
3326
CIBW_BEFORE_ALL_WINDOWS: >
3427
nuget install intelopenmp.devel.win -DirectDownload -NonInteractive &&
3528
nuget install intelopenmp.redist.win -DirectDownload -NonInteractive &&
3629
cp intelopenmp.devel.win*/build/native/win-x64/libiomp5md.lib src/deepwave &&
3730
cp intelopenmp.redist.win*/runtimes/win-x64/native/libiomp5md.dll src/deepwave &&
38-
echo "DIR" &&
39-
ls &&
40-
echo "DIR SRC" &&
41-
ls src/deepwave
31+
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 &&
32+
chmod +x ./cuda_12.4.0_windows_network.exe &&
33+
./cuda_12.4.0_windows_network.exe -s nvcc_12.4 cudart_12.4
34+
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"
4235

43-
#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
44-
#chmod +x ./cuda_12.4.0_windows_network.exe
45-
#./cuda_12.4.0_windows_network.exe -s nvcc_12.4 cudart_12.4
46-
#echo "CUDA_PATH=C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4" >> $GITHUB_ENV
47-
#echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4\\bin" >> $GITHUB_PATH
48-
#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"
36+
- uses: actions/upload-artifact@v4
37+
with:
38+
path: ./wheelhouse/*.whl
4939

50-
# - uses: actions/upload-artifact@v4
51-
# with:
52-
# path: ./wheelhouse/*.whl
40+
build_sdist:
41+
name: Build source distribution
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v5
45+
46+
- name: Build sdist
47+
run: pipx run build --sdist
5348

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

CMakeLists.txt

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,6 @@ endif()
2323
add_library(Deepwave_OpenMP_Interface INTERFACE)
2424
set(OPENMP_CONFIGURED FALSE)
2525

26-
#file(COPY_FILE ${GITHUB_WORKSPACE}/libiomp5md.lib src/deepwave/libiomp5md.lib)
27-
#file(COPY_FILE ${GITHUB_WORKSPACE}/libiomp5md.dll src/deepwave/libiomp5md.dll)
28-
29-
message(STATUS "CURRENT DIR ${CMAKE_CURRENT_SOURCE_DIR}")
30-
31-
message(STATUS "FILES IN CURRENT DIR")
32-
# List the files in the specified directory directly
33-
file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*")
34-
35-
message(STATUS "FILES IN SRC/DEEPWAVE")
36-
# List the files in the specified directory directly
37-
file(GLOB files2 "${CMAKE_CURRENT_SOURCE_DIR}/src/deepwave/*")
38-
39-
# Print the files
40-
foreach(file ${files2})
41-
message(STATUS "Found file: ${file}")
42-
endforeach()
43-
44-
message(STATUS "GITHUB_WORKSPACE ${GITHUB_WORKSPACE}")
45-
46-
message(STATUS "FILES IN GITHUB WORKSPACE")
47-
# List the files in the specified directory directly
48-
file(GLOB files3 "${GITHUB_WORKSPACE}/*")
49-
50-
# Print the files
51-
foreach(file ${files3})
52-
message(STATUS "Found file: ${file}")
53-
endforeach()
54-
5526
if(WIN32)
5627
# On Windows, prioritize the Intel OpenMP library to avoid conflicts with PyTorch.
5728
set(INTEL_OMP_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/deepwave/libiomp5md.lib")
@@ -116,17 +87,6 @@ else()
11687
message(STATUS "AVX2 is not supported.")
11788
endif()
11889

119-
# Add warning flags for GCC/Clang
120-
#add_compile_options(
121-
# $<$<C_COMPILER_ID:GNU,Clang>:-Wall>
122-
# $<$<C_COMPILER_ID:GNU,Clang>:-Wextra>
123-
# $<$<C_COMPILER_ID:GNU,Clang>:-pedantic>
124-
#)
125-
add_compile_options(
126-
$<$<C_COMPILER_ID:MSVC>:/w>
127-
)
128-
129-
13090
if(CMAKE_BUILD_TYPE MATCHES Release)
13191
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|Intel")
13292
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Ofast")
@@ -135,9 +95,9 @@ endif()
13595

13696
# Prepare lists that will collect the object files
13797
set(DEEPWAVE_OBJECTS)
138-
set(SCALAR_ACCURACIES 2)# 4 6 8)
139-
set(ELASTIC_ACCURACIES 2)# 4)
140-
set(DTYPES float)# double)
98+
set(SCALAR_ACCURACIES 2 4 6 8)
99+
set(ELASTIC_ACCURACIES 2 4)
100+
set(DTYPES float double)
141101

142102
# --- CPU object libraries ---
143103
# All CPU object libraries will link to our unified OpenMP target if it was configured.

pyproject.toml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ classifiers = [
2222
Homepage = "https://github.com/ar4/deepwave"
2323
"Bug Tracker" = "https://github.com/ar4/deepwave/issues"
2424

25-
[project.optional-dependencies]
26-
test = [
27-
"pytest",
28-
"scipy",
29-
]
30-
3125
[tool.scikit-build]
3226
wheel.py-api = "py3"
3327
cmake.version = ">=3.21"
@@ -46,16 +40,16 @@ build-verbosity = 3
4640
archs = ["auto64"]
4741

4842
# Test configuration
49-
test-requires = "pytest scipy torch"
43+
test-requires = "pytest scipy numpy torch"
5044

5145
[tool.cibuildwheel.linux]
5246
test-command = "pytest {project}/tests"
5347
# Don't bundle CUDA libraries with the wheel
5448
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"
49+
before-test = "pip install torch --index-url https://download.pytorch.org/whl/cpu"
5650

57-
#[tool.cibuildwheel.windows]
58-
#test-command = "pytest {project}/tests/test_scalar.py"
51+
[tool.cibuildwheel.windows]
52+
test-command = "pytest {project}/tests/test_scalar.py"
5953

6054
[tool.cibuildwheel.macos]
6155
test-command = "pytest {project}/tests/test_scalar.py"

0 commit comments

Comments
 (0)