Skip to content

Commit

Permalink
using shared linking in cufinufft
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamonDinoia committed Feb 25, 2025
1 parent 41eaca4 commit a5ba005
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_cufinufft_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
buildplat:
- [ ubuntu-22.04, manylinux_x86_64 ]
- [ windows-2019, win_amd64 ]
python: [ "cp310", "cp311", "cp312", "cp313" ] # exclude pp313t for now
python: [ "cp38", "cp39", "cp310", "cp311", "cp312", "cp313" ] # exclude pp313t for now
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_finufft_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- [ macos-13, macosx_x86_64 ]
- [ macos-14, macosx_arm64 ]
- [ windows-2019, win_amd64 ]
python: [ "cp311", "cp312", "cp313" ] # exclude pp313t for now
python: [ "cp38", "cp39", "cp310", "cp311", "cp312", "cp313" ] # exclude pp313t for now
steps:
- uses: actions/checkout@v4
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion python/cufinufft/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ input = "cufinufft/__init__.py"
# Necessary to see build output from the actual compilation
build-verbosity = 1
skip = "cp36-* cp37-* cp-38* pp37-* *-manylinux_i686 *_ppc64le *_s390x *_universal2"
config-settings = {"cmake.define.CMAKE_CUDA_ARCHITECTURES" = "50;60;70;80"}
config-settings = {"cmake.define.CMAKE_CUDA_ARCHITECTURES" = "50;60;70;80", "cmake.define.CIBUILDWHEEL" = "ON"}

[tool.cibuildwheel.linux]
manylinux-x86_64-image = "manylinux2014"
Expand Down
9 changes: 8 additions & 1 deletion src/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ set_target_properties(
PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
)

if(DEFINED CIBUILDWHEEL)
set(CUDA_LINK_TYPE Shared)
message(STATUS RUNNING FROM CIBUILDWHEEL)
else()
set(CUDA_LINK_TYPE Static)
endif()

set_target_properties(
cufinufft
PROPERTIES
Expand All @@ -79,7 +86,7 @@ set_target_properties(
CUDA_STANDARD_REQUIRED ON
WINDOWS_EXPORT_ALL_SYMBOLS ON
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
CUDA_RUNTIME_LIBRARY Static
CUDA_RUNTIME_LIBRARY ${CUDA_LINK_TYPE}
)
target_compile_features(cufinufft PRIVATE cxx_std_17)
target_compile_options(cufinufft PRIVATE ${FINUFFT_CUDA_FLAGS})
Expand Down

0 comments on commit a5ba005

Please sign in to comment.