ogotoh / spaln

Genome mapping and spliced alignment of cDNA or amino acid sequences
GNU General Public License v2.0
96 stars 16 forks source link

building with g++ and -march=native fails because of missing header files like fwd2s1_simd.h #56

Open boegel opened 2 years ago

boegel commented 2 years ago

I'm trying to build spaln v2.4.12 with GCC 10.2 and using "-O2 -march=native" as compiler options.

This fails with:

g++ -O2 -ftree-vectorize -march=native -fno-math-errno -Wall -DM_THREAD=1 -DUSE_ZLIB=1 -c fwd2b1.cc
fwd2b1.cc:32:10: fatal error: fwd2s1_simd.h: No such file or directory
   32 | #include "fwd2s1_simd.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:30: fwd2b1.o] Error 1

Is the fwd2s1_simd.h supposed to be available in the codebase?

ogotoh commented 2 years ago

Dear boegel,

Sorry, the simd version is now under a final stage of test. At present, please compile without the -march option.

Osamu,

ogotoh commented 1 year ago

Dear boegel,

I have just uploaded new version of spaln ver3.0.0. At long last, this version supports vectorized computation. -march=native command line option at the compilation will automatically choose simd instructions for SSE4.2/AVX, AVX2, or AVX512 according to your system. For spaln to use the vectorized functions, -A[1-3] option is needed as a command line option. Without this option or with -A0 option, the conventional scalar-based functions will be called. In general, the computational speed is A3 > A2 > A1 > A0, but alignment accuracy is in the reverse order. This is because A0 considers most precisely the non-linear intron-length-dependent penalty score, whereas A3 treats it as a constant, and A1 and A2 adopt intermediate approximations.

Osamu,