Skip to content

Commit

Permalink
re-enable mixing libcuspatial wheels with libcudf conda packages (#1456)
Browse files Browse the repository at this point in the history
Fixes #1455

devcontainer conda CI jobs are failing in this project because of the following mix of characteristics for thoes jobs:

* all build and runtime dependencies for `libcuspatial`, `cuspatial`, `cuproj` are installed via conda
* `libcuspatial`, `cuspatial`, and `cuproj` wheels are then built with `pip install -e --no-deps --no-build-isolation`
* `import libcuspatial` results in unconditionally running `import libcudf`
* `libcudf` is provided by the `libcudf` **conda** package, which does not have any Python modules, so that import fails

This fixes that, and restores the ability to mix a `pip install`'d `cuspatial` / `cuproj` with a `conda`-installed `libcudf`.

## Notes for Reviewers

### How did CI not catch this before?

When rapidsai/devcontainers#387 was merged, I only re-ran the **pip** devcontainers CI job on #1450.

#

Authors:
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #1456
  • Loading branch information
jameslamb authored Sep 6, 2024
1 parent 0e9d36c commit 9385e49
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 9385e49

Please sign in to comment.