isovic / racon

Ultrafast consensus module for raw de novo genome assembly of long uncorrected reads. http://genome.cshlp.org/content/early/2017/01/18/gr.214270.116 Note: This was the original repository which will no longer be officially maintained. Please use the new official repository here:
https://github.com/lbcb-sci/racon
MIT License
269 stars 49 forks source link

Racon cannot support ARM64 platform #151

Closed darmac closed 3 years ago

darmac commented 4 years ago

I found that compile racon will fail in ARM64 platform:

Run command as follow:

   tar xvf racon-v1.3.2.tar.gz
   cd racon-v1.3.2
   mkdir build
   cd build/
   cmake ../
   make

Error log as follow:

/home/xiaojun/src/racon-v1.3.2/vendor/spoa/src/simd_alignment_engine.cpp:11:14: fatal error: immintrin.h: No such file or directory
     #include <immintrin.h> // AVX2 and lower
              ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [vendor/spoa/CMakeFiles/spoa.dir/build.make:89: vendor/spoa/CMakeFiles/spoa.dir/src/simd_alignment_engine.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:364: vendor/spoa/CMakeFiles/spoa.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I think the reason is there are some difference with x86 arch and aarch64 arch. If I replace the simd_alignment_engine.cpp header file from

extern "C" {
    #include <immintrin.h> // AVX2 and lower
}

to

#include "sse2neon.h

then, it can work well.

Do racon community has any plan to support aarch64 arch now?

rvaser commented 4 years ago

Hello, can you please provide me a link for the sse2neon.h file? I'll have a look and see if a port is possible.

Best regards, Robert

darmac commented 4 years ago

Hi, the link is here: https://github.com/DLTcollab/sse2neon/blob/master/sse2neon.h

But it can't cover all of the instructions(we used an old version, and not sure for the latest version) So we added some more instructions in our version. If you need that, we can try mail the header file to you.

If you need any support from us, please let me know, thanks a lot.

rvaser commented 4 years ago

As it seems, all the sse4.1 instructions that spoa needs are included in the above header. I'll think of a way to add a separate arm build.

darmac commented 4 years ago

Got it, thanks for your help.

X-WJ commented 4 years ago

I solved it by editing this file . /project/software/racon/racon-v1.4.13/vendor/spoa/CMakeLists.txt if (spoa_optimize_for_portability) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a") elseif (spoa_optimize_for_native) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=nativa ) endif()

also edit this file copy sse2neon.h to thie dir of simd_alignment_engine.cpp where is edit simd_alignment_engine.cpp // #include // AVX2 and lower

include "sse2neon.h" //new this line

it works fine