E3SM-Project / scorpio

A high-level Parallel I/O Library for structured grid applications
19 stars 16 forks source link

Conflict btw YAML modules in EKAT and ADIOS causes build failure #534

Closed jayeshkrishna closed 11 months ago

jayeshkrishna commented 11 months ago

@whannah1 found that his builds using EKAT (while merging a development branch with EKAT to E3SM master) were failing due to conflict between YAML modules in EKAT and ADIOS. The build error is shown below,

../../externals/yaml-cpp/libyaml-cpp.a(node_data.cpp.o): In function `YAML::detail::node_data::empty_scalar[abi:cxx11]()':
node_data.cpp:(.text+0x0): multiple definition of `YAML::detail::node_data::empty_scalar[abi:cxx11]()'
/gpfs/alpine/cli115/world-shared/3rdparty/adios2/2.8.3.patch/spectrum-mpi-10.4.0.3/gcc-9.1.0/lib64/libadios2_core.a(node_data.cpp.o):/gpfs/alpine/cli115/world-shared/3rdparty/source_install/ADIOS2-2.8.3/thirdparty/yaml-cpp/yaml-cpp/src/node_data.cpp:18: first defined here

The workaround was to disable ADIOS in SCORPIO configure step

jayeshkrishna commented 11 months ago

Suggestion from @tkurc ,

Set ADIOS2_USE_EXTERNAL_YAMLCPP to ON when configuring with cmake. It may solve the compilation issue.    

Thirdparty/CMakeLists.txt

option(ADIOS2_USE_EXTERNAL_YAMLCPP
  "Use an externally supplied yaml-cpp library" "${ADIOS2_USE_EXTERNAL_DEPENDENCIES}")
jayeshkrishna commented 11 months ago

For now, @whannah1 has been able to build EKAT without YAML (the YAML support in EKAT is not required for E3SM runs) and is a workaround for this issue. Also, the suggestion from @tkurc to use the YAML installs on the system (as an external library) also works for SCORPIO. Unfortunately EKAT at this time does not support YAML as a TPL. This issue can be closed for now, but the ultimate solution is to move YAML as a TPL that is available on all E3SM machines and ensure that all components (EKAT, SCORPIO/ADIOS) use it (instead of building their own version of YAML).