Building on Pop_OS

Hi,

Recently I was trying to build the sequence of cmb-superbuild, smtk, cmb workflow on my Pop_OS machine. When building SMTK, I got the following error message from make command

Error

[ 40%] Linking CXX shared library ../lib/libsmtkCore.so
/usr/bin/ld: cannot find /opt/cmb-superbuild/bld/install/lib: file format not recognized
collect2: error: ld returned 1 exit status
make[2]: *** [smtk/CMakeFiles/smtkCore.dir/build.make:6474: lib/libsmtkCore.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:2342: smtk/CMakeFiles/smtkCore.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Steps used to build CMB-superbuild

Configure

cmake ../ \
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DENABLE_qt5:BOOL=ON \
-DQt5_DIR:PATH=/opt/miniconda3/envs/rgg-session/lib/cmake/Qt5 \
-DCMAKE_PREFIX_PATH:STRING=install \
-DDEVELOPER_MODE_cmb:BOOL=ON \
-DDEVELOPER_MODE_smtk:BOOL=ON \
-DUSE_SYSTEM_boost:BOOL=OFF \
-DUSE_SYSTEM_python3:BOOL=ON \
-DUSE_SYSTEM_qt5:BOOL=ON \
-DENABLE_meshkit:BOOL=ON \
-DENABLE_netgen:BOOL=ON \
-DENABLE_occt:BOOL=ON 
  • Run make -j 16
  • Status :white_check_mark:

Step used to configure SMTK

Configure

cmake ../ \
-C/opt/cmb-superbuild/bld/smtk-developer-config.cmake \
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-D_smtk_superbuild_prefix:PATH=/opt/cmb-superbuild/bld/install \
-DSMTK_UNIFIED_INSTALL_TREE:BOOL=ON \
-DCMAKE_PREFIX_PATH:STRING=install \
-DSMTK_USE_SYSTEM_MOAB:BOOL=ON \
-DLibArchive_INCLUDE_DIR=/opt/cmb-superbuild/bld/install/include \
-DLibArchive_LIBRARY=/opt/cmb-superbuild/bld/install/lib \
-Dpybind11_DIR:STRING=/opt/cmb-superbuild/bld/install/share/cmake/pybind11 \
-DSMTK_NO_SYSTEM_BOOST=OFF \
-DSMTK_ENABLE_PYTHON_WRAPPING:BOOL=ON \
-DSMTK_ENABLE_PARAVIEW_SUPPORT:BOOL=ON \
-DQt5_DIR:PATH=/opt/miniconda3/envs/rgg-session/lib/cmake/Qt5
  • Run make -j 16
  • Status :x:
  • Error as following
[ 40%] Linking CXX shared library ../lib/libsmtkCore.so
/usr/bin/ld: cannot find /opt/cmb-superbuild/bld/install/lib: file format not recognized
collect2: error: ld returned 1 exit status
make[2]: *** [smtk/CMakeFiles/smtkCore.dir/build.make:6474: lib/libsmtkCore.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:2342: smtk/CMakeFiles/smtkCore.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
smtk-developer-config.cmake set(CMAKE_PREFIX_PATH "/opt/cmb-superbuild/bld/install;install" CACHE PATH "Initial cache" ) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Initial cache" ) set(SUPERBUILD_DEVELOPER_MODE_ROOT "/opt/cmb-superbuild/bld/install" CACHE PATH "Initial cache" ) set(Boost_NO_SYSTEM_PATHS "ON" CACHE BOOL "Initial cache" ) set(BOOST_INCLUDEDIR "/usr/include" CACHE PATH "Initial cache" ) set(CMAKE_CXX_STANDARD "11" CACHE STRING "Initial cache" ) set(CMAKE_CXX_STANDARD_REQUIRED "TRUE" CACHE STRING "Initial cache" ) set(HDF5_ROOT "/opt/cmb-superbuild/bld/install" CACHE PATH "Initial cache" ) set(HDF5_NO_FIND_PACKAGE_CONFIG_FILE "ON" CACHE BOOL "Initial cache" ) set(LibArchive_INCLUDE_DIR "/opt/cmb-superbuild/bld/install/include" CACHE PATH "Initial cache" ) set(LibArchive_LIBRARY "/opt/cmb-superbuild/bld/install/lib/libarchive.so" CACHE FILEPATH "Initial cache" ) set(MOAB_DIR "/opt/cmb-superbuild/bld/install/lib/cmake/MOAB" CACHE PATH "Initial cache" ) set(nlohmann_json_DIR "/opt/cmb-superbuild/bld/install/lib/cmake/nlohmann_json" CACHE PATH "Initial cache" ) set(pegtl_DIR "/opt/cmb-superbuild/bld/install/share/pegtl/cmake" CACHE PATH "Initial cache" ) set(ParaView_DIR "/opt/cmb-superbuild/bld/install/lib/cmake/paraview-5.10" CACHE PATH "Initial cache" ) set(ParaView_CLEXECUTABLES_DIR "/opt/cmb-superbuild/bld/install/bin" CACHE PATH "Initial cache" ) set(VTK_DIR "/opt/cmb-superbuild/bld/install/lib/cmake/paraview-5.10/vtk" CACHE PATH "Initial cache" ) set(PYTHON_EXECUTABLE "/usr/bin/python3.9" CACHE FILEPATH "Initial cache" ) set(Python3_EXECUTABLE "/usr/bin/python3.9" CACHE FILEPATH "Initial cache" ) set(PYTHON_INCLUDE_DIR "" CACHE PATH "Initial cache" ) set(PYTHON_LIBRARY "" CACHE FILEPATH "Initial cache" ) set(Python3_INCLUDE_DIR "" CACHE PATH "Initial cache" ) set(Python3_LIBRARY "" CACHE FILEPATH "Initial cache" ) set(Qt5_DIR "/opt/miniconda3/envs/rgg-session/lib/cmake/Qt5" CACHE PATH "Initial cache" ) set(Qt5Core_DIR "/opt/miniconda3/envs/rgg-session/lib/cmake/Qt5/../Qt5Core" CACHE PATH "Initial cache" ) set(Qt5Svg_DIR "/opt/miniconda3/envs/rgg-session/lib/cmake/Qt5/../Qt5Svg" CACHE PATH "Initial cache" ) set(SMTK_RELOCATABLE_INSTALL "OFF" CACHE BOOL "Initial cache" ) set(_smtk_superbuild_prefix "/opt/cmb-superbuild/bld/install" CACHE PATH "Initial cache" ) set(SMTK_UNIFIED_INSTALL_TREE "ON" CACHE BOOL "Initial cache" ) set(SMTK_DLL_PATHS "" CACHE STRING "Initial cache" ) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "FALSE" CACHE BOOL "Initial cache" ) set(BUILD_SHARED_LIBS "ON" CACHE BOOL "Initial cache" ) set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Initial cache" ) set(SMTK_RELOCATABLE_INSTALL "OFF" CACHE BOOL "Initial cache" ) set(BUILD_TESTING "" CACHE BOOL "Initial cache" ) set(SMTK_ENABLE_TESTING "" CACHE BOOL "Initial cache" ) set(SMTK_BUILD_DOCUMENTATION "always" CACHE STRING "Initial cache" ) set(SMTK_ENABLE_GDAL_SUPPORT "FALSE" CACHE BOOL "Initial cache" ) set(SMTK_ENABLE_OPENCASCADE_SESSION "TRUE" CACHE BOOL "Initial cache" ) set(SMTK_ENABLE_QT_SUPPORT "TRUE" CACHE BOOL "Initial cache" ) set(SMTK_ENABLE_VTK_SUPPORT "ON" CACHE BOOL "Initial cache" ) set(SMTK_ENABLE_PARAVIEW_SUPPORT "TRUE" CACHE BOOL "Initial cache" ) set(SMTK_ENABLE_EXODUS_SESSION "TRUE" CACHE BOOL "Initial cache" ) set(SMTK_ENABLE_PYTHON_WRAPPING "ON" CACHE BOOL "Initial cache" ) set(SMTK_ENABLE_MATPLOTLIB "" CACHE BOOL "Initial cache" ) set(SMTK_ENABLE_PROJECT_UI "ON" CACHE BOOL "Initial cache" ) set(SMTK_USE_PYBIND11 "TRUE" CACHE BOOL "Initial cache" ) set(SMTK_USE_SYSTEM_MOAB "ON" CACHE BOOL "Initial cache" ) set(PYBIND11_INSTALL "TRUE" CACHE BOOL "Initial cache" ) set(SMTK_QT_VERSION "5" CACHE STRING "Initial cache" ) set(SMTK_PYTHON_VERSION "3" CACHE STRING "Initial cache" ) set(SMTK_ENABLE_MOAB_DISCRETE_READER "OFF" CACHE BOOL "Initial cache" ) set(SMTK_ENABLE_CUMULUS_SUPPORT "" CACHE BOOL "Initial cache" ) set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Initial cache" )

Did I miss something here? And How to fix this issue?

Thanks in advance!

Yes, this line is the problem, it is expecting a library file, like a .so, and you are supplying a directory.
When using the superbuild ‘developer config’, usually you should just use the config file produced by the superbuild, like your first line:

cmake -C/opt/cmb-superbuild/bld/smtk-developer-config.cmake ../

Have you tried this?

Just tried this and got the next error message

Consolidate compiler generated dependencies of target TemplateEditor
[ 99%] Linking CXX executable ../../bin/TemplateEditor
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::re_detail_107400::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::re_detail_107400::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const'
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::re_detail_107400::get_mem_block()'
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::re_detail_107400::raise_runtime_error(std::runtime_error const&)'
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::re_detail_107400::verify_options(unsigned int, boost::regex_constants::_match_flags)'
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)'
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::re_detail_107400::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::re_detail_107400::get_default_error_string(boost::regex_constants::error_type)'
/usr/bin/ld: ../../lib/libsmtkCore.so: undefined reference to `boost::re_detail_107400::put_mem_block(void*)'
collect2: error: ld returned 1 exit status
make[2]: *** [applications/TemplateEditor/CMakeFiles/TemplateEditor.dir/build.make:348: bin/TemplateEditor] Error 1
make[1]: *** [CMakeFiles/Makefile2:6538: applications/TemplateEditor/CMakeFiles/TemplateEditor.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

The error remains the same when system install boost library was used.

This looks like two different versions of the boost library are in conflict. When you tried
cmake -C/opt/cmb-superbuild/bld/smtk-developer-config.cmake …/
was it a clean build - i.e. did you remove everything in the build directory?