Skip to content

Commit

Permalink
cuda+py: fix library search in cufinufft setup
Browse files Browse the repository at this point in the history
Need to specify the path to the built library since the user may not
have specified `LD_LIBRARY_PATH`.
  • Loading branch information
janden committed Dec 18, 2023
1 parent 6d46a1e commit e8d19d2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/cufinufft/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@
if cufinufft_dir == None or cufinufft_dir == '':
cufinufft_dir = Path(__file__).resolve().parents[2]

include_dir = os.path.join(cufinufft_dir, "include")
library_dir = os.path.join(cufinufft_dir, "build")

# Sanity check that we can find the CUDA cufinufft libraries before we get too far.
try:
lib = ctypes.cdll.LoadLibrary('libcufinufft.so')
lib = ctypes.cdll.LoadLibrary(os.path.join(library_dir, 'libcufinufft.so'))
except Exception as e:
print('CUDA shared libraries not found in library path.'
' Please refer to installation documentation at http://github.com/flatironinstitute/cufinufft'
' and ensure CUDA installation is successful first before attempting to install the Python wrappers.')
' Please refer to installation documentation at '
'https://finufft.readthedocs.io/en/latest/install_gpu.html '
' and ensure CUDA installation is successful first before '
'attempting to install the Python wrappers.')
raise(e)
print('cufinufft CUDA shared libraries found, continuing...')

Expand Down

0 comments on commit e8d19d2

Please sign in to comment.