gcc 10 compilation fails
Summary
Compiling with gcc 10 fails at linking stage with many errors of the form:
/usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x0): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianApplyBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x0): first defined here
Steps to reproduce
Compile with gcc 10
What is the current bug behaviour?
Compile fails at linker stage
What is the expected correct behaviour?
Compile works
Relevant logs, screenshots, files...?
Anything that helps reproducing the bug
Expand to see logs
cmake --build . -- [3/18] Building CXX object src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o In file included from /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid.hh:4, from ../dune/copasi/grid/multidomain_gmsh_reader.hh:8, from ../src/dune_copasi_sd.cc:7: /home/lkeegan/BIOQUANT/dune/dune-common/dune/common/parallel/collectivecommunication.hh:2:2: warning: #warning "Deprecated header, use #include instead!" [-Wcpp] 2 | #warning "Deprecated header, use #include instead!" | ^~~~~~~ [4/18] Building CXX object src/CMakeFiles/dune_copasi_md.dir/dune_copasi_md.cc.o In file included from /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid.hh:4, from ../dune/copasi/grid/multidomain_gmsh_reader.hh:8, from ../src/dune_copasi_md.cc:7: /home/lkeegan/BIOQUANT/dune/dune-common/dune/common/parallel/collectivecommunication.hh:2:2: warning: #warning "Deprecated header, use #include instead!" [-Wcpp] 2 | #warning "Deprecated header, use #include instead!" | ^~~~~~~ [5/18] Building CXX object lib/CMakeFiles/dune_copasi_sd_lib_fv.dir/dune_copasi_sd_fv.cc.o In file included from /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid.hh:4, from ../lib/dune_copasi_sd.hh:7, from ../lib/dune_copasi_sd_fv.cc:5: /home/lkeegan/BIOQUANT/dune/dune-common/dune/common/parallel/collectivecommunication.hh:2:2: warning: #warning "Deprecated header, use #include instead!" [-Wcpp] 2 | #warning "Deprecated header, use #include instead!" | ^~~~~~~ In file included from /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid.hh:5, from ../lib/dune_copasi_sd.hh:7, from ../lib/dune_copasi_sd_fv.cc:5: /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid/multidomaingrid.hh: In instantiation of ‘class Dune::mdgrid::MultiDomainGrid, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >’: ../lib/dune_copasi_sd.hh:19:29: required from here /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid/multidomaingrid.hh:225:7: warning: ‘Dune::mdgrid::MultiDomainGrid, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >’ has a base ‘Dune::mdgrid::{anonymous}::MaxSubDomainIndexProvider, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >, int, false>’ whose type uses the anonymous namespace [-Wsubobject-linkage] 225 | class MultiDomainGrid | ^~~~~~~~~~~~~~~ [7/18] Building CXX object lib/CMakeFiles/dune_copasi_sd_lib_cg.dir/dune_copasi_sd_cg.cc.o In file included from /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid.hh:4, from ../lib/dune_copasi_sd.hh:7, from ../lib/dune_copasi_sd_cg.cc:5: /home/lkeegan/BIOQUANT/dune/dune-common/dune/common/parallel/collectivecommunication.hh:2:2: warning: #warning "Deprecated header, use #include instead!" [-Wcpp] 2 | #warning "Deprecated header, use #include instead!" | ^~~~~~~ In file included from /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid.hh:5, from ../lib/dune_copasi_sd.hh:7, from ../lib/dune_copasi_sd_cg.cc:5: /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid/multidomaingrid.hh: In instantiation of ‘class Dune::mdgrid::MultiDomainGrid, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >’: ../lib/dune_copasi_sd.hh:19:29: required from here /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid/multidomaingrid.hh:225:7: warning: ‘Dune::mdgrid::MultiDomainGrid, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >’ has a base ‘Dune::mdgrid::{anonymous}::MaxSubDomainIndexProvider, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >, int, false>’ whose type uses the anonymous namespace [-Wsubobject-linkage] 225 | class MultiDomainGrid | ^~~~~~~~~~~~~~~ [9/18] Building CXX object lib/CMakeFiles/dune_copasi_sd_lib_fv_cg.dir/dune_copasi_sd_fv_cg.cc.o In file included from /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid.hh:4, from ../lib/dune_copasi_sd.hh:7, from ../lib/dune_copasi_sd_fv_cg.cc:5: /home/lkeegan/BIOQUANT/dune/dune-common/dune/common/parallel/collectivecommunication.hh:2:2: warning: #warning "Deprecated header, use #include instead!" [-Wcpp] 2 | #warning "Deprecated header, use #include instead!" | ^~~~~~~ In file included from /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid.hh:5, from ../lib/dune_copasi_sd.hh:7, from ../lib/dune_copasi_sd_fv_cg.cc:5: /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid/multidomaingrid.hh: In instantiation of ‘class Dune::mdgrid::MultiDomainGrid, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >’: ../lib/dune_copasi_sd.hh:19:29: required from here /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid/multidomaingrid.hh:225:7: warning: ‘Dune::mdgrid::MultiDomainGrid, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >’ has a base ‘Dune::mdgrid::{anonymous}::MaxSubDomainIndexProvider, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >, int, false>’ whose type uses the anonymous namespace [-Wsubobject-linkage] 225 | class MultiDomainGrid | ^~~~~~~~~~~~~~~ [11/18] Linking CXX executable src/dune_copasi_sd FAILED: src/dune_copasi_sd : && /usr/bin/g++ -std=c++17 -fcommon -O3 -DNDEBUG -fcommon -Wl,-no-as-needed -pthread -Wl,-no-as-needed -pthread -rdynamic src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o -o src/dune_copasi_sd /home/lkeegan/BIOQUANT/dune/dune-logging/build-cmake/lib/libdune-logging.a /home/lkeegan/BIOQUANT/dune/dune-pdelab/build-cmake/lib/libdunepdelab.a /home/lkeegan/BIOQUANT/dune/dune-grid/build-cmake/lib/libdunegrid.a /home/lkeegan/BIOQUANT/dune/dune-geometry/build-cmake/lib/libdunegeometry.a /home/lkeegan/BIOQUANT/dune/dune-uggrid/build-cmake/lib/libugS3.a /home/lkeegan/BIOQUANT/dune/dune-uggrid/build-cmake/lib/libugS2.a /home/lkeegan/BIOQUANT/dune/dune-uggrid/build-cmake/lib/libugL.a /home/lkeegan/BIOQUANT/dune/dune-common/build-cmake/lib/libdunecommon.a /home/lkeegan/BIOQUANT/dune/dune-grid/build-cmake/lib/libdunegrid.a /home/lkeegan/BIOQUANT/dune/dune-geometry/build-cmake/lib/libdunegeometry.a /home/lkeegan/BIOQUANT/dune/dune-uggrid/build-cmake/lib/libugS3.a /home/lkeegan/BIOQUANT/dune/dune-uggrid/build-cmake/lib/libugS2.a /home/lkeegan/BIOQUANT/dune/dune-uggrid/build-cmake/lib/libugL.a /home/lkeegan/BIOQUANT/dune/dune-common/build-cmake/lib/libdunecommon.a -lquadmath -Wl,-Bstatic -lgmp -lgmpxx lib/libdune_copasi_sd_lib_fv.a lib/libdune_copasi_sd_lib_cg.a lib/libdune_copasi_sd_lib_fv_cg.a lib/libdune_copasi_lib.a /home/lkeegan/BIOQUANT/dune/dune-logging/build-cmake/lib/libdune-logging.a /home/lkeegan/install/lib/libfmt.a /home/lkeegan/BIOQUANT/dune/dune-pdelab/build-cmake/lib/libdunepdelab.a /home/lkeegan/BIOQUANT/dune/dune-grid/build-cmake/lib/libdunegrid.a /home/lkeegan/BIOQUANT/dune/dune-geometry/build-cmake/lib/libdunegeometry.a /home/lkeegan/BIOQUANT/dune/dune-uggrid/build-cmake/lib/libugS3.a /home/lkeegan/BIOQUANT/dune/dune-uggrid/build-cmake/lib/libugS2.a /home/lkeegan/BIOQUANT/dune/dune-uggrid/build-cmake/lib/libugL.a /home/lkeegan/BIOQUANT/dune/dune-common/build-cmake/lib/libdunecommon.a -Wl,-Bdynamic -lquadmath -Wl,-Bstatic -lgmp -lgmpxx -Wl,-Bdynamic /home/lkeegan/install/lib/libtiff.a /home/lkeegan/install/lib/libmuparser.a && : /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x0): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianApplyBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x0): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x1): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianApplySkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x1): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x2): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianApplyVolumePostSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x2): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x3): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianApplyVolume'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x3): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x4): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x4): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x5): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x5): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x6): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianVolumePostSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x6): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x7): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianVolume'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x7): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x8): multiple definition of `Dune::Copasi::LocalOperatorApply::lambdaBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x8): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x9): multiple definition of `Dune::Copasi::LocalOperatorApply::lambdaSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x9): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0xa): multiple definition of `Dune::Copasi::LocalOperatorApply::lambdaVolumePostSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xa): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0xb): multiple definition of `Dune::Copasi::LocalOperatorApply::lambdaVolume'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xb): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0xc): multiple definition of `Dune::Copasi::LocalOperatorApply::alphaBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xc): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0xd): multiple definition of `Dune::Copasi::LocalOperatorApply::alphaSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xd): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0xe): multiple definition of `Dune::Copasi::LocalOperatorApply::alphaVolumePostSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xe): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0xf): multiple definition of `Dune::Copasi::LocalOperatorApply::alphaVolume'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xf): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x10): multiple definition of `Dune::Copasi::LocalOperatorApply::patternBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x10): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x11): multiple definition of `Dune::Copasi::LocalOperatorApply::patternSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x11): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x12): multiple definition of `Dune::Copasi::LocalOperatorApply::patternVolumePostSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x12): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv.a(dune_copasi_sd_fv.cc.o):(.bss+0x13): multiple definition of `Dune::Copasi::LocalOperatorApply::patternVolume'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x13): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x0): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianApplyBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x0): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x1): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianApplySkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x1): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x2): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianApplyVolumePostSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x2): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x3): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianApplyVolume'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x3): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x4): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x4): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x5): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x5): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x6): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianVolumePostSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x6): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x7): multiple definition of `Dune::Copasi::LocalOperatorApply::jacobianVolume'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x7): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x8): multiple definition of `Dune::Copasi::LocalOperatorApply::lambdaBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x8): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x9): multiple definition of `Dune::Copasi::LocalOperatorApply::lambdaSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x9): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0xa): multiple definition of `Dune::Copasi::LocalOperatorApply::lambdaVolumePostSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xa): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0xb): multiple definition of `Dune::Copasi::LocalOperatorApply::lambdaVolume'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xb): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0xc): multiple definition of `Dune::Copasi::LocalOperatorApply::alphaBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xc): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0xd): multiple definition of `Dune::Copasi::LocalOperatorApply::alphaSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xd): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0xe): multiple definition of `Dune::Copasi::LocalOperatorApply::alphaVolumePostSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xe): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0xf): multiple definition of `Dune::Copasi::LocalOperatorApply::alphaVolume'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0xf): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x10): multiple definition of `Dune::Copasi::LocalOperatorApply::patternBoundary'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x10): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x11): multiple definition of `Dune::Copasi::LocalOperatorApply::patternSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x11): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x12): multiple definition of `Dune::Copasi::LocalOperatorApply::patternVolumePostSkeleton'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x12): first defined here /usr/bin/ld: lib/libdune_copasi_sd_lib_fv_cg.a(dune_copasi_sd_fv_cg.cc.o):(.bss+0x13): multiple definition of `Dune::Copasi::LocalOperatorApply::patternVolume'; src/CMakeFiles/dune_copasi_sd.dir/dune_copasi_sd.cc.o:(.bss+0x13): first defined here collect2: error: ld returned 1 exit status
Ideas how to fix this?
Might be related to the fact that MaxSubDomainIndexProvider
is defined within an anonymous namespace:
Which gives this compilation warning:
In file included from /home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid.hh:5,
from ../lib/dune_copasi_sd.hh:7,
from ../lib/dune_copasi_sd_fv_cg.cc:5:
/home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid/multidomaingrid.hh: In instantiation of ‘class Dune::mdgrid::MultiDomainGrid<Dune::UGGrid<2>, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >’:
../lib/dune_copasi_sd.hh:19:29: required from here
/home/lkeegan/BIOQUANT/dune/dune-multidomaingrid/dune/grid/multidomaingrid/multidomaingrid.hh:225:7: warning: ‘Dune::mdgrid::MultiDomainGrid<Dune::UGGrid<2>, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >’ has a base ‘Dune::mdgrid::{anonymous}::MaxSubDomainIndexProvider<Dune::mdgrid::MultiDomainGrid<Dune::UGGrid<2>, Dune::mdgrid::DynamicSubDomainCountTraits<2, 1> >, int, false>’ whose type uses the anonymous namespace [-Wsubobject-linkage]
And I think means that two of these objects, if they are instantiated in different cpp files, will be of different type due to the anonymous namespace being different for each each cpp file, which might be causing the multiple definition errors.