PapenfussLab / gridss

GRIDSS: the Genomic Rearrangement IDentification Software Suite
Other
258 stars 71 forks source link

Feature request: Add support for Linux ARM64 #592

Open martin-g opened 2 years ago

martin-g commented 2 years ago

Hello,

I'd like to request adding support for Linux ARM64 to gridss.

I've found two minor issues so far:

1) https://hub.docker.com/r/gridss/gridss/tags currently supports only linux/amd64. Adding support for linux/arm64 should be easy by using docker/setup-qemu-action@v1 Github action. I could provide a PR for this if desired!

2) 4 unit tests fail at the moment:


Failed tests: 
  SswJniAlignerTest>SmithWatermanAlignerTest.should_align_deletion:15->SmithWatermanAlignerTest.create:11->create:8
  SswJniAlignerTest>SmithWatermanAlignerTest.should_use_soft_clips:29->SmithWatermanAlignerTest.create:11->create:8
  SswJniAlignerTest>SmithWatermanAlignerTest.should_use_zero_based_reference_offset:23->SmithWatermanAlignerTest.create:11->create:8
  MathUtilTest.phredOr_should_minimise_error:16 expected:<2.7371665643157472> but was:<2.737166564315747>

2.1) Currently https://github.com/PapenfussLab/gridss/blob/master/src/main/resources/libsswjni.so is x86_64 only:

$ file src/main/resources/libsswjni.so
src/main/resources/libsswjni.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=5c830dd0468d0db783ed5c84bbf97f56d1b075b5, with debug_info, not stripped

So my workaround is:

diff --git src/test/java/au/edu/wehi/idsv/alignment/SswJniAlignerTest.java src/test/java/au/edu/wehi/idsv/alignment/SswJniAlignerTest.java
index 3931e64f..44e5fc11 100644
--- src/test/java/au/edu/wehi/idsv/alignment/SswJniAlignerTest.java
+++ src/test/java/au/edu/wehi/idsv/alignment/SswJniAlignerTest.java
@@ -1,11 +1,11 @@
 package au.edu.wehi.idsv.alignment;

-import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;

 public class SswJniAlignerTest extends SmithWatermanAlignerTest {
     @Override
     protected Aligner create(int match, int mismatch, int ambiguous, int gapOpen, int gapExtend) {
-        assertTrue(AlignerFactory.isSswjniLoaded());
+        assumeTrue(AlignerFactory.isSswjniLoaded());
         return new SswJniAligner(match, mismatch, ambiguous, gapOpen, gapExtend);
     }
-}
\ No newline at end of file
+}

2.2) I haven't investigated why MathUtil.java produces a different result on ARM64.

d-cameron commented 2 years ago

Due to the x64 dependences in 3rd party libraries, there are currently no plans for ARM64 docker support.

All 3rd party x64 libraries used should have native Java fallbacks. In practice, the lack of acceleration means that GRIDSS is going to run slower on ARM.

martin-g commented 2 years ago

Thanks for the answer, @d-cameron !

I will take a look at the 3rd party deps for the Docker image and I'll see what could be done for them!