OpenMC source installation error

Hello everyone, I am trying to install OpenMC from source using ubuntu bash (version 20.04) on windows 10. Following the steps, I am getting the following when arriving to “make”:

[ 98%] Linking CXX executable bin/openmc
/usr/bin/ld: lib/libopenmc.so: undefined reference to int fmt::v6::internal::snprintf_float<long double>(long double, int, fmt::v6::internal::float_specs, fmt::v6::internal::buffer<char>&)' /usr/bin/ld: lib/libopenmc.so: undefined reference to fmt::v6::format_error::~format_error()’
/usr/bin/ld: lib/libopenmc.so: undefined reference to typeinfo for fmt::v6::format_error' /usr/bin/ld: lib/libopenmc.so: undefined reference to fmt::v6::vprint(fmt::v6::basic_string_view, fmt::v6::format_args)’
/usr/bin/ld: lib/libopenmc.so: undefined reference to fmt::v6::internal::error_handler::on_error(char const*)' /usr/bin/ld: lib/libopenmc.so: undefined reference to char fmt::v6::internal::thousands_sep_impl(fmt::v6::internal::locale_ref)’
/usr/bin/ld: lib/libopenmc.so: undefined reference to fmt::v6::internal::basic_data<void>::hex_digits' /usr/bin/ld: lib/libopenmc.so: undefined reference to fmt::v6::vprint(_IO_FILE*, fmt::v6::basic_string_view, fmt::v6::format_args)’
/usr/bin/ld: lib/libopenmc.so: undefined reference to fmt::v6::internal::basic_data<void>::digits' /usr/bin/ld: lib/libopenmc.so: undefined reference to int fmt::v6::internal::snprintf_float(double, int, fmt::v6::internal::float_specs, fmt::v6::internal::buffer&)’
/usr/bin/ld: lib/libopenmc.so: undefined reference to fmt::v6::internal::basic_data<void>::signs' /usr/bin/ld: lib/libopenmc.so: undefined reference to fmt::v6::internal::basic_data::zero_or_powers_of_10_32’
/usr/bin/ld: lib/libopenmc.so: undefined reference to int fmt::v6::internal::format_float<double>(double, int, fmt::v6::internal::float_specs, fmt::v6::internal::buffer<char>&)' /usr/bin/ld: lib/libopenmc.so: undefined reference to int fmt::v6::internal::format_float(long double, int, fmt::v6::internal::float_specs, fmt::v6::internal::buffer&)’
/usr/bin/ld: lib/libopenmc.so: undefined reference to fmt::v6::internal::basic_data<void>::zero_or_powers_of_10_64' /usr/bin/ld: lib/libopenmc.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator > fmt::v6::internal::grouping_impl(fmt::v6::internal::locale_ref)’
/usr/bin/ld: lib/libopenmc.so: undefined reference to char fmt::v6::internal::decimal_point_impl<char>(fmt::v6::internal::locale_ref)' /usr/bin/ld: lib/libopenmc.so: undefined reference to vtable for fmt::v6::format_error’
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/openmc.dir/build.make:96: bin/openmc] Error 1
make[1]: *** [CMakeFiles/Makefile2:216: CMakeFiles/openmc.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I do not know how to proceed with this. Hope you can help me and guide me to have a succesfull installation. Thank you.

Regards

Juan Galicia Aragón

Hi @Juan_GaliciaA and welcome to the community! Sorry to hear you’re running into trouble getting OpenMC compiled. Can you paste the output of running cmake? The errors shown here are related to fmtlib, which is a dependency we rely on for writing output, and the output from cmake will give some information about where it is finding fmtlib.

Hi Paul, thank you for your reply. Of course, I get the following after running cmake:

– The C compiler identification is GNU 9.3.0
– The CXX compiler identification is GNU 9.3.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– No build type selected, defaulting to RelWithDebInfo
– Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version “1.2.11”)
– Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version “1.6.37”)
– HDF5: Using hdf5 compiler wrapper to determine C configuration
– Found HDF5: /home/jgalicia/miniconda3/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/jgalicia/miniconda3/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version “1.10.6”) found components: C HL
– Found OpenMP_C: -fopenmp (found version “4.5”)
– Found OpenMP_CXX: -fopenmp (found version “4.5”)
– Found OpenMP: TRUE (found version “4.5”)
– OpenMC C++ flags: -fopenmp
– OpenMC Linker flags: -fopenmp
– Found Git: /usr/bin/git (found version “2.25.1”)
– Submodule update
– Did not find pugixml, will use submodule instead
– Did not find fmt, will use submodule instead
– Module support is disabled.
– Version: 8.0.1
– Build type: RelWithDebInfo
– CXX_STANDARD: 11
– Performing Test has_std_11_flag
– Performing Test has_std_11_flag - Success
– Performing Test has_std_0x_flag
– Performing Test has_std_0x_flag - Success
– Performing Test SUPPORTS_USER_DEFINED_LITERALS
– Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
– Performing Test FMT_HAS_VARIANT
– Performing Test FMT_HAS_VARIANT - Success
– Required features: cxx_variadic_templates
– Looking for strtod_l
– Looking for strtod_l - not found
– Did not find xtensor, will use submodule instead
– xtl v0.6.13
– Building xtensor v0.21.3
– Found xtl v0.6.13
– Did not find gsl-lite, will use submodule instead
– Project ‘gsl_lite’, package ‘gsl-lite’ version: ‘0.36.1’
– Configuring done
CMake Warning at CMakeLists.txt:501 (add_executable):
Cannot generate a safe runtime search path for target openmc because files
in some directories may conflict with libraries in implicit directories:

runtime library [libpng16.so.16] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/jgalicia/miniconda3/lib
runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/jgalicia/miniconda3/lib

Some of these libraries may not be found correctly.

CMake Warning at CMakeLists.txt:412 (add_library):
Cannot generate a safe runtime search path for target libopenmc because
files in some directories may conflict with libraries in implicit
directories:

runtime library [libpng16.so.16] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/jgalicia/miniconda3/lib
runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/jgalicia/miniconda3/lib

Some of these libraries may not be found correctly.

– Generating done
– Build files have been written to: /mnt/c/openmc/build

Thank you very much again

Regards

Juan Galicia Aragón

I don’t see anything obviously wrong here. It looks like there is no pre-existing installation of fmtlib and OpenMC is trying to use it’s own internal version. I would suggest updating your version of OpenMC from source (git pull) and trying again to see if that gets rid of the build errors.