Skip to content

FASTA file processing fails on Apple Silicon (arm64) due to incompatible libbwajni.jnilib #2

@allyssonallan

Description

@allyssonallan

Issue: FASTA file processing fails on Apple Silicon (arm64) Macs due to incompatible native library

Description

When uploading FASTA files to Haplogrep 3 on an Apple Silicon (arm64) Mac, the processing hangs indefinitely with "Analyzing data..." and never completes. This is due to an UnsatisfiedLinkError when loading the native BWA JNI library libbwajni.jnilib, which is compiled for x86_64 architecture.

VCF files work fine, but FASTA requires alignment via BWA, triggering the error.

Environment

  • OS: macOS (Apple Silicon, arm64)
  • Java: OpenJDK 21 (or version used)
  • Haplogrep Version: 3.2.2
  • Architecture: arm64

Steps to Reproduce

  1. Build and run Haplogrep 3 server on an arm64 Mac.
  2. Upload a FASTA file (e.g., small test file like H100.fasta).
  3. Observe that the job status remains "RUNNING" and never completes.

Expected Behavior

FASTA files should process successfully, just like VCF files.

Actual Behavior

Job hangs; error in logs:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /path/to/jbwa-data/libbwajni.jnilib: dlopen(/path/to/jbwa-data/libbwajni.jnilib, 0x0001): tried: '/path/to/jbwa-data/libbwajni.jnilib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

Root Cause

The libbwajni.jnilib in jbwa-data/ is x86_64-only. Apple Silicon Macs need an arm64 version.

Suggested Fix

  • Provide an arm64-compatible libbwajni.jnilib (or universal binary).
  • Alternatively, allow skipping BWA alignment for FASTA if not required, or use a cross-platform alternative.

Additional Context

  • VCF uploads work without issues.
  • Tested with small FASTA files; issue occurs immediately on upload.
  • Related to BWA JNI dependency for FASTA input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions