Troubleshooting installation of the mpi version of revbayes

I’ll be attending a workshop in Buenos Aires next week on revbayes, a program for bayesian inference in evolutionary biology that looks very promising for divergence time estimation, an area in which I have particular interest. When preparing the software for the workshop, I noted that the single-thread version compiled without problems. However, when trying to build the mpi version (multi-thread, revbayes with steroids), release 1.0.7 (master branch) I found the error (see line 90, highlighted):

user@computer:~/programs/revbayes/projects/cmake$ ./build.sh -mpi true
/home/user/programs/revbayes/projects/cmake/build<span id="mce_SELREST_start" style="overflow:hidden;line-height:0;"></span>
Building boost libraries
you can turn this of with argument "-boost false"
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam...

Bootstrapping is done. To build, run:

    ./b2

To adjust configuration, edit 'project-config.jam'.
Further information:

   - Command line help:
     ./b2 --help

   - Getting started guide:
     http://www.boost.org/more/getting_started/unix-variants.html

   - Boost.Build documentation:
     http://www.boost.org/build/doc/html/index.html

Performing configuration checks

    - 32-bit                   : no  (cached)
    - 64-bit                   : yes (cached)
    - arm                      : no  (cached)
    - mips1                    : no  (cached)
    - power                    : no  (cached)
    - sparc                    : no  (cached)
    - x86                      : yes (cached)

Building the Boost C++ Libraries.

    - symlinks supported       : yes (cached)
    - gcc visibility           : yes (cached)
    - long double support      : yes (cached)
    - has_icu builds           : yes (cached)
    - lockfree boost::atomic_flag : yes (cached)

Component configuration:

    - atomic                   : building
    - chrono                   : building
    - container                : not building
    - context                  : not building
    - coroutine                : not building
    - coroutine2               : not building
    - date_time                : building
    - exception                : not building
    - filesystem               : building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : building
    - mpi                      : not building
    - program_options          : building
    - python                   : not building
    - random                   : not building
    - regex                    : building
    - serialization            : building
    - signals                  : building
    - system                   : building
    - test                     : not building
    - thread                   : building
    - timer                    : not building
    - type_erasure             : not building
    - wave                     : not building

...patience...
...patience...
...patience...
...found 3944 targets...

The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    /home/user/programs/revbayes/boost_1_60_0

The following directory should be added to linker library paths:

    /home/user/programs/revbayes/boost_1_60_0/stage/lib

CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find MPI_C (missing: MPI_C_LIBRARIES MPI_C_INCLUDE_PATH)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindMPI.cmake:614 (find_package_handle_standard_args)
  CMakeLists.txt:26 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/user/programs/revbayes/projects/cmake/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/programs/revbayes/projects/cmake/build/CMakeFiles/CMakeError.log".
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find MPI_C (missing: MPI_C_LIBRARIES MPI_C_INCLUDE_PATH)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindMPI.cmake:614 (find_package_handle_standard_args)
  CMakeLists.txt:26 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/user/programs/revbayes/projects/cmake/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/programs/revbayes/projects/cmake/build/CMakeFiles/CMakeError.log".
Makefile:218: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1

The error message looked somewhat obscure and finding that there was something wrong with the mpi library I looked how to install it for Ubuntu. I ended up installing everything labeled openmpi with apt-get. However, this did NOT solve my problem as the installation process still was unable to find the mpi component. Most of the day was spent trying unsuccessfully to switch paths to libraries, edit bash profile files, try to switch flags for the build.sh file, and a long list of other useless and desperate options.

Once at home I decided to give it a try again and noted that the installation process makes reference to the ‘boost’ library and its ‘mpi’ component. The compilation of the mpi version of revbayes actually complains about being unable to find MPI_C, and since the component configuration mpi is said to be not building (see highlighted line 60 in the first code block), I ended up looking for something related to the boost library (actually called libboost) and mpi with apt-cache (actually, apt-cache search libboost gives a list of components that matches the components listed during the preparation for compiling):

user@computer:~$ apt-cache search libboost-mpi # look for the mpi component of the boost library
libboost-mpi-dev - C++ interface to the Message Passing Interface (MPI) (default version)
libboost-mpi-python-dev - C++ interface to the Message Passing Interface (MPI), Python Bindings (default version)
libboost-mpi-python1.58-dev - C++ interface to the Message Passing Interface (MPI), Python Bindings
libboost-mpi-python1.58.0 - C++ interface to the Message Passing Interface (MPI), Python Bindings
libboost-mpi1.58-dev - C++ interface to the Message Passing Interface (MPI)
libboost-mpi1.58.0 - C++ interface to the Message Passing Interface (MPI)

user@computer:~$ sudo apt-get install libboost-mpi-dev # install the first one in the results

Afterwards, we can try to compile revbayes with the -mpi true flag (last compilation lines show for a positive case of successful compilation):

user@computer:~/programs/revbayes/projects/cmake$ ./build.sh -mpi true
/home/user/programs/revbayes/projects/cmake/build
Building boost libraries
...
... # compilation takes some time and is quite verbose
...
[100%] Linking CXX static library librb-parser.a
[100%] Built target rb-parser
Scanning dependencies of target rb-mpi
[100%] Building CXX object CMakeFiles/rb-mpi.dir/home/balleng/programs/revbayes/src/revlanguage/main.cpp.o
[100%] Linking CXX executable ../rb-mpi
[100%] Built target rb-mpi

Then we can try to check whether the revbayes mpi can be found and then run it with rb-mpi:

user@computer:~$ whereis rb-mpi
rb-mpi: /home/user/programs/revbayes/projects/cmake/rb-mpi
user@computer:~$ rb-mpi

RevBayes version (1.0.7)
Build from master (31efda) on Wed Apr 11 01:21:44 -03 2018

Visit the website www.RevBayes.com for more information about RevBayes.

RevBayes is free software released under the GPL license, version 3. Type 'license()' for details.

To quit RevBayes type 'quit()' or 'q()'.

>

With everything in order, I can start the workshop and be sure that the power of multi-thread tools can be used in my own analyses.

Advertisements

Author: gaballench

Ictiólogo con interés en informática y música, simpatizante de iniciativas open source.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s