Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation issue #24

Open
jermp opened this issue Apr 1, 2023 · 9 comments
Open

Compilation issue #24

jermp opened this issue Apr 1, 2023 · 9 comments

Comments

@jermp
Copy link

jermp commented Apr 1, 2023

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
Copy link
Collaborator

tmaklin commented Apr 2, 2023

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

@jermp
Copy link
Author

jermp commented Apr 2, 2023

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
Copy link
Collaborator

tmaklin commented Apr 2, 2023

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
Copy link
Author

jermp commented Apr 2, 2023

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
Copy link
Collaborator

tmaklin commented Apr 3, 2023

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
Copy link
Collaborator

iosfwd commented Apr 4, 2023

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
Copy link
Collaborator

jnalanko commented Apr 4, 2023

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
Copy link
Author

jermp commented Apr 4, 2023

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
Copy link
Author

jermp commented Apr 12, 2023

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants