sandialabs / seacas

The Sandia Engineering Analysis Code Access System (SEACAS) is a suite of preprocessing, postprocessing, translation, and utility applications supporting finite element analysis software using the Exodus database file format.
Other
136 stars 79 forks source link

Build error in "Linking CXX executable struc_to_unstruc" #422

Closed gsjaardema closed 7 months ago

gsjaardema commented 11 months ago

Discussed in https://github.com/sandialabs/seacas/discussions/417

Originally posted by **erdchris** November 4, 2023 Hello. I'm trying to build the latest SEACAS under RHEL 8.8 using Intel 2022.2.0 (and GCC 8.2.0). Build dies here: [ 43%] Linking CXX executable struc_to_unstruc CMakeFiles/struc_to_unstruc.dir/struc_to_unstruc.C.o: In function `main': struc_to_unstruc.C:(.text+0x97): undefined reference to `fmt::v10::vprint(_IO_FILE*, fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' struc_to_unstruc.C:(.text+0x271): undefined reference to `fmt::v10::vprint(_IO_FILE*, fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' struc_to_unstruc.C:(.text+0x4c1): undefined reference to `fmt::v10::vprint(_IO_FILE*, fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' struc_to_unstruc.C:(.text+0x504): undefined reference to `fmt::v10::vprint(_IO_FILE*, fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' CMakeFiles/struc_to_unstruc.dir/struc_to_unstruc.C.o: In function `(anonymous namespace)::create_unstructured(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)': struc_to_unstruc.C:(.text+0x866): undefined reference to `fmt::v10::vprint(_IO_FILE*, fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' CMakeFiles/struc_to_unstruc.dir/struc_to_unstruc.C.o:struc_to_unstruc.C:(.text+0xb7b): more undefined references to `fmt::v10::vprint(_IO_FILE*, fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' follow CMakeFiles/struc_to_unstruc.dir/struc_to_unstruc.C.o: In function `(anonymous namespace)::create_unstructured(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)': struc_to_unstruc.C:(.text+0xedb): undefined reference to `fmt::v10::vprint(fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' struc_to_unstruc.C:(.text+0x1014): undefined reference to `fmt::v10::vprint(_IO_FILE*, fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' struc_to_unstruc.C:(.text+0x140e): undefined reference to `fmt::v10::vprint(_IO_FILE*, fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' CMakeFiles/struc_to_unstruc.dir/struc_to_unstruc.C.o: In function `(anonymous namespace)::transfer_sidesets(Ioss::Region&, Ioss::Region&)': struc_to_unstruc.C:(.text+0x4e92): undefined reference to `fmt::v10::vprint(fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' CMakeFiles/struc_to_unstruc.dir/struc_to_unstruc.C.o: In function `(anonymous namespace)::transfer_nodeblock(Ioss::Region&, Ioss::Region&)': struc_to_unstruc.C:(.text+0x58a7): undefined reference to `fmt::v10::vprint(fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' struc_to_unstruc.C:(.text+0x58f1): undefined reference to `fmt::v10::vprint(fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' CMakeFiles/struc_to_unstruc.dir/struc_to_unstruc.C.o: In function `char const* fmt::v10::detail::parse_format_specs(char const*, char const*, fmt::v10::detail::dynamic_format_specs&, fmt::v10::basic_format_parse_context&, fmt::v10::detail::type)': struc_to_unstruc.C:(.text._ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE[_ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE]+0x951): undefined reference to `fmt::v10::detail::throw_format_error(char const*)' struc_to_unstruc.C:(.text._ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE[_ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE]+0xcfe): undefined reference to `fmt::v10::detail::throw_format_error(char const*)' struc_to_unstruc.C:(.text._ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE[_ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE]+0xe48): undefined reference to `fmt::v10::detail::throw_format_error(char const*)' struc_to_unstruc.C:(.text._ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE[_ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE]+0xe6e): undefined reference to `fmt::v10::detail::throw_format_error(char const*)' struc_to_unstruc.C:(.text._ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE[_ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE]+0xf91): undefined reference to `fmt::v10::detail::throw_format_error(char const*)' CMakeFiles/struc_to_unstruc.dir/struc_to_unstruc.C.o:struc_to_unstruc.C:(.text._ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE[_ZN3fmt3v106detail18parse_format_specsIcEEPKT_S5_S5_RNS1_20dynamic_format_specsIS3_EERNS0_26basic_format_parse_contextIS3_EENS1_4typeE]+0x1044): more undefined references to `fmt::v10::detail::throw_format_error(char const*)' follow libio_info_lib.so.2.0: undefined reference to `fmt::v10::detail::dragonbox::get_cached_power(int)' libio_info_lib.so.2.0: undefined reference to `std::locale fmt::v10::detail::locale_ref::get() const' libio_info_lib.so.2.0: undefined reference to `char fmt::v10::detail::decimal_point_impl(fmt::v10::detail::locale_ref)' libio_info_lib.so.2.0: undefined reference to `void fmt::v10::detail::vformat_to(fmt::v10::detail::buffer&, fmt::v10::basic_string_view, fmt::v10::detail::vformat_args::type, fmt::v10::detail::locale_ref)' libio_info_lib.so.2.0: undefined reference to `fmt::v10::detail::is_printable(unsigned int)' libio_info_lib.so.2.0: undefined reference to `fmt::v10::detail::dragonbox::decimal_fp fmt::v10::detail::dragonbox::to_decimal(double)' libio_info_lib.so.2.0: undefined reference to `fmt::v10::detail::dragonbox::decimal_fp fmt::v10::detail::dragonbox::to_decimal(float)' ../cgns/libIocgns.so.2.0: undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view, fmt::v10::basic_format_args >)' libio_info_lib.so.2.0: undefined reference to `fmt::v10::detail::thousands_sep_result fmt::v10::detail::thousands_sep_impl(fmt::v10::detail::locale_ref)' libio_info_lib.so.2.0: undefined reference to `fmt::v10::detail::write_loc(fmt::v10::appender, fmt::v10::loc_value, fmt::v10::format_specs const&, fmt::v10::detail::locale_ref)' ../libIoss.so.2.0: undefined reference to `fmt::v10::detail::print(_IO_FILE*, fmt::v10::basic_string_view)'
gsjaardema commented 11 months ago

There seems to be some issue with the intel compiler and linking to the shared libfmt.so library.

I have been able to get it to work using the header-only version. In cmake-config try making the following change:

  if [ "$COMPILER" == "intel" ]
  then
      CXX=icx
      CC=icx
      FC=ifx
      CFLAGS="-Wall -Wunused"
      CXXFLAGS="-Wall -Wextra  -Wunused -DFMT_HEADER_ONLY"
  fi

(i.e., add -DFMT_HEADER_ONLY to the CXXFLAGS)

This is not a final fix, but is a workaround for now...