algbio / themisto

Space-efficient pseudoalignment with a colored de Bruijn graph
GNU General Public License v2.0
50 stars 4 forks source link

Compilation issue #24

Open jermp opened 1 year ago

jermp commented 1 year ago

Hi @jnalanko and thank you for this tool!

I'm running into some compilation issue after following the instructions. I'm compiling on Ubuntu 21.10 with gcc version 11.2.0.

make[2]: *** No rule to make target 'external/bzip2/libbz2.a', needed by 'bin/themisto'.  Stop.                                                                                   
make[1]: *** [CMakeFiles/Makefile2:444: CMakeFiles/themisto.dir/all] Error 2                                                                                                      
make: *** [Makefile:171: all] Error 2 

I've tried to re-run make as suggested with no luck. I've also tried the pre-compiled for Linux but it fails with:

Sorting KMC database
in1: 0% Illegal instruction (core dumped)

Any help appreciated!

tmaklin commented 1 year ago

Hi, can please provide the cmake command you used? In particular did you run cmake with the -DCMAKE_BUILD_BZIP2=1 option?

jermp commented 1 year ago

Hi, yes, I've followed the recommendations in the readme:

cmake .. -DMAX_KMER_LENGTH=31 -DCMAKE_BUILD_ZLIB=1 -DCMAKE_BUILD_BZIP2=1
make

Thanks!

tmaklin commented 1 year ago

thanks! Can you try compiling with the following commands:

cmake .. -DMAX_KMER_LENGTH=31
make

or if that gives an error related to zlib then

cmake .. -DMAX_KMER_LENGTH=31 -DCMAKE_BUILD_BZIP2=1
make
jermp commented 1 year ago

I tried both versions but always got

make[2]: *** No rule to make target 'external/bzip2/libbz2.a', needed by 'bin/themisto'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:444: CMakeFiles/themisto.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
tmaklin commented 1 year ago

Looks like we need to have a look at the cmake file. Thanks for the report, we'll try to fix this soon.

The invalid instruction error is probably related to the AVX instructions that KMC uses and are enabled in the precompiled binary. We'll see about providing a binary with generic instructions although this would come at a significant runtime cost.

iosfwd commented 1 year ago

CMake caches variable values so you could try to run: cmake .. -DMAX_KMER_LENGTH=31 -DCMAKE_BUILD_ZLIB=0 -DCMAKE_BUILD_BZIP2=0 or clone the repository again and run: cmake .. -DMAX_KMER_LENGTH=31

jnalanko commented 1 year ago

Hi,

We found that the SBWT library was accidentally compiled with -march=native in the release, which might have caused your problem with unknown instructions. Also, apparently KMC falls back to generic instructions during runtime, so KMC should be ok. I recompiled the Themisto binary without -march=native. This binary also has some performance optimizations that are not in the 3.0 release. It's attached here. Could you try if this works? If so, we'll make this the 3.1 release.

themisto.zip

jermp commented 1 year ago

CMake caches variable values so you could try to run: cmake .. -DMAX_KMER_LENGTH=31 -DCMAKE_BUILD_ZLIB=0 -DCMAKE_BUILD_BZIP2=0 or clone the repository again and run: cmake .. -DMAX_KMER_LENGTH=31

This cmake .. -DMAX_KMER_LENGTH=31 -DCMAKE_BUILD_ZLIB=0 -DCMAKE_BUILD_BZIP2=0 actually worked! Thank you.

Best, -Giulio

jermp commented 1 year ago

Hi,

We found that the SBWT library was accidentally compiled with -march=native in the release, which might have caused your problem with unknown instructions. Also, apparently KMC falls back to generic instructions during runtime, so KMC should be ok. I recompiled the Themisto binary without -march=native. This binary also has some performance optimizations that are not in the 3.0 release. It's attached here. Could you try if this works? If so, we'll make this the 3.1 release.

themisto.zip

The binary you attached worked for me, thanks Jarno.

Instead, while I was able to compile the codebase as said in the previous message, I still got the error with the "invalid instruction".