abra2 icon indicating copy to clipboard operation
abra2 copied to clipboard

v2.24 gives "Error loading: libAbra.so", older versions do not

Open chrisamiller opened this issue 2 years ago • 7 comments

On a Ubuntu base image, if I try to use the precompiled abra2-2.24.jar, using command:

java -jar abra2-2.24.jar --in input.bam --out out.abra.bam --ref reference.fa --threads 2 --tmpdir /tmp

I get the following error:

ERROR   Tue Sep 14 23:20:22 CDT 2021    Error loading: libAbra.so from : /tmp/abra2_e0d4e0c6-313a-4445-bb03-44d341dd5c338049499640746259132
java.lang.RuntimeException: Unable to load library: libAbra.so from path [/libAbra.so] into tempdir: [/tmp/abra2_e0d4e0c6-313a-4445-bb03-44d341dd5c33804949964
0746259132]
        at abra.NativeLibraryLoader.load(NativeLibraryLoader.java:50)
        at abra.ReAligner.init(ReAligner.java:1627)
        at abra.ReAligner.reAlign(ReAligner.java:163)
        at abra.ReAligner.run(ReAligner.java:1810)
        at abra.Abra.main(Abra.java:12)
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable to load library: libAbra.so from path [/libAbra.so] into tempdir: [/
tmp/abra2_e0d4e0c6-313a-4445-bb03-44d341dd5c338049499640746259132]
        at abra.NativeLibraryLoader.load(NativeLibraryLoader.java:57)
        at abra.ReAligner.init(ReAligner.java:1627)
        at abra.ReAligner.reAlign(ReAligner.java:163)
        at abra.ReAligner.run(ReAligner.java:1810)
        at abra.Abra.main(Abra.java:12)
Caused by: java.lang.RuntimeException: Unable to load library: libAbra.so from path [/libAbra.so] into tempdir: [/tmp/abra2_e0d4e0c6-313a-4445-bb03-44d341dd5c
338049499640746259132]
        at abra.NativeLibraryLoader.load(NativeLibraryLoader.java:50)
        ... 4 more

If I fall back to an older release abra2-2.19.jar, the identical command works just fine, which leads me to suspect something may be wrong with the latest release.

chrisamiller avatar Sep 15 '21 04:09 chrisamiller

I encountered the same issue, and v2.19 also worked for me.

milkschen avatar Dec 11 '21 01:12 milkschen

Same experience here. v2.23 works, so it's just the latest version.

eboyden avatar Dec 12 '21 18:12 eboyden

Similar experience to @eboyden. v2.23 works.

roysomak4 avatar Mar 03 '22 20:03 roysomak4

v2.23 works, current version gives this error

sanderdebacker avatar Mar 29 '22 09:03 sanderdebacker

#metoo v2.23 works, v2.23 current version gives this error

myourshaw avatar Jun 13 '22 17:06 myourshaw

I think the reason is that the libAbra.so is missing in the jar file. It was there in v 2.23.

marc-sturm avatar Jul 19 '22 14:07 marc-sturm

It appears that the compilation is bad. When I attempted to compile from source, it threw this error, which suggests that libAbra.so isn't created:

g++ -g -O2 -Isrc/main/c -I/include -I/include/linux -shared -fPIC src/main/c/assembler.cpp src/main/c/sg_aligner.cpp -o target/libAbra.so
In file included from src/main/c/assembler.cpp:16:0:
src/main/c/abra_NativeAssembler.h:2:17: fatal error: jni.h: No such file or directory
 #include <jni.h>
                 ^
compilation terminated.
In file included from src/main/c/sg_aligner.cpp:5:0:
src/main/c/abra_NativeSemiGlobalAligner.h:2:17: fatal error: jni.h: No such file or directory
 #include <jni.h>
                 ^
compilation terminated.
make: *** [native] Error 1

jni.h is a Java file in the include directory; the Makefile attempts to point to this directory using the $JAVA_HOME variable. But make fails if this variable isn't properly set, which it wasn't on my system. To find the java home folder do this:

(base) [user@home]$ mvn -version
Apache Maven 3.0.5 (Red Hat 3.0.5-17)
Maven home: /usr/share/maven
Java version: 1.8.0_191, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-957.1.3.el7.x86_64", arch: "amd64", family: "unix"

So this worked for me, and resulted in a successful build of 2.24:

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64 #Do not include /jre
make
cd ..
ln -s abra2-2.24/target/abra2-2.24-jar-with-dependencies.jar abra2-2.24.jar

May also be relevant to https://github.com/mozack/abra2/issues/57

eboyden avatar Feb 16 '24 16:02 eboyden