First experiences with build process
Hi,
as I have just started to play a little with the actual tinyhhg software and to some extent represent the enduser faction I thought I'd report here on my experiences so far. These are probably mostly dominated by the following two facts. In our group we are running Debian Linux currently still using Jessie. Hence the actual system stuff sometimes is pretty old. Same as the LRZ we employ environment modules for updated software, compiler and library versions, if these are not available as backports for Jessie. The other aspect is that I am a novice to CMake, having just gotten used to Scons for old HHG.
-
Using CMake initially failed because Jessie's version 3.0.2 was considered to be too old. Fortunately 3.6.2 was available as backport. So this is settled.
-
CMake does not seem to work together in a transparent fashion with environment modules. Although I loaded the module for GNU 7.2.0 it wanted to use the system compiler /usr/bin/c++ which embarassingly is GNU 4.9.2
cmake ../tinyHHG/ -DWALBERLA_DIR=../walberla -- The C compiler identification is GNU 4.9.2 -- The CXX compiler identification is GNU 4.9.2 -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works
Building that way fails in tinyhhg_core. But that can hardly be blamed on the software.
-
Fixed this problem by setting two environment variables (excuse the syntax I use tcsh
👴🏼 )module load gcc/7.2.0 setenv CC gcc setenv CXX g++ cmake ../tinyHHG/ -DWALBERLA_DIR=../walberla
does the trick
-- The CXX compiler identification is GNU 7.2.0 -- Check for working C compiler: /opt/software/gcc/7.2.0/bin/gcc -- Check for working C compiler: /opt/software/gcc/7.2.0/bin/gcc -- works
Is this the preferred way to do this with CMake, or would there be a better alternative?
-
Unfortunately, while tinyhhg_core appears to build, the apps fail due to an issue with boost_regex. I receive the following type of linker error:
/opt/software/gcc/7.2.0/bin/g++ -std=c++11 -Wall -Wconversion -Wshadow -Wfloat-equal -Wextra -pedantic -D_GLIBCXX_USE_CXX11_ABI=1 -pthread -O3 -DNDEBUG CMakeFiles/block_cg.dir/block_cg.cpp.o -o block_cg -rdynamic ../src/tinyhhg_core/libtinyhhg_core.a ../extern/fmt-3.0.1/fmt/libfmt.a ../walberla/src/core/libcore.a ../src/tinyhhg_core/libtinyhhg_core.a ../extern/fmt-3.0.1/fmt/libfmt.a ../walberla/src/core/libcore.a ../src/tinyhhg_core/libtinyhhg_core.a ../extern/fmt-3.0.1/fmt/libfmt.a ../walberla/src/core/libcore.a -lboost_chrono -lboost_filesystem -lboost_system -lboost_thread -lboost_regex -lboost_date_time -lboost_atomic -lpthread -lmpi -ldl -lhwloc -lmpi_cxx -lmpi -ldl -lhwloc -lmpi_cxx CMakeFiles/block_cg.dir/block_cg.cpp.o: In function `__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > boost::re_detail::re_is_set_member<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::re_detail::re_set_long<unsigned int> const*, boost::re_detail::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool)': block_cg.cpp:(.text._ZN5boost9re_detail16re_is_set_memberIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_SH_SH_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb[_ZN5boost9re_detail16re_is_set_memberIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_SH_SH_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb]+0x154): undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const' block_cg.cpp:(.text._ZN5boost9re_detail16re_is_set_memberIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_SH_SH_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb[_ZN5boost9re_detail16re_is_set_memberIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_SH_SH_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb]+0x3d8): undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
Now I am not 100% sure. Is this another version problem? My system boost installation is 1.55.0 and as boost_regex seems to be a part of boost that is not header-only, it was built with GNU 4.9.2. I'll next check out how this works on my laptop which runs Kubuntu 16.04 LTS.
Cheers
Marcus