preCICE 2.4.0: building error with GCC 6 (fmtlib)

Hi there,

I faced a preCICE-2.4.0 installation problem. Any help or suggestions would be greatly appreciated!

  • preCICE 2.4.0
  • Cirrus
  • Building with CMake (version: 3.17.3)
  • GCC (version: 6.2.0)
  • Boost (version: 1.73.0)
  • Eigen (version: 3.3.9)

Following the tutorial on the official website, I have completed the configuration step using following command:

cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0 -DPRECICE_PETScMapping=OFF -DPRECICE_PythonActions=OFF ā€¦

However, when building from source make -j 4 in the next step, I got the following error:

ā€“ Found Git: /scratch/sw/git/2.35.1/bin/git (found version ā€œ2.35.1ā€)
ā€“ Revision status: Detection failed
[ 0%] Built target GitRevision
[ 0%] Building CXX object CMakeFiles/precice.dir/src/acceleration/Acceleration.cpp.o
[ 0%] Building CXX object CMakeFiles/precice.dir/src/acceleration/AitkenAcceleration.cpp.o
[ 1%] Building CXX object CMakeFiles/precice.dir/src/acceleration/BaseQNAcceleration.cpp.o
[ 1%] Building CXX object CMakeFiles/precice.dir/src/acceleration/BroydenAcceleration.cpp.o
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:12:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/BroydenAcceleration.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/BroydenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmtEigen.hpp:8:13: error: specialization of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ in different namespace [-fpermissive]
struct fmt::formatter<Eigen::Matrix<Scalar, RowsAtCompileTime, ColsAtCompileTime>> : formatter<string_view> {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:12:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
ā€¦
ā€¦
ā€¦
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmtSTL.hpp:39:13: error: specialization of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ in different namespace [-fpermissive]
struct fmt::formatter<std::set<T, Compare, Allocator>> : formatter<string_view> {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/format.h:48:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:10,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/BroydenAcceleration.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/BroydenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/core.h:707:8: error: from definition of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ [-fpermissive]
struct formatter {
^~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:13:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/BroydenAcceleration.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/BroydenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmtSTL.hpp:49:13: error: specialization of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ in different namespace [-fpermissive]
struct fmt::formatter<std::map<T, Compare, Allocator>> : formatter<string_view> {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/format.h:48:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:10,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/BroydenAcceleration.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/BroydenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/core.h:707:8: error: from definition of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ [-fpermissive]
struct formatter {
^~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:13:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmtSTL.hpp:29:13: error: specialization of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ in different namespace [-fpermissive]
struct fmt::formatter<std::array<T, n>> : formatter<string_view> {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/format.h:48:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:10,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.hpp:8,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/core.h:707:8: error: from definition of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ [-fpermissive]
struct formatter {
^~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:13:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.hpp:8,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmtSTL.hpp:39:13: error: specialization of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ in different namespace [-fpermissive]
struct fmt::formatter<std::set<T, Compare, Allocator>> : formatter<string_view> {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/format.h:48:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:10,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.hpp:8,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/core.h:707:8: error: from definition of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ [-fpermissive]
struct formatter {
^~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:13:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.hpp:8,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmtSTL.hpp:49:13: error: specialization of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ in different namespace [-fpermissive]
struct fmt::formatter<std::map<T, Compare, Allocator>> : formatter<string_view> {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/format.h:48:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:10,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.hpp:8,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/core.h:707:8: error: from definition of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ [-fpermissive]
struct formatter {
^~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:13:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.hpp:8,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmtSTL.hpp:59:13: error: specialization of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ in different namespace [-fpermissive]
struct fmt::formatter<std::pair<F, S>> : formatter<string_view> {
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/format.h:48:0,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/utils/fmt.hpp:10,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/LogMacros.hpp:3,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/logging/Logger.hpp:52,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/impl/Extrapolation.hpp:4,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/CouplingData.hpp:6,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/cplscheme/BaseCouplingScheme.hpp:11,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/Acceleration.hpp:7,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.hpp:8,
from /work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/src/acceleration/AitkenAcceleration.cpp:1:
/work/ec055/ec055/yhuang94/Dependencies/precice-2.4.0/thirdparty/fmt/include/fmt/core.h:707:8: error: from definition of ā€˜template<class T, class Char, class Enable> struct fmt::v8::formatterā€™ [-fpermissive]
struct formatter {
^~~~~~~~~
make[2]: *** [CMakeFiles/precice.dir/build.make:135: CMakeFiles/precice.dir/src/acceleration/BroydenAcceleration.cpp.o] Error 1
make[2]: *** [CMakeFiles/precice.dir/build.make:122: CMakeFiles/precice.dir/src/acceleration/BaseQNAcceleration.cpp.o] Error 1
make[2]: *** [CMakeFiles/precice.dir/build.make:109: CMakeFiles/precice.dir/src/acceleration/AitkenAcceleration.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:274: CMakeFiles/precice.dir/all] Error 2
make: *** [Makefile:183: all] Error 2

Limited by total characters, attached is the complete compilation log file.
make.log (74.0 KB)
Is there anyone have some ideas abut it? Thanks in advance.

Looks like the compiler complains about fmtlib. Which confuses me, since fmtlib seems to compile with GCC 6.2.

Maybe @fsimonis has a better idea here.

@yhuang Looks like you are hitting a compiler bug present until GCC 7.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480

Can you use a newer GCC version?

Hi @Makis and @fsimonis

Thank you very much for your help. After using a new GCC version (8.2.0), the preCICE-2.4.0 installation is completed. However, when it was used to perform FSI simulation, an error occurs:

ccx_preCICE: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory

Do you have any idea about it? Many thanks in advance!

This sounds related to changing the compiler versions. Since gfortran comes from GCC, you need to have the same compiler version (and preferably only that) available at build and at run time.

Many thanks for your suggestions!! I recompiled the CalculiX adapter with GCC 8.2.0, then no errors were reported.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.