DecodeGenetics / graphtyper

Population-scale genotyping using pangenome graphs
http://dx.doi.org/10.1038/ng.3964
MIT License
167 stars 20 forks source link

cmake error #14

Closed yangxiaofeill closed 5 years ago

yangxiaofeill commented 5 years ago

Hi, I try to cmake grapthtyper, however, it is failed. Following is the cmake messages. I have installed the lz4 library.

cmake ../
-- Build type:
-- Building in release mode.
-- CXX flags are: -Wall -Wextra -Wfatal-errors -pedantic -Wno-variadic-macros -std=c++11 -DSEQAN_HAS_ZLIB=1 -DSEQAN_USE_HTSLIB=1 -DSEQAN_ENABLE_TESTING=0 -O3 -DNDEBUG -DSEQAN_ENABLE_DEBUG=0 -march=core2 -mtune=generic
-- Checking for zlib
-- Checking for bzip2
-- Checking for Boost
CMake Warning at /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
  Imported targets and dependency information not available for Boost version
  (all versions older than 1.33)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:907 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:1542 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:94 (find_package)

CMake Warning at /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
  Imported targets and dependency information not available for Boost version
  (all versions older than 1.33)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:907 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:1542 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:94 (find_package)

CMake Warning at /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
  Imported targets and dependency information not available for Boost version
  (all versions older than 1.33)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:907 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:1542 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:94 (find_package)

CMake Warning at /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
  Imported targets and dependency information not available for Boost version
  (all versions older than 1.33)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:907 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:1542 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:94 (find_package)

CMake Warning at /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
  Imported targets and dependency information not available for Boost version
  (all versions older than 1.33)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:907 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:1542 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:94 (find_package)

CMake Warning at /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
  Imported targets and dependency information not available for Boost version
  (all versions older than 1.33)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:907 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:1542 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:94 (find_package)

CMake Error at /usr/local/share/cmake-3.10/Modules/FindBoost.cmake:1928 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  CMakeLists.txt:94 (find_package)

-- snappy target location is /home/xfyang/software/graphtyper/snappy/.libs/libsnappy.a
-- htslib target location is /home/xfyang/software/graphtyper/htslib/libhts.a
-- StatGen target location is /home/xfyang/software/graphtyper/statgen/libStatGen.a
-- Using GCC
-- Could NOT find LZ4 (missing: LZ4_GOOD_VERSION)
-- Using third-party bundled LZ4
-- ZSTD: /usr/local/include
-- Libraries: rocksdb;snappy;htslib;statgen;-lpthread;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libbz2.so;rt;/usr/lib/x86_64-linux-gnu/liblzma.so;/usr/local/lib/libzstd.so
-- Compiling graphtyper's source files
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper
   used as include directory in directory /home/xfyang/software/graphtyper/src
   used as include directory in directory /home/xfyang/software/graphtyper/src
   used as include directory in directory /home/xfyang/software/graphtyper/src
   used as include directory in directory /home/xfyang/software/graphtyper/src
   used as include directory in directory /home/xfyang/software/graphtyper/src
   used as include directory in directory /home/xfyang/software/graphtyper/src
   used as include directory in directory /home/xfyang/software/graphtyper/src
   used as include directory in directory /home/xfyang/software/graphtyper/src
   used as include directory in directory /home/xfyang/software/graphtyper/src
   used as include directory in directory /home/xfyang/software/graphtyper/src
   used as include directory in directory /home/xfyang/software/graphtyper/test
   used as include directory in directory /home/xfyang/software/graphtyper/test
   used as include directory in directory /home/xfyang/software/graphtyper/test
   used as include directory in directory /home/xfyang/software/graphtyper/test
   used as include directory in directory /home/xfyang/software/graphtyper/test
   used as include directory in directory /home/xfyang/software/graphtyper/test
   used as include directory in directory /home/xfyang/software/graphtyper/test
   used as include directory in directory /home/xfyang/software/graphtyper/test
   used as include directory in directory /home/xfyang/software/graphtyper/test/graph
   used as include directory in directory /home/xfyang/software/graphtyper/test/graph
   used as include directory in directory /home/xfyang/software/graphtyper/test/graph
   used as include directory in directory /home/xfyang/software/graphtyper/test/graph
   used as include directory in directory /home/xfyang/software/graphtyper/test/graph
   used as include directory in directory /home/xfyang/software/graphtyper/test/graph
   used as include directory in directory /home/xfyang/software/graphtyper/test/graph
   used as include directory in directory /home/xfyang/software/graphtyper/test/graph
   used as include directory in directory /home/xfyang/software/graphtyper/test/index
   used as include directory in directory /home/xfyang/software/graphtyper/test/index
   used as include directory in directory /home/xfyang/software/graphtyper/test/index
   used as include directory in directory /home/xfyang/software/graphtyper/test/index
   used as include directory in directory /home/xfyang/software/graphtyper/test/index
   used as include directory in directory /home/xfyang/software/graphtyper/test/index
   used as include directory in directory /home/xfyang/software/graphtyper/test/index
   used as include directory in directory /home/xfyang/software/graphtyper/test/index
   used as include directory in directory /home/xfyang/software/graphtyper/test/typer
   used as include directory in directory /home/xfyang/software/graphtyper/test/typer
   used as include directory in directory /home/xfyang/software/graphtyper/test/typer
   used as include directory in directory /home/xfyang/software/graphtyper/test/typer
   used as include directory in directory /home/xfyang/software/graphtyper/test/typer
   used as include directory in directory /home/xfyang/software/graphtyper/test/typer
   used as include directory in directory /home/xfyang/software/graphtyper/test/typer
   used as include directory in directory /home/xfyang/software/graphtyper/test/typer
   used as include directory in directory /home/xfyang/software/graphtyper/test/utilities
   used as include directory in directory /home/xfyang/software/graphtyper/test/utilities
   used as include directory in directory /home/xfyang/software/graphtyper/test/utilities
   used as include directory in directory /home/xfyang/software/graphtyper/test/utilities
   used as include directory in directory /home/xfyang/software/graphtyper/test/utilities
   used as include directory in directory /home/xfyang/software/graphtyper/test/utilities
   used as include directory in directory /home/xfyang/software/graphtyper/test/utilities
   used as include directory in directory /home/xfyang/software/graphtyper/test/utilities

-- Configuring incomplete, errors occurred!
See also "/home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeOutput.log".
See also "/home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeError.log".

Following is the CMakeError.log

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_38143/fast"
/usr/bin/make -f CMakeFiles/cmTC_38143.dir/build.make CMakeFiles/cmTC_38143.dir/build
make[1]: Entering directory `/home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_38143.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_38143.dir/CheckSymbolExists.c.o   -c /home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_38143
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_38143.dir/link.txt --verbose=1
/usr/bin/cc      -rdynamic CMakeFiles/cmTC_38143.dir/CheckSymbolExists.c.o  -o cmTC_38143
CMakeFiles/cmTC_38143.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [cmTC_38143] Error 1
make[1]: Leaving directory `/home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp'
make: *** [cmTC_38143/fast] Error 2

File /home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_d3e66/fast"
/usr/bin/make -f CMakeFiles/cmTC_d3e66.dir/build.make CMakeFiles/cmTC_d3e66.dir/build
make[1]: Entering directory `/home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_d3e66.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_d3e66.dir/CheckFunctionExists.c.o   -c /usr/local/share/cmake-3.10/Modules/CheckFunctionExists.c
Linking C executable cmTC_d3e66
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d3e66.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_d3e66.dir/CheckFunctionExists.c.o  -o cmTC_d3e66 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [cmTC_d3e66] Error 1
make[1]: Leaving directory `/home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp'
make: *** [cmTC_d3e66/fast] Error 2

Performing C SOURCE FILE Test LZ4_GOOD_VERSION failed with the following output:
Change Dir: /home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_5db01/fast"
/usr/bin/make -f CMakeFiles/cmTC_5db01.dir/build.make CMakeFiles/cmTC_5db01.dir/build
make[1]: Entering directory `/home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_5db01.dir/src.c.o
/usr/bin/cc   -DLZ4_GOOD_VERSION   -o CMakeFiles/cmTC_5db01.dir/src.c.o   -c /home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_5db01
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5db01.dir/link.txt --verbose=1
/usr/bin/cc  -DLZ4_GOOD_VERSION    -rdynamic CMakeFiles/cmTC_5db01.dir/src.c.o  -o cmTC_5db01 /usr/lib/x86_64-linux-gnu/liblz4.so
make[1]: Leaving directory `/home/xfyang/software/graphtyper/release-build/CMakeFiles/CMakeTmp'

Return value: 1
Source file was:

#include <lz4.h>
int main() {
  int good = (LZ4_VERSION_MAJOR > 1) ||
    ((LZ4_VERSION_MAJOR == 1) && (LZ4_VERSION_MINOR >= 7));
return !good;
}

The cmake version is cmake version 3.10.0-rc5, and system is 14.04.1-Ubuntu SMP Mon Apr 16 18:40:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I don't know how to solve these problems, could you please help me to solve it.

Thanks

hannespetur commented 5 years ago

Hello,

CMake seems to have problems finding the BOOST library. Can you make sure it is installed in its location defined by the BOOST_ROOT environment variable?

All the best, Hannes