NBISweden / MrBayes

MrBayes is a program for Bayesian inference and model choice across a wide range of phylogenetic and evolutionary models. For documentation and downloading the program, please see the home page:
http://NBISweden.github.io/MrBayes/
GNU General Public License v3.0
232 stars 79 forks source link

MrBayes 3.2.7 fails to compile with BEAGLE3 on Ubuntu 18.04 #267

Closed cement-head closed 2 years ago

cement-head commented 2 years ago

BEAGLE3 installed as per: https://github.com/beagle-dev/beagle-lib/wiki/LinuxInstallInstructions make test for BEAGLE3 works

Downloading and attempting to compile MrBayes 3.2.7 with BEAGLE3 results in beagle.h not being found.

What is the current observed behaviour?

Cannot find beagle:

$ ./configure --with-beagle=$HOME/include/libhmsbeagle-1/libhmsbeagle/ --with-mpi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for pdflatex... /usr/bin/pdflatex
checking for bibtex... /usr/bin/bibtex
checking for latexmk... no
checking for style of include used by make... GNU
checking whether to compile using MPI... yes
checking for mpicc... mpicc
checking for gcc... (cached) mpicc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mpicc accepts -g... yes
checking for mpicc option to accept ISO C89... none needed
checking whether mpicc understands -c and -o together... yes
checking dependency style of mpicc... gcc3
checking for function MPI_Init... yes
checking for mpi.h... yes
checking for sqrt in -lm... yes
checking how to run the C preprocessor... mpicc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
configure: Trying to locate Beagle (hmsbeagle-1) in '/home/cbfgws6/include/libhmsbeagle-1/libhmsbeagle/'
checking libhmsbeagle/beagle.h usability... no
checking libhmsbeagle/beagle.h presence... no
checking for libhmsbeagle/beagle.h... no
checking for beagleCreateInstance in -lhmsbeagle... no
configure: WARNING: Failed to locate Beagle, falling back on pkg-config
checking for BEAGLE... no
configure: error: --with-beagle was given, but test for Beagle failed

What is the expected/wanted behaviour?

Find beagle.h; finish compiling

How may we reproduce this bug?

Follow instructions

Steps to reproduce the bug:

  1. Install BEAGLE3 to local
/home/cbfgws6/lib/libhmsbeagle.so
/home/cbfgws6/include/libhmsbeagle-1/libhmsbeagle/beagle.h
/home/cbfgws6/include/libhmsbeagle-1/libhmsbeagle/platform.h
/home/cbfgws6/lib/libhmsbeagle-cpu.so.40.0.0
/home/cbfgws6/lib/libhmsbeagle-cpu.so
/home/cbfgws6/lib/libhmsbeagle-cpu-sse.so.40.0.0
/home/cbfgws6/lib/libhmsbeagle-cpu-sse.so
/home/cbfgws6/lib/libhmsbeagle-cuda.so.40.0.0
/home/cbfgws6/lib/libhmsbeagle-cuda.so
/home/cbfgws6/lib/libhmsbeagle-jni.so
  1. DOWNLOAD MrBayes 3.2.7 from GitHub
  2. Enter this command: $ ./configure --with-beagle=$HOME/include/libhmsbeagle-1/libhmsbeagle/ --with-mpi
  3. Compiler crashes when it fails to find the file.

Would you be able to compile and run MrBayes to test fixes to this bug?

What is the environment that you run MrBayes in?

Other information that may be of use to us in resolving this issue

It looks as if the header files are there, and I'm specifying the correct directory, but MrBayes is reporting that it can't find them. Do I have to configure the pkg-config VARIABLE?

kusalananda commented 2 years ago

Hi!

If you installed Beagle with an installation prefix of /home/cbfgws6, then this is what you should be using with the --with-beagle option to the configure script. Finding the header is only part of the issue, and the other part is to later find the correct library too.

If using /home/cbfgws6 as the path for finding Beagle doesn't work, then you could try using pkg-config. To do that, you would set PKG_CONFIG_PATH to the pathname of the directory holding the hmsbeagle-1.pc file that was installed with Beagle. This file may possibly be located in /home/cbfgws6/lib/pkgconfig on your system.

./configure PKG_CONFIG_PATH=/home/cbfgws6/lib/pkgconfig ...other...options...here...

See also https://raw.githubusercontent.com/NBISweden/MrBayes/develop/INSTALL

cement-head commented 2 years ago

$ ./configure --with-beagle=/home/cbfgws6 --with-mpi

Fixed my problem - thank you - can't believe I missed that.

cement-head commented 2 years ago

I get an error on sudo make install - something to do with the PDF of the manual:

make[2]: Entering directory '/home/cbfgws6/Programs/MrBayes/doc/manual'
env TEXINPUTS=./src: BIBINPUTS=./src: BSTINPUTS=./src: /usr/bin/pdflatex --interaction=batchmode ./src/Manual_MrBayes_v3.2
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
Makefile:513: recipe for target 'Manual_MrBayes_v3.2.pdf' failed
make[2]: *** [Manual_MrBayes_v3.2.pdf] Error 1
make[2]: Leaving directory '/home/cbfgws6/Programs/MrBayes/doc/manual'
Makefile:335: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/cbfgws6/Programs/MrBayes/doc'
Makefile:422: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Suggestions on how to fix?

cement-head commented 2 years ago

$ sudo apt install texlive

Solved the issue.

cement-head commented 2 years ago
$ mb -v
MrBayes, Bayesian Analysis of Phylogeny

Version:   3.2.7a
Features:  SSE AVX FMA Beagle MPI
Host type: x86_64-unknown-linux-gnu (CPU: x86_64)
Compiler:  gnu 9.4.0