issues with the compilation of boost libraries (boost_thread)

555 views
Skip to first unread message

Xavi Grau

unread,
Feb 10, 2016, 5:48:18 AM2/10/16
to revbayes-users
Hi everyone,

I'm having problems with the compilation of boost libraries in an Ubuntu 15.10 64bits machine. Specifically, it fails when it tries to compile the boost_thread library

After I clone the git repository as-is (https://github.com/revbayes/revbayes.git), I navigate to revbayes-master/project/cmake and execute the compilation script like that:

./build.sh -mpi true

The default behaviour appears to be to try to build the boost libraries, which are located in revbayes/boost_1_55_0/libs. I see that the regenerate.sh script (launched by build.sh) sets the BOOST_ROOT variable to ../../boost_1_55_0, which seems to be right. 

Yet, the compilation script fails at the boost_thread library, which it fails to find:

CMake Error at /usr/share/cmake-3.2/Modules/FindBoost.cmake:1202 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.55.0

  Boost include path: /home/xavi/Programes/revbayes_10feb16/boost_1_55_0

  Could not find the following static Boost libraries:

          boost_thread

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:44 (find_package)

Boost information:
  Boost_INCLUDE_DIRS: /home/xavi/Programes/revbayes_10feb16/boost_1_55_0
  Boost_LIBRARIES: 
  Boost_LIBRARY_DIRS: /home/xavi/Programes/revbayes_10feb16/boost_1_55_0/stage/lib
-- Configuring incomplete, errors occurred!
See also "/home/xavi/Programes/revbayes_10feb16/projects/cmake/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found.  Stop.


The weird thing is that there is a thread library in the revbayes/boost_1_55_0/libs directory. Is this the folder where the script should be pointing at?

I've noted that, in the error above, there is no Boost_LIBRARIES variable set (in red). Could this be the cause of the error? Yet, when I set this variable to revbayes_10feb16/boost_1_55_0/libs the error persists.

Does anyone have any clue on what could be going wrong?

In case it's useful, I'm using gcc v5.2.1 and I already have installed the libboost-all-dev package (v1.58) from the repositories.

Thanks a lot in advance.

Best,

Xavi

Xavi Grau

unread,
Feb 10, 2016, 6:02:49 AM2/10/16
to revbayes-users
Hi,

I've just realized that there are some inconsistencies in my post. Whenever I refer to the "revbayes" directory, I'm actually pointing at the "revbayes_10feb16" directory (it's the name I gave to the cloned git in my machine). 

Xavi

Michael Landis

unread,
Feb 12, 2016, 1:49:06 PM2/12/16
to revbayes-users
Hi Xavi,

Sorry to hear you can't get it to compile on Ubuntu. Unfortunately, I am not able to reproduce the error on Mac OS X 10.11 with cmake 3.4.1 using a fresh copy of the development branch. 

The compilation probably fails when Line 153 of regenerate.sh calls find_package(Boost ...), which is described here: https://cmake.org/cmake/help/v3.2/module/FindBoost.html. I have seen an issue like this before where cmake could not find the package file for the specified version of boost.

This will take a little time to troubleshoot. To start, you should see if any of these three things helps:
1) upgrade cmake from 3.2
2) run build.sh without the -mpi flag
3) try calling build.sh from the development branch

Let me know how it goes!
Michael

Michael Landis

unread,
Feb 13, 2016, 11:50:43 AM2/13/16
to revbayes-users
Hi Xavi,

Does boost_1_55/0/stage/lib/libboost_thread.a exist after calling regenerate.sh? If regenerate.sh completes without errors, would provide a log of the output after running
cmake . -DCMAKE_BUILD_TYPE=release -DBoost_DEBUG=ON

?



On a related note, I just compiled using build.sh (without MPI) from a fresh copy of RevBayes from the development branch and cmake 3.5.

XGrau

unread,
Feb 18, 2016, 5:34:32 AM2/18/16
to revbayes-users
Hi Michael,

Thanks a lot for your feedback. Please excuse my belated answer.

These are the results of the different compilation attempts I've made:

1) I've used the latest cmake (cmake 3.5.0 RC2, 64bits) on the stable branch and the error persists, both with the -mpi true and -mpi false flags. To use cmake 3.5.0 I've just switched the "cmake" line in the build.sh script to the new binary; is that correct? (I didn't want to mess up my cmake installation with a RC version). Yet, the problem is extended to two additional boost libraries:

          boost_thread
          boost_chrono
          boost_atomic


2) When using cmake 3.2.0 on the stable branch and -mpi false, the script can't find boost_thread.

3) The same errors occur both in the developer branch (which I got from here: https://github.com/revbayes/revbayes/tree/development) and the stable one. I.e., cmake 3.2.0 can't find boost_thread and 3.5.0 can't find boost_thread, boost_chrono & boost_atomic. There's no difference when I use mpi true or false.

4) In no compilation attemppt I've found the libboost_thread.a file in this directory.  Apparently, though, regenerate.sh completes without errors, and the error comes when cmake is invoked.

I'll keep you posted if I find out anything else.

Thanks,

Xavi

Xavi Grau

unread,
Feb 18, 2016, 9:00:33 AM2/18/16
to revbayes-users
Hi Michael,

I've read the cmake log you mentioned above and I've seen that cmake was launching cmake both 3.2.2 (my default) and 3.5.0, depending on the task. I suspect this was due to my "partial" installation of cmake 3.5.0 (it was in my home dir instead of /usr/bin).

Therefore, I fully installed newer cmake versions (v3.4.3 https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz, the latest stable release, and v3.5.0 mentioned before) in the system directories.

Sadly, the error persists in both the development and master branches: cmake 3.5.0 can't find boost_thread, boost_chrono & boost_atomic and 3.4.3 can't find boost_thread (it behaves like 3.2.2).

Best,

Xavi


--
You received this message because you are subscribed to a topic in the Google Groups "revbayes-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/revbayes-users/jezyv7j0u18/unsubscribe.
To unsubscribe from this group and all its topics, send an email to revbayes-user...@googlegroups.com.
To post to this group, send email to revbaye...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/revbayes-users/67494d06-d89f-48a4-af51-4d9467e12b0f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Landis

unread,
Feb 24, 2016, 4:59:57 PM2/24/16
to revbayes-users
Hi Xavi,

Some good news. I set up Ubuntu 15.10 on a virtual machine and reproduced your error. To successfully run build.sh, I had to temporarily downgrade to g++-4.8 from the default (g++ 5.2.1). This is a temporary fix. For this I used the commands:

sudo apt-get install g++-4.8
sudo unlink
/usr/bin/g++
sudo ln
-s /usr/bin/g++-4.8 g++
./build.sh -mpi true

when the compilation completes, relink the default g++ installation with

sudo unlink /usr/bin/g++
sudo ln
-s /usr/bin/g++-5

The long story (if you're interested) is that RevBayes is built using it's own copy of Boost 1.55. Apparently, this version contains a compile-time bug when boost/thread is compiled with g++-5. You may have seen the following error for `boost::call_once()` when running regenerate.sh: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=778220. Newer versions of Boost correct this issue, so I am going to look into upgrading the version provided by RevBayes.

I recommend pulling a fresh copy of revbayes from GitHub before proceeding and checking out the development branch. This worked for me, so I hope it works for you too!

Michael


On Thursday, February 18, 2016 at 9:00:33 AM UTC-5, XGrau wrote:
Hi Michael,

I've read the cmake log you mentioned above and I've seen that cmake was launching cmake both 3.2.2 (my default) and 3.5.0, depending on the task. I suspect this was due to my "partial" installation of cmake 3.5.0 (it was in my home dir instead of /usr/bin).

Therefore, I fully installed newer cmake versions (v3.4.3 https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz, the latest stable release, and v3.5.0 mentioned before) in the system directories.

Sadly, the error persists in both the development and master branches: cmake 3.5.0 can't find boost_thread, boost_chrono & boost_atomic and 3.4.3 can't find boost_thread (it behaves like 3.2.2).

Best,

Xavi

Reply all
Reply to author
Forward
0 new messages