Installing calculix adapter in centOS 7

Hello!
I am currently facing issues while trying to install calculix adapter in centOS 7. The error displayed was

bin/ccx_2.15.a(ConfigReader.o): In function `ConfigReader_Read':
ConfigReader.cpp:(.text+0x92): undefined reference to `YAML::LoadFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node_ref::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ConfigReader.cpp:(.text._ZN4YAML6detail8node_ref10set_scalarERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4YAML6detail8node_ref10set_scalarERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2a): undefined reference to `YAML::detail::node_data::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::Scalar[abi:cxx11]() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node6ScalarB5cxx11Ev[_ZNK4YAML4Node6ScalarB5cxx11Ev]+0x64): undefined reference to `YAML::detail::node_data::empty_scalar[abi:cxx11]'
collect2: error: ld returned 1 exit status
make: *** [bin/ccx_preCICE] Error 1 ```

But I was able to install OpenFOAM adapter successfully.
The system configuration:
CentOS7
GCC 9.2 (OpenFOAM, CalculiX and preCICE libraries run perfectly fine in clear linux)
BOOST 1.71
yaml-cpp 0.6.2
mpich3.2
preCICE 1.6.1
PETSc 3.12

Thanks!

I think this is tricky. Based on this answer on StackOverflow, could you please try the following?

  1. Also post the compilation command that led to this error (it is probably the lines before the error).
  2. Remove -lyaml-cpp from your CalculiX adapter Makefile here:
    LIBS = \
     $(SPOOLES)/spooles.a \
     $(PKGCONF_LIBS) \
     -lstdc++ \
     -L$(YAML)/build -lyaml-cpp \
    
  3. Add it at the end here:
    $(OBJDIR)/%.o : adapter/%.cpp
     g++ -std=c++11 -I$(YAML)/include -c $< -o $@ $(LIBS)
    
    i.e.:
    $(OBJDIR)/%.o : adapter/%.cpp
     g++ -std=c++11 -I$(YAML)/include -c $< -o $@ $(LIBS) -lyaml-cpp
    

I used the command make for building the adapter for calculix. After modification I get the following:(including the few lines above the actual error part which I did not include in the earlier post)

ar: creating bin/ccx_2.15.a
a - bin/absolute_relative.o
a - bin/acctube.o
a - bin/acctube_one.o
a - bin/actideacti.o
a - bin/actideactistr.o
a - bin/adaptconnectivity.o
....
a - bin/PreciceInterface.o
a - bin/ConfigReader.o
mpifort -fopenmp -Wall -O3 -o bin/ccx_preCICE bin/ccx_2.15.o bin/ccx_2.15.a /home/D/calculix/spooles.2.2/spooles.a -L/home/D/adapter/precice-1.6.1/install/lib -lprecice   -lstdc++ -L/home/D/adapter/yaml-cpp-yaml-cpp-0.6.2/build  /home/D/calculix/ARPACK/libarpack_INTEL.a -lpthread -lm -lc
bin/ccx_2.15.a(ConfigReader.o): In function `ConfigReader_Read':
ConfigReader.cpp:(.text+0x92): undefined reference to `YAML::LoadFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Exception::Exception(YAML::Mark const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ConfigReader.cpp:(.text._ZN4YAML9ExceptionC2ERKNS_4MarkERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4YAML9ExceptionC5ERKNS_4MarkERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x4c): undefined reference to `vtable for YAML::Exception'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::RepresentationException::RepresentationException(YAML::Mark const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ConfigReader.cpp:(.text._ZN4YAML23RepresentationExceptionC2ERKNS_4MarkERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4YAML23RepresentationExceptionC5ERKNS_4MarkERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2c): undefined reference to `vtable for YAML::RepresentationException'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::InvalidNode::InvalidNode()':
ConfigReader.cpp:(.text._ZN4YAML11InvalidNodeC2Ev[_ZN4YAML11InvalidNodeC5Ev]+0x72): undefined reference to `vtable for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::BadConversion::BadConversion(YAML::Mark const&)':
ConfigReader.cpp:(.text._ZN4YAML13BadConversionC2ERKNS_4MarkE[_ZN4YAML13BadConversionC5ERKNS_4MarkE]+0x62): undefined reference to `vtable for YAML::BadConversion'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::BadSubscript::BadSubscript()':
ConfigReader.cpp:(.text._ZN4YAML12BadSubscriptC2Ev[_ZN4YAML12BadSubscriptC5Ev]+0x72): undefined reference to `vtable for YAML::BadSubscript'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::memory_holder::create_node()':
ConfigReader.cpp:(.text._ZN4YAML6detail13memory_holder11create_nodeEv[_ZN4YAML6detail13memory_holder11create_nodeEv]+0x1c): undefined reference to `YAML::detail::memory::create_node()'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node_ref::mark_defined()':
ConfigReader.cpp:(.text._ZN4YAML6detail8node_ref12mark_definedEv[_ZN4YAML6detail8node_ref12mark_definedEv]+0x1c): undefined reference to `YAML::detail::node_data::mark_defined()'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node_ref::set_null()':
ConfigReader.cpp:(.text._ZN4YAML6detail8node_ref8set_nullEv[_ZN4YAML6detail8node_ref8set_nullEv]+0x1c): undefined reference to `YAML::detail::node_data::set_null()'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node_ref::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ConfigReader.cpp:(.text._ZN4YAML6detail8node_ref10set_scalarERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4YAML6detail8node_ref10set_scalarERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2a): undefined reference to `YAML::detail::node_data::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node_ref::size() const':
ConfigReader.cpp:(.text._ZNK4YAML6detail8node_ref4sizeEv[_ZNK4YAML6detail8node_ref4sizeEv]+0x1c): undefined reference to `YAML::detail::node_data::size() const'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::EnsureNodeExists() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node16EnsureNodeExistsEv[_ZNK4YAML4Node16EnsureNodeExistsEv]+0x33): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node16EnsureNodeExistsEv[_ZNK4YAML4Node16EnsureNodeExistsEv]+0x38): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::Mark() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node4MarkEv[_ZNK4YAML4Node4MarkEv]+0x33): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node4MarkEv[_ZNK4YAML4Node4MarkEv]+0x38): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::Type() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node4TypeEv[_ZNK4YAML4Node4TypeEv]+0x33): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node4TypeEv[_ZNK4YAML4Node4TypeEv]+0x38): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::Scalar[abi:cxx11]() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node6ScalarB5cxx11Ev[_ZNK4YAML4Node6ScalarB5cxx11Ev]+0x33): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node6ScalarB5cxx11Ev[_ZNK4YAML4Node6ScalarB5cxx11Ev]+0x38): undefined reference to `typeinfo for YAML::InvalidNode'
ConfigReader.cpp:(.text._ZNK4YAML4Node6ScalarB5cxx11Ev[_ZNK4YAML4Node6ScalarB5cxx11Ev]+0x64): undefined reference to `YAML::detail::node_data::empty_scalar[abi:cxx11]'
bin/ccx_2.15.a(ConfigReader.o): In function `void YAML::Node::Assign<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ConfigReader.cpp:(.text._ZN4YAML4Node6AssignINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRKT_[_ZN4YAML4Node6AssignINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRKT_]+0x37): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4Node6AssignINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRKT_[_ZN4YAML4Node6AssignINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRKT_]+0x3c): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::size() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node4sizeEv[_ZNK4YAML4Node4sizeEv]+0x33): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node4sizeEv[_ZNK4YAML4Node4sizeEv]+0x38): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [20]>(char const (&) [20])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA20_cEES0_RKT_[_ZN4YAML4NodeixIA20_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA20_cEES0_RKT_[_ZN4YAML4NodeixIA20_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > YAML::Node::as<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node2asINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEET_v[_ZNK4YAML4Node2asINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEET_v]+0x37): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node2asINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEET_v[_ZNK4YAML4Node2asINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEET_v]+0x3c): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [13]>(char const (&) [13])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA13_cEES0_RKT_[_ZN4YAML4NodeixIA13_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA13_cEES0_RKT_[_ZN4YAML4NodeixIA13_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char*>(char* const&)':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIPcEES0_RKT_[_ZN4YAML4NodeixIPcEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIPcEES0_RKT_[_ZN4YAML4NodeixIPcEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [11]>(char const (&) [11])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA11_cEES0_RKT_[_ZN4YAML4NodeixIA11_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA11_cEES0_RKT_[_ZN4YAML4NodeixIA11_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<int>(int const&)':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIiEES0_RKT_[_ZN4YAML4NodeixIiEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIiEES0_RKT_[_ZN4YAML4NodeixIiEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [29]>(char const (&) [29])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA29_cEES0_RKT_[_ZN4YAML4NodeixIA29_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA29_cEES0_RKT_[_ZN4YAML4NodeixIA29_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [5]>(char const (&) [5])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA5_cEES0_RKT_[_ZN4YAML4NodeixIA5_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA5_cEES0_RKT_[_ZN4YAML4NodeixIA5_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [6]>(char const (&) [6])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA6_cEES0_RKT_[_ZN4YAML4NodeixIA6_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA6_cEES0_RKT_[_ZN4YAML4NodeixIA6_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [10]>(char const (&) [10])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA10_cEES0_RKT_[_ZN4YAML4NodeixIA10_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA10_cEES0_RKT_[_ZN4YAML4NodeixIA10_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node& YAML::detail::node_data::get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<YAML::detail::memory_holder>)':
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0xf6): undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder>)'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x11e): undefined reference to `YAML::BadSubscript::~BadSubscript()'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x123): undefined reference to `typeinfo for YAML::BadSubscript'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x277): undefined reference to `YAML::detail::node_data::insert_map_pair(YAML::detail::node&, YAML::detail::node&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node& YAML::detail::node_data::get<int>(int const&, std::shared_ptr<YAML::detail::memory_holder>)':
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0xf6): undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder>)'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x11e): undefined reference to `YAML::BadSubscript::~BadSubscript()'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x123): undefined reference to `typeinfo for YAML::BadSubscript'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x277): undefined reference to `YAML::detail::node_data::insert_map_pair(YAML::detail::node&, YAML::detail::node&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node& YAML::detail::node_data::convert_to_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<YAML::detail::memory_holder>)':
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data15convert_to_nodeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data15convert_to_nodeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x56): undefined reference to `YAML::detail::memory_holder::merge(YAML::detail::memory_holder&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node& YAML::detail::node_data::convert_to_node<int>(int const&, std::shared_ptr<YAML::detail::memory_holder>)':
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data15convert_to_nodeIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data15convert_to_nodeIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x56): undefined reference to `YAML::detail::memory_holder::merge(YAML::detail::memory_holder&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::TypedBadConversion<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~TypedBadConversion()':
ConfigReader.cpp:(.text._ZN4YAML18TypedBadConversionINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev[_ZN4YAML18TypedBadConversionINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED5Ev]+0x20): undefined reference to `YAML::BadConversion::~BadConversion()'
bin/ccx_2.15.a(ConfigReader.o):(.rodata._ZTIN4YAML18TypedBadConversionINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE[_ZTIN4YAML18TypedBadConversionINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x10): undefined reference to `typeinfo for YAML::BadConversion'
collect2: error: ld returned 1 exit status
make: *** [bin/ccx_preCICE] Error 1

I now see that what I (quickly) wrote before does not make any sense/difference. Please try this:

$(OBJDIR)/%.o : adapter/%.cpp
 g++ -std=c++11 -I$(YAML)/include -c $< -o $@ $(LIBS)

to:

$(OBJDIR)/%.o : adapter/%.cpp
 g++ -std=c++11 $(LIBS) -I$(YAML)/include -c $< -o $@ -lyaml-cpp  

I have not tested this and it may fail, but we can then try to understand why.

Please find the error message below:

bin/ccx_2.15.a(ConfigReader.o): In function `ConfigReader_Read':
ConfigReader.cpp:(.text+0x92): undefined reference to `YAML::LoadFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Exception::Exception(YAML::Mark const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ConfigReader.cpp:(.text._ZN4YAML9ExceptionC2ERKNS_4MarkERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4YAML9ExceptionC5ERKNS_4MarkERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x4c): undefined reference to `vtable for YAML::Exception'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::RepresentationException::RepresentationException(YAML::Mark const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ConfigReader.cpp:(.text._ZN4YAML23RepresentationExceptionC2ERKNS_4MarkERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4YAML23RepresentationExceptionC5ERKNS_4MarkERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2c): undefined reference to `vtable for YAML::RepresentationException'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::InvalidNode::InvalidNode()':
ConfigReader.cpp:(.text._ZN4YAML11InvalidNodeC2Ev[_ZN4YAML11InvalidNodeC5Ev]+0x72): undefined reference to `vtable for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::BadConversion::BadConversion(YAML::Mark const&)':
ConfigReader.cpp:(.text._ZN4YAML13BadConversionC2ERKNS_4MarkE[_ZN4YAML13BadConversionC5ERKNS_4MarkE]+0x62): undefined reference to `vtable for YAML::BadConversion'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::BadSubscript::BadSubscript()':
ConfigReader.cpp:(.text._ZN4YAML12BadSubscriptC2Ev[_ZN4YAML12BadSubscriptC5Ev]+0x72): undefined reference to `vtable for YAML::BadSubscript'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::memory_holder::create_node()':
ConfigReader.cpp:(.text._ZN4YAML6detail13memory_holder11create_nodeEv[_ZN4YAML6detail13memory_holder11create_nodeEv]+0x1c): undefined reference to `YAML::detail::memory::create_node()'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node_ref::mark_defined()':
ConfigReader.cpp:(.text._ZN4YAML6detail8node_ref12mark_definedEv[_ZN4YAML6detail8node_ref12mark_definedEv]+0x1c): undefined reference to `YAML::detail::node_data::mark_defined()'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node_ref::set_null()':
ConfigReader.cpp:(.text._ZN4YAML6detail8node_ref8set_nullEv[_ZN4YAML6detail8node_ref8set_nullEv]+0x1c): undefined reference to `YAML::detail::node_data::set_null()'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node_ref::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ConfigReader.cpp:(.text._ZN4YAML6detail8node_ref10set_scalarERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4YAML6detail8node_ref10set_scalarERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2a): undefined reference to `YAML::detail::node_data::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node_ref::size() const':
ConfigReader.cpp:(.text._ZNK4YAML6detail8node_ref4sizeEv[_ZNK4YAML6detail8node_ref4sizeEv]+0x1c): undefined reference to `YAML::detail::node_data::size() const'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::EnsureNodeExists() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node16EnsureNodeExistsEv[_ZNK4YAML4Node16EnsureNodeExistsEv]+0x33): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node16EnsureNodeExistsEv[_ZNK4YAML4Node16EnsureNodeExistsEv]+0x38): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::Mark() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node4MarkEv[_ZNK4YAML4Node4MarkEv]+0x33): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node4MarkEv[_ZNK4YAML4Node4MarkEv]+0x38): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::Type() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node4TypeEv[_ZNK4YAML4Node4TypeEv]+0x33): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node4TypeEv[_ZNK4YAML4Node4TypeEv]+0x38): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::Scalar[abi:cxx11]() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node6ScalarB5cxx11Ev[_ZNK4YAML4Node6ScalarB5cxx11Ev]+0x33): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node6ScalarB5cxx11Ev[_ZNK4YAML4Node6ScalarB5cxx11Ev]+0x38): undefined reference to `typeinfo for YAML::InvalidNode'
ConfigReader.cpp:(.text._ZNK4YAML4Node6ScalarB5cxx11Ev[_ZNK4YAML4Node6ScalarB5cxx11Ev]+0x64): undefined reference to `YAML::detail::node_data::empty_scalar[abi:cxx11]'
bin/ccx_2.15.a(ConfigReader.o): In function `void YAML::Node::Assign<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ConfigReader.cpp:(.text._ZN4YAML4Node6AssignINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRKT_[_ZN4YAML4Node6AssignINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRKT_]+0x37): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4Node6AssignINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRKT_[_ZN4YAML4Node6AssignINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRKT_]+0x3c): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node::size() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node4sizeEv[_ZNK4YAML4Node4sizeEv]+0x33): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node4sizeEv[_ZNK4YAML4Node4sizeEv]+0x38): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [20]>(char const (&) [20])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA20_cEES0_RKT_[_ZN4YAML4NodeixIA20_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA20_cEES0_RKT_[_ZN4YAML4NodeixIA20_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > YAML::Node::as<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >() const':
ConfigReader.cpp:(.text._ZNK4YAML4Node2asINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEET_v[_ZNK4YAML4Node2asINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEET_v]+0x37): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZNK4YAML4Node2asINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEET_v[_ZNK4YAML4Node2asINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEET_v]+0x3c): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [13]>(char const (&) [13])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA13_cEES0_RKT_[_ZN4YAML4NodeixIA13_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA13_cEES0_RKT_[_ZN4YAML4NodeixIA13_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char*>(char* const&)':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIPcEES0_RKT_[_ZN4YAML4NodeixIPcEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIPcEES0_RKT_[_ZN4YAML4NodeixIPcEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [11]>(char const (&) [11])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA11_cEES0_RKT_[_ZN4YAML4NodeixIA11_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA11_cEES0_RKT_[_ZN4YAML4NodeixIA11_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<int>(int const&)':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIiEES0_RKT_[_ZN4YAML4NodeixIiEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIiEES0_RKT_[_ZN4YAML4NodeixIiEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [29]>(char const (&) [29])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA29_cEES0_RKT_[_ZN4YAML4NodeixIA29_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA29_cEES0_RKT_[_ZN4YAML4NodeixIA29_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [5]>(char const (&) [5])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA5_cEES0_RKT_[_ZN4YAML4NodeixIA5_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA5_cEES0_RKT_[_ZN4YAML4NodeixIA5_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [6]>(char const (&) [6])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA6_cEES0_RKT_[_ZN4YAML4NodeixIA6_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA6_cEES0_RKT_[_ZN4YAML4NodeixIA6_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::Node YAML::Node::operator[]<char [10]>(char const (&) [10])':
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA10_cEES0_RKT_[_ZN4YAML4NodeixIA10_cEES0_RKT_]+0x3b): undefined reference to `YAML::InvalidNode::~InvalidNode()'
ConfigReader.cpp:(.text._ZN4YAML4NodeixIA10_cEES0_RKT_[_ZN4YAML4NodeixIA10_cEES0_RKT_]+0x40): undefined reference to `typeinfo for YAML::InvalidNode'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node& YAML::detail::node_data::get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<YAML::detail::memory_holder>)':
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0xf6): undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder>)'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x11e): undefined reference to `YAML::BadSubscript::~BadSubscript()'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x123): undefined reference to `typeinfo for YAML::BadSubscript'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x277): undefined reference to `YAML::detail::node_data::insert_map_pair(YAML::detail::node&, YAML::detail::node&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node& YAML::detail::node_data::get<int>(int const&, std::shared_ptr<YAML::detail::memory_holder>)':
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0xf6): undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder>)'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x11e): undefined reference to `YAML::BadSubscript::~BadSubscript()'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x123): undefined reference to `typeinfo for YAML::BadSubscript'
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x277): undefined reference to `YAML::detail::node_data::insert_map_pair(YAML::detail::node&, YAML::detail::node&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node& YAML::detail::node_data::convert_to_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<YAML::detail::memory_holder>)':
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data15convert_to_nodeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data15convert_to_nodeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x56): undefined reference to `YAML::detail::memory_holder::merge(YAML::detail::memory_holder&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::detail::node& YAML::detail::node_data::convert_to_node<int>(int const&, std::shared_ptr<YAML::detail::memory_holder>)':
ConfigReader.cpp:(.text._ZN4YAML6detail9node_data15convert_to_nodeIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data15convert_to_nodeIiEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x56): undefined reference to `YAML::detail::memory_holder::merge(YAML::detail::memory_holder&)'
bin/ccx_2.15.a(ConfigReader.o): In function `YAML::TypedBadConversion<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~TypedBadConversion()':
ConfigReader.cpp:(.text._ZN4YAML18TypedBadConversionINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev[_ZN4YAML18TypedBadConversionINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED5Ev]+0x20): undefined reference to `YAML::BadConversion::~BadConversion()'
bin/ccx_2.15.a(ConfigReader.o):(.rodata._ZTIN4YAML18TypedBadConversionINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE[_ZTIN4YAML18TypedBadConversionINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x10): undefined reference to `typeinfo for YAML::BadConversion'
collect2: error: ld returned 1 exit status
make: *** [bin/ccx_preCICE] Error 1

In the CalculiX adapter Makefile, we specify CC=mpicc and FC = mpifort. Even though this is not needed by CalculiX, we currently use this to link to the MPI library, in case preCICE is used as a static library.

In your system, you use a user-installed compiler (GCC 9.2) and MPI (MPICH 3.2). CentOS 7 comes with GCC 4.8.5 (or at least that’s what I understood), with which yaml-cpp may have issues, especially if you mix too old and newer GCC versions. Check also this StackOverflow answer.

Can you check if your MPI compiler wrappers link to your GCC 9.2 installation? E.g. do:

mpicc --version
mpifort --version

You can also try explicitly setting the compiler in the Makefile, or installing preCICE using Spack.

It worked!!!
CC=$(which gcc) CXX=$(which g++) cmake -DBUILD_SHARED_LIBS=ON ..
This did the trick. Your point was right! It was taking older gcc version.
Thanks for your help!!!

1 Like