Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqlite-jdbc is not supported on ppc64le #452

Closed
rashmi-ibm opened this issue Sep 13, 2019 · 7 comments
Closed

Sqlite-jdbc is not supported on ppc64le #452

rashmi-ibm opened this issue Sep 13, 2019 · 7 comments

Comments

@rashmi-ibm
Copy link

Can you please point to relevant documentation on how one can add support for ppc64le.

ERROR:-
Caused by: java.lang.Exception: No native library is found for os.name=Linux and os.arch=ppc64le

	at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:328) ~[sqlite-jdbc-3.15.1.jar:?]

	at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:64) ~[sqlite-jdbc-3.15.1.jar:?]

	at org.sqlite.core.NativeDB.load(NativeDB.java:56) ~[sqlite-jdbc-3.15.1.jar:?]
@rashmi-ibm
Copy link
Author

how to generate the .so file for ppc64le ?

@despair86
Copy link

despair86 commented Apr 8, 2020

make native should work fine, just make sure to specify the correct compiler in the makefile (either of gcc, clang, or xlc)

@despair86
Copy link

this is what it took for me to do this on a sun amd64

diff --git a/Makefile.common b/Makefile.common
index 9145cb0..d7d84f1 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -57,9 +57,9 @@ endif
 # cross-compilation toolchain prefix (e.g. "arm-linux-gnueabi-")
 CROSS_PREFIX :=

-Default_CC        := $(CROSS_PREFIX)gcc
+Default_CC        := $(CROSS_PREFIX)cc
 Default_STRIP     := $(CROSS_PREFIX)strip
-Default_CCFLAGS   := -I$(JAVA_HOME)/include -Ilib/inc_linux -Os -fPIC -fvisibility=hidden
+Default_CCFLAGS   := -m64 -I$(JAVA_HOME)/include -Ilib/inc_linux -O4 -xspace -fPIC -fvisibility=hidden
 Default_LINKFLAGS := -shared
 Default_LIBNAME   := libsqlitejdbc.so
 Default_SQLITE_FLAGS  :=

@smi-giocla
Copy link

Hi all, I'm also trying to make it work on a Linux Ubuntu 20.04 on IBM Power System with sqlite-jdbc version 3.36.0.4.
What I did:

  • cloned the repository on the ppc64le machine
  • modified Makefile.common with Linux-ppc64le_* block of code for gcc

Linux-ppc64le_CC := $(CROSS_PREFIX)gcc
Linux-ppc64le_STRIP := $(CROSS_PREFIX)strip
Linux-ppc64le_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -Os -fPIC -fvisibility=hidden
Linux-ppc64le_LINKFLAGS := -shared -static-libgcc
Linux-ppc64le_LIBNAME := libsqlitejdbc.so
Linux-ppc64le_SQLITE_FLAGS :=

  • modified OSInfo.java

// IBM Power mappings
archMapping.put("ppc64le", "ppc64le");

  • on the pcc64le machine I generated a libsqlitejdbc.so with the "make" command
  • created folder "ppc64le" in sqlite-jdbc/src/main/resources/org/sqlite/native/Linux/ and copied the .so generated before
  • "make deploy" with the only porpouse to build the new jar, but get errors on step "maven-surefire-plugin:2.22.2:test" with description like

INFO] Running org.sqlite.BackupTest
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 1.916 s <<< FAILURE! - in org.sqlite.BackupTest
[ERROR] backupAndRestore Time elapsed: 1.882 s <<< ERROR!
java.lang.UnsatisfiedLinkError: org/sqlite/core/NativeDB._open_utf8([BI)V
at org.sqlite.BackupTest.backupAndRestore(BackupTest.java:32)

  • moved local repo to a Ubuntu 20.04 x86_64, "make deploy" again with step "maven-jar-plugin:3.2.0:jar" ok (so it generated the new jar) with an expection error on step "maven-gpg-plugin:1.6:sign" with "No secret key" (it doesn't matter)
  • used the new jar as a dependency on test java project

....
connection = DriverManager.getConnection("jdbc:sqlite:sample.db", config.toProperties());
final Statement statement = connection.createStatement();
....

  • on the x86_64 machine test ok with no error
  • on the ppc64le gets the error

Exception in thread "main" java.lang.UnsatisfiedLinkError: org/sqlite/core/NativeDB._open_utf8([BI)V
at org.sqlite.core.NativeDB._open(NativeDB.java:72)
at org.sqlite.core.DB.open(DB.java:211)
at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:271)
at org.sqlite.SQLiteConnection.(SQLiteConnection.java:66)
at org.sqlite.jdbc3.JDBC3Connection.(JDBC3Connection.java:23)
at org.sqlite.jdbc4.JDBC4Connection.(JDBC4Connection.java:19)
at org.sqlite.JDBC.createConnection(JDBC.java:120)
at org.sqlite.JDBC.connect(JDBC.java:90)
at java.sql.DriverManager.getConnection(DriverManager.java:675)
at java.sql.DriverManager.getConnection(DriverManager.java:219)
at it.smi.test.Dummy.main(Dummy.java:26)

Can you help me understand what I'm missing?
thanks

@gotson
Copy link
Collaborator

gotson commented Dec 2, 2021

shouldn't it be archMapping.put("ppc64le", PPC64); in OSInfo.java ?

@smi-giocla
Copy link

You are right @gotson. After this change the library works correctly even on ppc64le enviroment.
Thanks.

@gotson
Copy link
Collaborator

gotson commented Jul 28, 2022

Closing as duplicate of #450

@gotson gotson closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants