refresh-bio / KMC

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

make error #166

Closed yuanw-18 closed 3 years ago

yuanw-18 commented 3 years ago

Hi!

I use make . But I meet error flowing: /usr/bin/ld: cannot find -lpthread /usr/bin/ld: cannot find -lstdc++ /usr/bin/ld: cannot find -lm /usr/bin/ld: cannot find -lc collect2: error: ld returned 1 exit status make: *** [makefile:92: kmc] Error 1

I then use the method #79 to replace some parts of makefile:

But I meet the other error: g++: error: unrecognized command line option ‘-std=c++14’ make: *** [makefile:78: kmc_tools/kmc_tools.o] Error 1

My gcc is gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)

marekkokot commented 3 years ago

Hi, maybe gcc 4.8.5 does not support c++14, which is used in kmc_tools. In fact gcc 4.8.5 is quite old and I would strongly recommend using a newer version. Anyway, if you only need KMC and not KMC tools you may use make kmc

yuanw-18 commented 3 years ago

What a pity!I want to use smudge_pairs program.

marekkokot commented 3 years ago

Well, maybe it would be possible to use just c++11, but probably some workarounds would be needed. GCC 4.8.5 is 5 years old now (https://gcc.gnu.org/releases.html) so it is pretty old.

Why don't you just use precompiled release version: https://github.com/refresh-bio/KMC/releases/tag/v3.1.1

yuanw-18 commented 3 years ago

I use the new gcc version 10.2.0 (GCC), but still has error.

mkdir -p bin g++ -lm -O3 -lpthread -std=c++14 -o bin/kmc_tools kmc_tools/kmc_header.o kmc_tools/kmc_tools.o kmc_to ols/nc_utils.o kmc_tools/parameters_parser.o kmc_tools/parser.o kmc_tools/tokenizer.o kmc_tools/fastq _filter.o kmc_tools/fastq_reader.o kmc_tools/fastq_writer.o kmc_tools/percent_progress.o kmc_api/mmer .o kmc_api/kmc_file.o kmc_api/kmer_api.o kmc_tools/libs/libz.a kmc_tools/libs/libbz2.a kmc_tools/kmc_tools.o: In function CTools<8u>::Process() [clone .isra.0]': kmc_tools.cpp:(.text+0x114f): undefined reference toCKMCFile::OpenForRA(std::cxx11::basic_string< char, std::char_traits, std::allocator > const&)' kmc_tools/kmc_tools.o: In function CTools<7u>::Process() [clone .isra.0]': kmc_tools.cpp:(.text+0x2def): undefined reference toCKMCFile::OpenForRA(std::__cxx11::basic_string< char, std::char_traits, std::allocator > const&)' kmc_tools/kmc_tools.o: In function CTools<6u>::Process() [clone .isra.0]': kmc_tools.cpp:(.text+0x4a9f): undefined reference toCKMCFile::OpenForRA(std::cxx11::basic_string< char, std::char_traits, std::allocator > const&)' kmc_tools/kmc_tools.o: In function CTools<5u>::Process() [clone .isra.0]': kmc_tools.cpp:(.text+0x66ff): undefined reference toCKMCFile::OpenForRA(std::cxx11::basic_string< char, std::char_traits, std::allocator > const&)' kmc_tools/kmc_tools.o: In function CTools<4u>::Process() [clone .isra.0]': kmc_tools.cpp:(.text+0x831f): undefined reference toCKMCFile::OpenForRA(std::__cxx11::basic_string< char, std::char_traits, std::allocator > const&)' kmc_tools/kmc_tools.o:kmc_tools.cpp:(.text+0x9eec): more undefined references to `CKMCFile::OpenForRA (std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' follow kmc_tools/parameters_parser.o: In function CParametersParser::validate_input_dbs()': parameters_parser.cpp:(.text+0x3605): undefined reference toCKMC_header::CKMC_header(std::cxx11:: basic_string<char, std::char_traits, std::allocator >)' parameters_parser.cpp:(.text+0x36de): undefined reference to CKMC_header::CKMC_header(std::__cxx11:: basic_string<char, std::char_traits<char>, std::allocator<char> >)' kmc_tools/fastq_filter.o: In functionCFastqFilter::FilterRead()': fastq_filter.cpp:(.text+0x231): undefined reference to `CKMCFile::GetCountersForRead(std::cxx11::ba sic_string<char, std::char_traits, std::allocator > const&, std::vector<unsigned int, std ::allocator >&)' kmc_tools/fastq_filter.o: In function CFastqFilter::FilterReadTrim()': fastq_filter.cpp:(.text+0x3c5): undefined reference toCKMCFile::GetCountersForRead(std::cxx11::ba sic_string<char, std::char_traits, std::allocator > const&, std::vector<unsigned int, std ::allocator >&)' kmc_tools/fastq_filter.o: In function CFastqFilter::HardMask()': fastq_filter.cpp:(.text+0x48b): undefined reference toCKMCFile::GetCountersForRead(std::__cxx11::ba sic_string<char, std::char_traits, std::allocator > const&, std::vector<unsigned int, std ::allocator >&)' kmc_tools/fastq_filter.o: In function void CFastqFilter::ProcessImpl<CFastqFilter::TrimFastaToFastaH elper>()': fastq_filter.cpp:(.text._ZN12CFastqFilter11ProcessImplINS_22TrimFastaToFastaHelperEEEvv[_ZN12CFastqFi lter11ProcessImplINS_22TrimFastaToFastaHelperEEEvv]+0x175): undefined reference toCKMCFile::GetCoun tersForRead(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, s td::vector<unsigned int, std::allocator >&)' kmc_tools/fastq_filter.o: In function void CFastqFilter::ProcessImpl<CFastqFilter::TrimFastqToFastaH elper>()': fastq_filter.cpp:(.text._ZN12CFastqFilter11ProcessImplINS_22TrimFastqToFastaHelperEEEvv[_ZN12CFastqFi lter11ProcessImplINS_22TrimFastqToFastaHelperEEEvv]+0x175): undefined reference toCKMCFile::GetCoun tersForRead(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, s td::vector<unsigned int, std::allocator >&)' kmc_tools/fastq_filter.o:fastq_filter.cpp:(.text._ZN12CFastqFilter11ProcessImplINS_22TrimFastqToFastq HelperEEEvv[_ZN12CFastqFilter11ProcessImplINS_22TrimFastqToFastqHelperEEEvv]+0x175): more undefined r eferences to `CKMCFile::GetCountersForRead(std::__cxx11::basic_string<char, std::char_traits, s td::allocator > const&, std::vector<unsigned int, std::allocator >&)' follow **collect2: error: ld returned 1 exit status make: * [makefile:103: kmc_tools] Error 1

marekkokot commented 3 years ago

Hi, not good. Are you using modifies makefile? I mean without -static and -Wl? I have just tried on my machine with gcc 10.2.0 and it compiles Maybe try first

make clean

and then

make kmc kmc_tools
yuanw-18 commented 3 years ago

I'm really sorry to bother you again. I use make clean and make,and there is no error. But

$ ./smudge_pairs ./smudge_pairs: /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by ./smudge_pairs) ./smudge_pairs: /lib64/libstdc++.so.6: versionCXXABI_1.3.8' not found (required by ./smudge_pairs) ./smudge_pairs: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./smudge_pairs)

Maybe my GCC has some errors?

marekkokot commented 3 years ago

I think it may be indeed related to GCC or to your installation process. Have you try to google this error or maybe ask smudge_pairs author. It seems the problem is not KMC related. Maybe try to rebuild smudge_pairs with your new GCC?

yuanw-18 commented 3 years ago

Thank you for your enthusiastic help! I solved the problem of gcc, and now it can run successfully. You are the most patient software developer I have ever met. Thanks again for your help.

marekkokot commented 3 years ago

:) Glad I could help.

KamilSJaron commented 3 years ago

I feel I owe here some explanations. @tbenavi1 modified @marekkokot's KMC to create a program to search all unique kmer pairs with one SNP between them - smudge_pairs: The repository is https://github.com/tbenavi1/KMC as a matter of fact, it's still a fork and it does not have Issues (@tbenavi1 is there a way to allow them? Or perhaps we could write in the forked README to post them on the smudgeplot repo). So, if you do the same steps with our fork, you should also get the smudge_pairs program.

And since I am here, I would like to second @WangYuan20190517. Thank you very much for your work @marekkokot!