Build errors on Linux

Dec 18, 2014 at 8:56 AM
First time trying to build Casablanca on Linux, but I'm already running into problems. So the problem is basically that the machine I'm working on already has a boost version installed, but it's too old.

So if I try to compile as per the instructions, I get the error:
Cannot include #include "boost/uuid/uuid.hpp"

Right, so I've downloaded and compiled the latest version of boost, but now the problem is that I cannot figure out how to point the script to using it. I've tried -DBOOST_ROOT, but the causes the problem as above. It cannot find the includes.

I've also tried directly sending include and linker paths to the compiler, but then I get linker errors:

test_runner.cpp:(.text+0x1945): undefined reference to boost::filesystem::detail::initial_path(boost::system::error_code*)'
test_runner.cpp:(.text+0x1a41): undefined reference to
boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, boost::system::error_code*)'
etc

So I don't know how to fix this. Any guidance would be appreciated.

Command to make without specifying boost:

~/casablanca_test/cmake/bin/cmake -DCMAKE_CXX_FLAGS="-w" .. -DCMAKE_BUILD_TYPE=Release

BOOST_ROOT:

~/casablanca_test/cmake/bin/cmake -DCMAKE_CXX_FLAGS="-w" .. -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=/local/pcs_ua/pcs14_40/casablanca_test/boost/boost_1_57_0/ -Wno-dev

(Also tried -DBOOSTROOT with no luck.)

Manually specifying paths:

~/casablanca_test/cmake/bin/cmake -DCMAKE_CXX_FLAGS="-I/local/pcs_ua/pcs14_40/casablanca_test/boost/boost_1_57_0/ -L/local/pcs_ua/pcs14_40/casablanca_test/boost/boost_1_57_0/stage/lib -w" .. -DCMAKE_BUILD_TYPE=Release

Boost was built with:

./b2 --variant=release

cmake was not in the system either, so I had to compile that with the default settings, as well.
Dec 18, 2014 at 3:08 PM
Well, I finally succeeded in building it because cmake is a bastard -_-
I had to explicitly force it to use the paths provided and tell it to stop searching. This worked:

CXX=g++ cmake -DCMAKE_CXX_FLAGS="-w" -DCMAKE_BUILD_TYPE=Release -DBOOST_INCLUDEDIR=~/casablanca_test/boost/boost_1_57_0/ -DBoost_LIBRARY_DIRS=~/casablanca_test/boost/boost_1_57_0/stage/lib/ -DBoost_NO_SYSTEM_PATHS=ON -DBoost_NO_BOOST_CMAKE=ON ..

Even giving it hints refused to work as it would just use the system libraries.
Coordinator
Dec 18, 2014 at 4:52 PM
Hi Essentia,

Glad to hear you managed to get it to compile, but I'm sorry cmake gave you so much trouble. What distro are you using? If there is a change to the main CMakeLists.txt file that would fix this whole issue, please consider making a pull request.

Also, if you inspect the FindBoost.cmake script inside of your cmake installation (I think mine is under /usr/share/cmake/modules), there is a debugging setting which will cause the find package command to output a lot more information. I've used this in the past to debug other boost issues.

roschuma
Dec 18, 2014 at 4:55 PM
Edited Dec 18, 2014 at 4:56 PM
I don't know what distro it is (I'm not an administrator). uname gives:

uname -r
2.6.32-431.3.1.el6.x86_64
uname -a
Linux gothmog.it.kth.se 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Dec 13 06:58:20 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

I don't think the problem is with Casablanca per se, as all I can see is that it uses cmake's find boot script which seems to love to pick up the system paths.