luntergroup / octopus

Bayesian haplotype-based mutation calling
MIT License
302 stars 38 forks source link

install.py fails in `#include <gmp.h>` if `--gmp <gmproot>` specified. #120

Closed bredelings closed 4 years ago

bredelings commented 4 years ago

Describe the bug

Hi, I tried to install octopus from the development branch, and hit a snag. I used the install.py script as follows:

 ./scripts/install.py -c gcc-9 -cxx g++-9  --boost /data/wraycompute/malaria/Applications/boost/current  --gmp /data/wraycompute/malaria/Applications/gmp/local/ --htslib /data/wraycompute/malaria/Applications/htslib/local.new/ --threads 16

This works initially, but eventually fails at:

[ 37%] Building CXX object src/CMakeFiles/octopus.dir/core/callers/polyclone_caller.cpp.o
[ 37%] Building CXX object src/CMakeFiles/octopus.dir/core/callers/cell_caller.cpp.o
[ 38%] Building CXX object src/CMakeFiles/octopus.dir/core/types/calls/call.cpp.o
In file included from /gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/src/core/callers/cancer_caller.cpp:19:
/data/wraycompute/malaria/Applications/boost/current/boost/multiprecision/gmp.hpp:32:10: fatal error: gmp.h: No such file or directory
   32 | #include <gmp.h>
      |          ^~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/octopus.dir/core/callers/cancer_caller.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/CMakeFiles/octopus.dir/all] Error 2
make: *** [all] Error 2

I added set(CMAKE_EXPORT_COMPILE_COMMANDS ON) I see entries like this:

{
  "directory": "/gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/build/src",
  "command": "/data/wraycompute/malaria/Applications/gcc/local/bin/g++-9  -DBOOST_LOG_DYN_LINK -I/gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/build/generated -I/gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/lib -I/gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/src -I/data/wraycompute/malaria/Applications/boost/current -I/data/wraycompute/malaria/Applications/htslib/local.new/include  -O3 -DNDEBUG   -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Wno-deprecated-copy -Wno-maybe-uninitialized -Wno-noexcept-type -msse4.1 -ffast-math -march=native -mfpmath=both -std=gnu++14 -o CMakeFiles/octopus.dir/timers.cpp.o -c /gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/src/timers.cpp",
  "file": "/gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/src/timers.cpp"
}

It looks like the include directories for boost and htslib are there, but the include directory for GMP is not.

(BTW, curious if you've looked at meson: https://mesonbuild.com/)

dancooke commented 4 years ago

Will look into it but the recommended way to install is with automatic dependency installation:

./scripts/install.py --dependencies --threads 16

Note that this installs everything within the octopus/build directory so won't pollute any existing installations that you have.

bredelings commented 4 years ago

I tried this, but the homebrew installation doesn't work on my cluster because (i) the C library is too old and (ii) homebrew is not being installed in the "standard location".

==> Installing curl dependency: pkg-config
Warning: Building pkg-config from source:
  The bottle only works in the default /home/linuxbrew/.linuxbrew location.
/gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/build/brew/opt/gcc/bin/gcc-5: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/build/brew/opt/gcc/bin/gcc-5)
/gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/build/brew/opt/gcc/bin/gcc: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /gpfs/fs1/data/wraycompute/malaria/Applications/octopus2/git/build/brew/opt/gcc/bin/gcc)
Error: An exception occurred within a child process:
  CompilerSelectionError: pkg-config cannot be built with any available compilers.
Install Clang or run `brew install gcc`.

I tried to install linuxbrew on my own, but that doesn't work either. Supplying g++-9 that I built myself just results in linuxbrew saying that there is no g++-9 installed via linuxbrew. So it looks like it is refusing to use any compilers except (i) /usr/bin/gcc or (ii) linuxbrew.

If I run the following command line, then Cmake says that gmp is not found:

./scripts/install.py -c gcc-9 -cxx g++-9  --boost /data/wraycompute/malaria/Applications/boost/current  --htslib /data/wraycompute/malaria/Applications/htslib/local.new/ --threads 16 --dependencies
bredelings commented 4 years ago

I have a patch to fix this that mostly works. I will submit a pull request, though it might take a few days.

dancooke commented 4 years ago

What OS version are you using? I can try to replicate in Docker. Also, I fixed an issue with Homebrew complaining about old glibc a couple of weeks ago. Are you using this or a later commit?

bredelings commented 4 years ago

I'm using a later commit. /etc/issue shows 'Centos 6.8 (Final)' uname -a shows:

2.6.32-642.11.1.el6.x86_64 #1 SMP Fri Nov 18 19:25:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
bredelings commented 4 years ago

The problem looks something like this:

Homebrew refuses to use any compilers besides /usr/bin/gcc or its own compilers even if given with -cxx and -c, so the gcc-9 compiler that I manually installed cannot be used.

This is the same problem that I had trying to install linuxbrew manually. It would be rather nice to have a working linuxbrew installation -- I've installed quite a lot of libraries manually.

bredelings commented 4 years ago

Any problems with PR #122 ?

dancooke commented 4 years ago

Merged.