From e8d19d2f74accb59e7e80b61bb684a0e9aa76344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20And=C3=A9n?= Date: Tue, 12 Dec 2023 06:23:28 -0500 Subject: [PATCH] cuda+py: fix library search in cufinufft setup Need to specify the path to the built library since the user may not have specified `LD_LIBRARY_PATH`. --- python/cufinufft/setup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/cufinufft/setup.py b/python/cufinufft/setup.py index 0f23c8f1a..0eb2fde18 100644 --- a/python/cufinufft/setup.py +++ b/python/cufinufft/setup.py @@ -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...')