pezmaster31/bamtools

problem compiling bamtools with CMAKE 3.15.3

guptapa opened this issue · 3 comments

I have updated version of cmake (3.15.3) on cluster and bamtools in my local directory.

I tried command:
cd /../bamtools/ mkdir build cd build cmake .. make

error: The source directory "/../bamtools/build/make" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.

I set the path for bamtools using export in bash.

Also tried this one within /../bamtools/build/ directory:
cmake -DCMAKE_INSTALL_PREFIX=/../bamtools/bin/

error: The source directory "/../bamtools/build" does not appear to contain CMakeLists.txt.

Another command:
cmake -DCMAKE_INSTALL_PREFIX=/../bamtools/bin/

error: CMake Error at CMakeLists.txt:9 (cmake_minimum_required): CMake 3.0 or higher is required. You are running version 2.8.11

mr-c commented

Hello @guptapa

Are you following the directions at https://github.com/pezmaster31/bamtools/wiki/Building-and-installing#build-bamtools?

error: CMake Error at CMakeLists.txt:9 (cmake_minimum_required): CMake 3.0 or higher is required. You are running version 2.8.11

This implies that the cmake on your $PATH is not the version you said you are using (3.15.3), so you might want to look into that with which cmake

I have tested bamtools six ways from Sunday, and couldn't reproduce this issue.

I received a similar error. I started by cloning the repo and adding the build directory:

git clone git://github.com/pezmaster31/bamtools.git
cd bamtools/
mkdir build
cd build

I confirm that my cmake version is above 3.0:

which cmake
>> returns: 'cmake version 3.10.2'

While still inside the build directory, I typed this:

cmake -DCMAKE_INSTALL_PREFIX=/path/to/bamtools

And get this error:

CMake Error: The source directory "/path/to/bamtools/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

The problem was that I forgot to add the two .. at the end of the cmake argument. I think that should reproduce the above error. Once I redid the same command with those extra dots, all was well:

cmake -DCMAKE_INSTALL_PREFIX=/path/to/bamtools ..

compiling went smoothly after that. Hope this helps!