To build bam-readcount, I cloned the bam-readcount repository, made a separate build directory, and from it entered cmake <repository dir>
, resulting in the following output and errors:
-- The C compiler identification is GNU 4.1.2
-- The CXX compiler identification is GNU 4.1.2
-- 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
CMake Error at build-common/cmake/VersionHelper.cmake:9 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:15 (include)
CMake Error at build-common/cmake/VersionHelper.cmake:10 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:15 (include)
CMake Error at build-common/cmake/VersionHelper.cmake:11 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:15 (include)
CMake Error at build-common/cmake/VersionHelper.cmake:14 (if):
if given arguments:
"STREQUAL" "-unstable"
Unknown arguments specified
Call Stack (most recent call first):
CMakeLists.txt:15 (include)
-- Configuring incomplete, errors occurred!
See also "/local/scratch/PACKAGES/src/bam-readcount/14Apr2016/build_directory/CMakeFiles/CMakeOutput.log".
See also "/local/scratch/PACKAGES/src/bam-readcount/14Apr2016/build_directory/CMakeFiles/CMakeError.log".
Checking CMakeError.log, it shows two errors:
CheckSymbolExists.c:(.text+0x18): undefined reference to `pthread_create'
and
/usr/bin/ld: cannot find -lpthreads
CMakeOutput.log didn't seem to have any errors in it.
Suggestions?
Which OS? I am guessing MacOSX, as I've vaguely remember reading a few years ago its implementation of pthreads was broken. Or maybe your GCC is too old. And did you try something like:
or