Problem linking adapted CalculiX against yaml-cpp (macOS)

Dear preCICE community,

I tried to build the adapted CalculiX on macOS. I successfully built CalculiX itself, but for some bizarre reason, it complains that it cannot link with yaml-cpp.

Here’s the output of the command:

mpif90 -fopenmp -Wall -O3 -o bin/ccx_preCICE bin/ccx_2.20.o bin/ccx_2.20.a /Volumes/SourceCode/software/CalculiX/ccx_2.20/ThirdParty/SPOOLES.2.2/spooles.a /Volumes/SourceCode/software/CalculiX/ccx_2.20/ThirdParty/SPOOLES.2.2/MT/src/spoolesMT.a -L/Users/ali/.local/lib -lprecice `pkg-config --libs yaml-cpp` -lstdc++ -L/opt/homebrew/Cellar/arpack/3.9.1_1/lib -larpack -llapack -lblas -lpthread -lm -lc
Undefined symbols for architecture arm64:
  "YAML::detail::node_data::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)", referenced from:
      YAML::detail::node& YAML::detail::node::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>) in ccx_2.20.a[1123](ConfigReader.o)
      YAML::detail::node& YAML::detail::node_data::get<int>(int const&, std::shared_ptr<YAML::detail::memory_holder>) in ccx_2.20.a[1123](ConfigReader.o)
  "YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder>)", referenced from:
      YAML::detail::node& YAML::detail::node::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>) in ccx_2.20.a[1123](ConfigReader.o)
      YAML::detail::node& YAML::detail::node_data::get<int>(int const&, std::shared_ptr<YAML::detail::memory_holder>) in ccx_2.20.a[1123](ConfigReader.o)
  "YAML::LoadFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)", referenced from:
      _ConfigReader_Read in ccx_2.20.a[1123](ConfigReader.o)
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status

I tried using two different versions of yaml-cpp, but neither worked. The path to the header files and libraries was correct, as determined by pkg-config --libs yaml-cpp. Using LSP, I can jump to the declarations in the header files. Also, the shared library contains all these symbols, which I confirmed using nm -C /path/to/lib | grep symbolName. I also tried to put the link flag -lyaml-cpp at different orders, but it too didn’t help.

At this point, I’m not sure what I’m missing. I would greatly appreciate it if anyone could help me identify the issue.

System and tools information:

  • CalculiX: 2.20 (Using the one mentioned in the preCICE documentation)
  • Adapted CalculiX: The one that is currently mentioned in the docs (probably 2.20)
  • preCICE: v3.1.2
  • Operating system: macOS Sonoma 14.7.1
  • Installation method: Compilation from source
  • Dependency versions:
    • Homebrew GCC 14.2.0
    • Homebrew Clang 19.1.2
    • Open MPI: stable 5.0.6
    • PETSc: stable 3.22.2
    • yaml-cpp:
      • 0.8.0 (Homebrew)
      • 0.6.0 (built from source)