This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 034b44cc59 [index] add libstdc++ for faiss jni build (#7237)
034b44cc59 is described below
commit 034b44cc59477d59ef25f652cd4944dc234ad537
Author: jerry <[email protected]>
AuthorDate: Mon Feb 9 13:59:43 2026 +0800
[index] add libstdc++ for faiss jni build (#7237)
---
.../paimon-faiss-jni/scripts/build-native.sh | 24 ++++++++++++++--------
.../apache/paimon/faiss/NativeLibraryLoader.java | 8 +++++---
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/paimon-faiss/paimon-faiss-jni/scripts/build-native.sh
b/paimon-faiss/paimon-faiss-jni/scripts/build-native.sh
index afea929d3d..d1ecc0f9e2 100755
--- a/paimon-faiss/paimon-faiss-jni/scripts/build-native.sh
+++ b/paimon-faiss/paimon-faiss-jni/scripts/build-native.sh
@@ -288,22 +288,27 @@ if [ "$FAT_LIB" = true ] && [ "$OS" = "Linux" ]; then
if ! find_and_bundle "libgcc_s.so*" "libgcc_s.so.1"; then
echo " Note: libgcc_s not found as shared library - likely
statically linked"
fi
-
- # 2. Quadmath (needed by gfortran)
+
+ # 2. C++ standard library (needed by FAISS/JNI)
+ if ! find_and_bundle "libstdc++.so*" "libstdc++.so.6"; then
+ echo " Note: libstdc++ not found as shared library - likely
statically linked"
+ fi
+
+ # 3. Quadmath (needed by gfortran)
if ! find_and_bundle "libquadmath.so*" "libquadmath.so.0"; then
echo " Note: libquadmath not found as shared library - likely
statically linked"
fi
- # 3. Fortran runtime (needed by OpenBLAS)
+ # 4. Fortran runtime (needed by OpenBLAS)
if ! find_and_bundle "libgfortran.so*" "libgfortran.so.3"; then
echo " Note: libgfortran not found as shared library - likely
statically linked"
fi
- # 4. OpenMP runtime
+ # 5. OpenMP runtime
if ! find_and_bundle "libgomp.so*" "libgomp.so.1"; then
echo " Note: libgomp not found as shared library - likely
statically linked"
fi
- # 5. BLAS/LAPACK
+ # 6. BLAS/LAPACK
if ! find_and_bundle "libblas.so*" "libblas.so.3"; then
echo " Note: libblas not found as shared library - likely
statically linked"
fi
@@ -311,12 +316,12 @@ if [ "$FAT_LIB" = true ] && [ "$OS" = "Linux" ]; then
echo " Note: liblapack not found as shared library - likely
statically linked"
fi
- # 6. OpenBLAS
+ # 7. OpenBLAS
if ! find_and_bundle "libopenblas*.so*" "libopenblas.so.0"; then
echo " Note: libopenblas not found as shared library - likely
statically linked"
fi
- # 7. FAISS library (may be statically linked)
+ # 8. FAISS library (may be statically linked)
if ! find_and_bundle "libfaiss.so*" "libfaiss.so"; then
echo " Note: libfaiss not found as shared library - likely
statically linked"
fi
@@ -353,7 +358,7 @@ if [ "$FAT_LIB" = true ] && [ "$OS" = "Linux" ]; then
# Skip system libraries that are universally available
case "$DEP_NAME" in
-
linux-vdso.so*|libc.so*|libm.so*|libpthread.so*|libdl.so*|librt.so*|ld-linux*|libstdc++*)
+
linux-vdso.so*|libc.so*|libm.so*|libpthread.so*|libdl.so*|librt.so*|ld-linux*)
continue
;;
esac
@@ -382,6 +387,9 @@ if [ "$FAT_LIB" = true ] && [ "$OS" = "Linux" ]; then
libgcc_s*)
bundle_lib "$DEP_PATH" "libgcc_s.so.1"
;;
+ libstdc++*)
+ bundle_lib "$DEP_PATH" "libstdc++.so.6"
+ ;;
libblas*)
bundle_lib "$DEP_PATH" "libblas.so.3"
;;
diff --git
a/paimon-faiss/paimon-faiss-jni/src/main/java/org/apache/paimon/faiss/NativeLibraryLoader.java
b/paimon-faiss/paimon-faiss-jni/src/main/java/org/apache/paimon/faiss/NativeLibraryLoader.java
index 2f6d7b1b89..82352b4595 100644
---
a/paimon-faiss/paimon-faiss-jni/src/main/java/org/apache/paimon/faiss/NativeLibraryLoader.java
+++
b/paimon-faiss/paimon-faiss-jni/src/main/java/org/apache/paimon/faiss/NativeLibraryLoader.java
@@ -61,6 +61,8 @@ public class NativeLibraryLoader {
private static final String[] DEPENDENCY_LIBRARIES = {
// GCC runtime libraries (must be loaded first as others depend on
them)
"libgcc_s.so.1",
+ // C++ standard library (needed by libfaiss and JNI)
+ "libstdc++.so.6",
// Quadmath library (needed by gfortran)
"libquadmath.so.0",
// Fortran runtime (needed by OpenBLAS)
@@ -211,7 +213,7 @@ public class NativeLibraryLoader {
String resourcePath = "/" + os + "/" + arch + "/" + depLib;
try (InputStream is =
NativeLibraryLoader.class.getResourceAsStream(resourcePath)) {
if (is == null) {
- LOG.debug("Dependency library not bundled: {}", depLib);
+ LOG.warn("Dependency library not bundled: {}", depLib);
continue;
}
@@ -235,9 +237,9 @@ public class NativeLibraryLoader {
LOG.info("Loaded bundled dependency library: {}", depLib);
} catch (UnsatisfiedLinkError e) {
// Library might already be loaded or not needed
- LOG.debug("Could not load dependency {}: {}", depLib,
e.getMessage());
+ LOG.warn("Could not load dependency {}: {}", depLib,
e.getMessage());
} catch (IOException e) {
- LOG.debug("Could not extract dependency {}: {}", depLib,
e.getMessage());
+ LOG.warn("Could not extract dependency {}: {}", depLib,
e.getMessage());
}
}
}