Skip to content

Commit

Permalink
fixed pip build recipe for sphericart.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjbrowning committed Jan 13, 2024
1 parent 73fee55 commit e6447c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ def run(self):
"-DBUILD_SHARED_LIBS=ON",
f"-DSPHERICART_ARCH_NATIVE={SPHERICART_ARCH_NATIVE}",
]

CUDA_HOME = os.environ.get("CUDA_HOME")
if CUDA_HOME is not None:
cmake_options.append(f"-DCUDA_TOOLKIT_ROOT_DIR={CUDA_HOME}")
cmake_options.append("-DSPHERICART_ENABLE_CUDA=ON")


if sys.platform.startswith("darwin"):
cmake_options.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11.0")
Expand Down
4 changes: 2 additions & 2 deletions sphericart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ set(COMMON_SOURCES
# Find CUDA
include(CheckLanguage)
check_language(CUDA)
if(CMAKE_CUDA_COMPILER AND SPHERICART_ENABLE_CUDA)
if(CMAKE_CUDA_COMPILER)
enable_language(CUDA)
set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE BOOL "" FORCE)
else()
message(STATUS "Could not find a CUDA compiler")
endif()

if (CMAKE_CUDA_COMPILER AND NOT SPHERICART_ENABLE_CUDA)
message(STATUS "Found a CUDA compiler but SPHERICART_ENABLE_CUDA=OFF, set SPHERICART_ENABLE_CUDA=TRUE in order to compile with CUDA support.")
message(STATUS "Found a CUDA compiler but SPHERICART_ENABLE_CUDA=OFF, set SPHERICART_ENABLE_CUDA=ON in order to compile with CUDA support.")
endif()


Expand Down

0 comments on commit e6447c8

Please sign in to comment.