Casablanca and CentOS 6.5

Jun 2, 2014 at 5:55 PM
Edited Jun 2, 2014 at 5:55 PM
Hi,

I just succeeded in building casablanca on CentOS. This was quite difficult to figure out so I thought I share this here:
  • you need to build a custom gcc, like 4.8.3. I installed it into /home/user/gcc4.8.3
  • build the latest boost libraries, in /home/user/boost
  • upgrade cmake to a recent version (cmake version 2.8.12.2)
  • open file CMakefile.txt in casablanca/Release
    and insert line
set(CMAKE_CXX_COMPILER "/home/user/gcc4.8.3/bin/c++")

before line

project(casablanca)

at the top of the file
  • export CMAKE_INCLUDE_PATH="/home/user/gcc4.8.3/include:/home/user/boost/include:$CMAKE_INCLUDE_PATH"
    export CMAKE_LIBRARY_PATH="/home/user/gcc4.8.3/lib:/home/user/boost/lib:$CMAKE_LIBRARY_PATH"
  • make sure that cmake will find the custom boost libs, NOT the system ones by changing line
find_package(Boost COMPONENTS system thread locale regex filesystem REQUIRED)
to
find_package(Boost 1.55.0 COMPONENTS system thread locale regex filesystem REQUIRED)

in CMakeLists.txt
Add
message("${Boost_LIBRARIES}")
to double-check once cmake runs that you'll get the correct boost libs.
In my case, cmake mixed custom-built and system boost libs, which caused all kinds of errors and is not obvious when it happens.
  • find and change line
    set(STRICT_CXX_FLAGS ${WARNINGS} "-Werror -pedantic")
    to
    set(STRICT_CXX_FLAGS ${WARNINGS})
in Release/CMakeFiles.txt and
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS} -Werror -pedantic")
to
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS}")
in Release/src/CMakeFiles.txt
  • tell the linker to pick up the custom build libstdc++ from gcc4.8.3,
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/gcc4.8.3/lib64/


In casablanca/Release/build, type

cmake ..

The build should go through.

In order to run the tests, you need to enter directory
casablanca/Release/build/Binaries and convert the line endings of file
run_tests.sh to unix,
awk '{ sub("\r$", ""); print }' run_tests.sh > run_tests2.sh
Then run
sh ./run_tests2.sh

Regards,
Sven
Jun 2, 2014 at 7:40 PM
Thanks for sharing. Congratulations on being the first.