refresh-bio / KMC

Fast and frugal disk based k-mer counter
252 stars 73 forks source link

Error Running Make #189

Closed camtelope closed 2 years ago

camtelope commented 2 years ago

Hello!

I followed the instructions, downloaded both the KMC3 file for mac and the source code, and brew installed gcc and g++. I am running into an error when I try to compile KMC3. I followed your suggestion to edit the g++ path to the one on my local, but still getting this error when I run "make" in the KMC-3.2.1 directory. Any suggestions? Thanks in advance :)

Screen Shot 2022-05-11 at 10 11 01 AM

marekkokot commented 2 years ago

Hi!

That is not good :(

Is there a reason you are not using the bioconda to install KMC? It should be the simplest way to get a running version of KMC. Also you may try to download the MAC OS precompiled binary from github releases page (https://github.com/refresh-bio/KMC/releases/tag/v3.2.1).

Anyway, I'm not sure if <ext/algorithm> is even needed. Could you try to comment that line? (Although I think it should work with this line).

Are you sure that /usr/bin/g++ is a g++ installed with brew? I'm asking because on MAC OS X there is a g++ that is clang (if I remember correctly, https://apple.stackexchange.com/questions/308830/why-does-g-version-say-llvm-clang#:~:text=In%20modern%20versions%20of%20macOS,of%20Xcode%20you%20have%20installed.), so maybe /usr/bin/g++ was there before installing with brew.

Could you try g++ --version, if it says LLVM or clang it is not the g++ compiler.

What MAC OS X version are you running (and also what hardware, because KMC currently does not work on ARM, so on M1 MAC it wouldn't work - we plan to add ARM support).

camtelope commented 2 years ago

Thank you for the fast response! Installing through Bioconda did the trick.

When I run g++ --version I get:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Additionally, I am using macOS Big Sur - version 11.5.2.

I'm now getting a weird error when I test it with a locally downloaded fasta file.

my command: kmc -k31 -m8 s_dys/fasta/GCF_000013425.1_ASM1342v1_genomic.fna.gz GCF_000013425.1_ASM1342v1_genomic test_kmc3/s_dys_out/kmc_temp error: Error: unknown exception When I run just "kmc" the usage menu pops up.

marekkokot commented 2 years ago

Oh, this error is not good (and not very informative). Fortunately, I have some guesses. If you are using fasta file you should add -fa switch, if it is multifasta (fasta where sequences are splitted into multiple lines) you should use -fm. Also assure that temp directory exists (KMC should detect if not, but now I'm not sure whats the reason, I mean it you should probably add -fm switch). If it does not help could you send me this input file and I will try to debug it.

We are planning to rebuild our input parser and get rid of such ugly error messages, but it is really hard to find a time to do that.

So your g++ is clang in reality, probably brew g++ is installed on some other location. But it is probably irrelevant since you have a working version of KMC :)

camtelope commented 2 years ago

I tried both -fm and -fa flags. All I am getting back is the usage menu Screen Shot 2022-05-12 at 4 13 39 PM ?

marekkokot commented 2 years ago

You still need to define the output pah and temp dir, like

kmc -k31 -m8 -fm s_dys/fasta/GCF_000013425.1_ASM1342v1_genomic.fna.gz GCF_000013425.1_ASM1342v1_genomic test_kmc3/s_dys_out/kmc_temp 
camtelope commented 2 years ago

Ahh I see. I thought that was optional. It worked! Thank you so much.