Skip to content

Commit

Permalink
fix usage of libcuspatial wheels with libcudf conda packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Sep 5, 2024
1 parent 0e9d36c commit 7459a76
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions python/libcuspatial/libcuspatial/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,22 @@
import ctypes
import os

import libcudf


def load_library():
# libcudf must be loaded before libcuspatial because libcuspatial
# references its symbols
libcudf.load_library()
try:
# libcudf must be loaded before libcuspatial because libcuspatial
# references its symbols
import libcudf
libcudf.load_library()
except ModuleNotFoundError:
# 'libcuspatial' has a runtime dependency on 'libcudf'. However,
# that dependency might be satisfied by the 'libcudf' conda package
# (which does not have any Python modules), instead of the
# 'libcudf' wheel.
#
# In that situation, assume that 'libcudf.so' is in a place where
# the loader can find it.
pass

# Dynamically load libcuspatial.so. Prefer a system library if one is
# present to avoid clobbering symbols that other packages might expect,
Expand Down

0 comments on commit 7459a76

Please sign in to comment.