NVIDIA / NVIDIA/cudf

[BUG] Static cudf-java Maven JARs fail to load: missing libspdlog.so.1.17

Open
#23,575 0 comments 0 reactions 1 assignee Claimed by @paul-aiyedun View on GitHub
bug Java
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Describe the bug**

After [#23456](https://github.com/rapidsai/cudf/pull/23456) (`4a902a20dd`), classifier JARs built with `CUDF_JNI_LIBCUDF_STATIC=ON` produce a fat `libcudf.so` whose ELF `DT_NEEDED` includes **`libspdlog.so.1.17`** (and may also require `libfmt`). Those libraries are not packaged in the JAR.

Loading natives fails with:

```text
java.lang.UnsatisfiedLinkError: .../libcudf.so: libspdlog.so.1.17: cannot open shared object file: No such file or directory
```

Before that commit, the same static JNI packaging path did not leave a `libspdlog` runtime dependency on the shipped `libcudf.so`.

**Steps/Code to reproduce bug**

1. Build a static classifier JAR using the existing Java packaging flow, either:
- `java/ci/build_static_libcudf.sh` then `java/ci/build_cudf_java_jar.sh`, or
- the legacy in-container path `java/ci/build-in-docker.sh`
(both use `BUILD_SHARED_LIBS=OFF` for libcudf and `CUDF_JNI_LIBCUDF_STATIC=ON` for the JAR).
2. Compile and run with the classifier JAR and slf4j on the classpath (no extra native library path):

```java
import ai.rapids.cudf.ColumnVector;

public class Repro {
public static void main(String[] args) {
try (ColumnVector v = ColumnVector.fromInts(1, 2, 3)) {
System.out.println(v.getRowCount());
}
}
}
```

3. Observe `UnsatisfiedLinkError` for `libspdlog.so.1.17` while loading `libcudf.so`.

**Expected behavior**

The fat `libcudf.so` inside the Maven classifier JAR should load with only the cudf JAR (and slf4j as documented) plus a compatible CUDA runtime, without requiring separately installed `libspdlog` / `libfmt`.

**Environment overview (please complete the following information)**

- Environment location: Docker (NVIDIA CUDA runtime image + OpenJDK), bare-metal host with NVIDIA Container Toolkit
- Method of cuDF install: cudf-java classifier JAR from the static libcudf packaging path (`BUILD_SHARED_LIBS=OFF` + `CUDF_JNI_LIBCUDF_STATIC=ON`)

**Environment details**

Not applicable.

**Additional context**

Introduced by the explicit spdlog link logic in [#23456](https://github.com/rapidsai/cudf/pull/23456): `WHOLE_ARCHIVE` applies only when `BUILD_SHARED_LIBS=ON`. The Java static path builds `libcudf.a` with `BUILD_SHARED_LIBS=OFF`, then WHOLE-archives it into the JNI shared `libcudf.so`, so spdlog/fmt remain unresolved shared runtime dependencies on the shipped library.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.