uni-halle / gerbil

A fast and memory-efficient k-mer counter with GPU-support
MIT License
34 stars 14 forks source link

Compile error on Ubuntu 18.04.1 LTS Server #10

Open KaiFeng007 opened 6 years ago

KaiFeng007 commented 6 years ago

Hi,

I am very happy to find this excellent tool to do k-mer statistics. However, I met some problems during compiling this software. I thought the problem might be due to newer operation system version, but I am not sure.

Please check with the following messages and do me a favor.

Thanks a lot!

Kai

Scanning dependencies of target toFasta [ 5%] Building CXX object CMakeFiles/toFasta.dir/src/gerbil/toFasta.cpp.o [ 10%] Linking CXX executable toFasta [ 10%] Built target toFasta [ 15%] Building NVCC (Device) object CMakeFiles/cuda_compile_1.dir/src/cuda_ds/cuda_compile_1_generated_CompressKernel.cu.o [ 21%] Building NVCC (Device) object CMakeFiles/cuda_compile_1.dir/src/cuda_ds/cuda_compile_1_generated_AddKernel.cu.o Scanning dependencies of target gerbil [ 26%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/Application.cpp.o In file included from /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/../cuda_ds/CountingHashTable.h:25:0, from /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/KmerCountingHashTable.h:25, from /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/GpuHasher.h:31, from /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/KmerHasher.h:28, from /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/Application.h:31, from /home/fengkai/download/gerbil/src/gerbil/Application.cpp:8: /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/../cuda_ds/CountingHashTable/_CountingHashTable.h: In instantiation of ‘cuda_ds::internal::CountingHashTable<intsPerKey, keyBufferSize>::~CountingHashTable() [with unsigned int intsPerKey = 1; long unsigned int keyBufferSize = 262144]’: /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/../cuda_ds/CountingHashTable.h:43:7: required from ‘gerbil::gpu::KmerCountingHashTable::KmerCountingHashTable(uint32_t, gerbil::SyncSwapQueueMPSC, uint32_t, std::__cxx11::string) [with unsigned int K = 9; uint32_t = unsigned int; std::cxx11::string = std::cxx11::basic_string]’ /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/GpuHasher.h:97:16: required from ‘gerbil::gpu::HasherTask::HasherTask(uint8_t, gerbil::KmerDistributer, gerbil::SyncSwapQueueMPSC, gerbil::TempFile, std::cxx11::string, uint32_t) [with unsigned int K = 9; uint8_t = unsigned char; std::cxx11::string = std::__cxx11::basic_string; uint32_t = unsigned int]’ /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/KmerHasher.h:136:26: required from ‘gerbil::KmerHasher::process_template()::<lambda()> [with unsigned int K = 9]’ /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/KmerHasher.h:120:23: required from ‘struct gerbil::KmerHasher::process_template() [with unsigned int K = 9]::<lambda()>’ /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/KmerHasher.h:120:6: required from ‘void gerbil::KmerHasher::process_template() [with unsigned int K = 9]’ /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/KmerHasher.h:539:6: required from here /home/fengkai/download/gerbil/src/gerbil/../../include/gerbil/../cuda_ds/CountingHashTable/_CountingHashTable.h:176:46: warning: throw will always call terminate() [-Wterminate]

srechner commented 6 years ago

Yes, it looks like this has to do with a stricter policy of the g++-7 compiler included in Ubuntu 18.04. I updated the CMakeLists.txt file and added some compiler flags that should eliminate this problem. Please update and try again.

KaiFeng007 commented 6 years ago

Hi, srechner,

I have updated the install code and tried twice. It worked well at the beginning, but still left one error. The compile was not completed. Any suggestions for this error? Thanks a lot!

Kai

Scanning dependencies of target toFasta [ 5%] Building CXX object CMakeFiles/toFasta.dir/src/gerbil/toFasta.cpp.o [ 10%] Linking CXX executable toFasta [ 10%] Built target toFasta [ 15%] Building NVCC (Device) object CMakeFiles/cuda_compile_1.dir/src/cuda_ds/cuda_compile_1_generated_CompressKernel.cu.o [ 21%] Building NVCC (Device) object CMakeFiles/cuda_compile_1.dir/src/cuda_ds/cuda_compile_1_generated_AddKernel.cu.o Scanning dependencies of target gerbil [ 26%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/Application.cpp.o [ 31%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/Bundle.cpp.o [ 36%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/FastFile.cpp.o [ 42%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/FastParser.cpp.o [ 47%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/FastReader.cpp.o [ 52%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/KmcWriter.cpp.o [ 57%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/KmerDistributor.cpp.o [ 63%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/SequenceSplitter.cpp.o [ 68%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/SuperReader.cpp.o [ 73%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/SuperWriter.cpp.o [ 78%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/TempFile.cpp.o [ 84%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/debug.cpp.o [ 89%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/gerbil.cpp.o [ 94%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/global.cpp.o [100%] Linking CXX executable gerbil CMakeFiles/gerbil.dir/src/gerbil/FastParser.cpp.o: In function gerbil::FastParser::nextPart(char*&, char*&, unsigned long const&)': FastParser.cpp:(.text+0x8fa): undefined reference toinflateReset2' collect2: error: ld returned 1 exit status CMakeFiles/gerbil.dir/build.make:464: recipe for target 'gerbil' failed make[2]: [gerbil] Error 1 CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/gerbil.dir/all' failed make[1]: [CMakeFiles/gerbil.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

srechner commented 6 years ago

Try removing everything in the build directory and than call cmake and make again. If it still does not compile, please give us the output of the cmake command.

KaiFeng007 commented 6 years ago

Yes, I tried but it still did not compile. The cmake command ran well and the make command still export same error as mentioned above.

This is the information when I call cmake command.

fengkai@ubuntu_r740:~/download/gerbil/build$ cmake .. -- The C compiler identification is GNU 7.3.0 -- The CXX compiler identification is GNU 7.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Boost version: 1.65.1 -- Found the following Boost libraries: -- system -- thread -- filesystem -- regex -- chrono -- date_time -- atomic -- Found BZip2: /usr/local/lib/libbz2.a (found version "1.0.6") -- Looking for BZ2_bzCompressInit -- Looking for BZ2_bzCompressInit - found -- Found ZLIB: /usr/local/lib/libz.a (found version "1.2.11") -- Found CUDA: /usr/local/cuda (found version "10.0") -- Build type: Release -- Configuring done -- Generating done -- Build files have been written to: /home/fengkai/download/gerbil/build

This is the output information of the cmake command when I try to call it again.

fengkai@ubuntu_r740:~/download/gerbil/build$cmake .. -- Boost version: 1.65.1 -- Found the following Boost libraries: -- system -- thread -- filesystem -- regex -- chrono -- date_time -- atomic -- Build type: Release -- Configuring done -- Generating done -- Build files have been written to: /home/fengkai/download/gerbil/build

srechner commented 6 years ago

It seems that CMake is preferring static libraries over shared ones at your system. However, for reasons I do not understand, the static library /usr/local/lib/libz.a does not contain all functions that are included in the associated shared library. Telling CMake to use the shared library should fix the problem. Please replace the CMakeLists.txt file in the gerbil directory by the attached one and try again.

KaiFeng007 commented 6 years ago

Now the compile works well. I have tried to use gerbil to test my sequence file. It works fine. Thanks for your help!

Kai

mhorlacher commented 4 years ago

I get the following error when calling make as well:

CMakeFiles/gerbil.dir/build.make:62: recipe for target 'CMakeFiles/gerbil.dir/src/gerbil/Application.cpp.o' failed
make[2]: *** [CMakeFiles/gerbil.dir/src/gerbil/Application.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/gerbil.dir/all' failed
make[1]: *** [CMakeFiles/gerbil.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

This is my cmake .. output:

(bioinfo) [marc.horlacher@sepp build]$ cmake ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /home/icb/marc.horlacher/miniconda3/envs/bioinfo/bin/x86_64-conda_cos6-linux-gnu-cc
-- Check for working C compiler: /home/icb/marc.horlacher/miniconda3/envs/bioinfo/bin/x86_64-conda_cos6-linux-gnu-cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/icb/marc.horlacher/miniconda3/envs/bioinfo/bin/x86_64-conda_cos6-linux-gnu-c++
-- Check for working CXX compiler: /home/icb/marc.horlacher/miniconda3/envs/bioinfo/bin/x86_64-conda_cos6-linux-gnu-c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Boost  found.
Found Boost components:
   system;thread;filesystem;regex
-- Found BZip2: /home/icb/marc.horlacher/miniconda3/envs/bioinfo/lib/libbz2.so (found version "1.0.8") 
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found ZLIB: /home/icb/marc.horlacher/miniconda3/envs/bioinfo/lib/libz.so (found version "1.2.11") 
-- Found Threads: TRUE  
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) 
-- Build type: Release
-- Configuring done
-- Generating done
-- Build files have been written to: /home/icb/marc.horlacher/software/gerbil/build

Here is the full output of make:

(bioinfo) [marc.horlacher@sepp build]$ make
Scanning dependencies of target gerbil
[  5%] Building CXX object CMakeFiles/gerbil.dir/src/gerbil/Application.cpp.o
In file included from /home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/types.h:27:0,
                 from /home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/SyncQueue.h:25,
                 from /home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/FastReader.h:26,
                 from /home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/Application.h:26,
                 from /home/icb/marc.horlacher/software/gerbil/src/gerbil/Application.cpp:8:
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:50:2: error: '__syscall_slong_t' does not name a type
  __syscall_slong_t _nsec;
  ^~~~~~~~~~~~~~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In constructor 'gerbil::StopWatch::StopWatch(clockid_t)':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:54:17: error: class 'gerbil::StopWatch' does not have any field named '_nsec'
    _mode(mode), _nsec(0), _sec(0) {
                 ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In constructor 'gerbil::StopWatch::StopWatch()':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:57:27: error: class 'gerbil::StopWatch' does not have any field named '_nsec'
    _mode(CLOCK_REALTIME), _nsec(0), _sec(0) {
                           ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In member function 'void gerbil::StopWatch::start()':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:65:3: error: '_nsec' was not declared in this scope
   _nsec = 0;
   ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:65:3: note: suggested alternative: '_sec'
   _nsec = 0;
   ^~~~~
   _sec
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In member function 'void gerbil::StopWatch::stop()':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:70:3: error: '_nsec' was not declared in this scope
   _nsec += _end.tv_nsec - _start.tv_nsec;
   ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:70:3: note: suggested alternative: '_sec'
   _nsec += _end.tv_nsec - _start.tv_nsec;
   ^~~~~
   _sec
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In member function 'void gerbil::StopWatch::hold()':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:75:3: error: '_nsec' was not declared in this scope
   _nsec += _end.tv_nsec - _start.tv_nsec;
   ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:75:3: note: suggested alternative: '_sec'
   _nsec += _end.tv_nsec - _start.tv_nsec;
   ^~~~~
   _sec
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In member function 'double gerbil::StopWatch::get_s()':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:82:27: error: '_nsec' was not declared in this scope
   return _sec + ((double) _nsec / 1000000000);
                           ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:82:27: note: suggested alternative: '_sec'
   return _sec + ((double) _nsec / 1000000000);
                           ^~~~~
                           _sec
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: At global scope:
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:100:2: error: '__syscall_slong_t' does not name a type
  __syscall_slong_t _nsec;
  ^~~~~~~~~~~~~~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In constructor 'gerbil::StackStopWatch::StackStopWatch(clockid_t)':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:105:17: error: class 'gerbil::StackStopWatch' does not have any field named '_nsec'
    _mode(mode), _nsec(0), _sec(0), _inProgress(false) {
                 ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In constructor 'gerbil::StackStopWatch::StackStopWatch()':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:108:27: error: class 'gerbil::StackStopWatch' does not have any field named '_nsec'
    _mode(CLOCK_REALTIME), _nsec(0), _sec(0), _inProgress(false) {
                           ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In member function 'void gerbil::StackStopWatch::start()':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:114:3: error: '_nsec' was not declared in this scope
   _nsec = 0;
   ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:114:3: note: suggested alternative: '_sec'
   _nsec = 0;
   ^~~~~
   _sec
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In member function 'void gerbil::StackStopWatch::stop()':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:121:3: error: '_nsec' was not declared in this scope
   _nsec += _end.tv_nsec - _start.tv_nsec;
   ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:121:3: note: suggested alternative: '_sec'
   _nsec += _end.tv_nsec - _start.tv_nsec;
   ^~~~~
   _sec
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In member function 'void gerbil::StackStopWatch::hold()':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:128:3: error: '_nsec' was not declared in this scope
   _nsec += _end.tv_nsec - _start.tv_nsec;
   ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:128:3: note: suggested alternative: '_sec'
   _nsec += _end.tv_nsec - _start.tv_nsec;
   ^~~~~
   _sec
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h: In member function 'double gerbil::StackStopWatch::get_s()':
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:136:27: error: '_nsec' was not declared in this scope
   return _sec + ((double) _nsec / 1000000000);
                           ^~~~~
/home/icb/marc.horlacher/software/gerbil/src/gerbil/../../include/gerbil/debug.h:136:27: note: suggested alternative: '_sec'
   return _sec + ((double) _nsec / 1000000000);
                           ^~~~~
                           _sec
CMakeFiles/gerbil.dir/build.make:62: recipe for target 'CMakeFiles/gerbil.dir/src/gerbil/Application.cpp.o' failed
make[2]: *** [CMakeFiles/gerbil.dir/src/gerbil/Application.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/gerbil.dir/all' failed
make[1]: *** [CMakeFiles/gerbil.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Using the attached CMakeLists.txt file did not solve my problem.

Note: I'm working in a conda environment.

Best, M.