dealii icon indicating copy to clipboard operation
dealii copied to clipboard

Undefined references when linking with ld.lld

Open tamiko opened this issue 2 years ago • 1 comments

ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutInterface<1, 1>::validate_dataset_names() const [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<1, 1>::no_neighbor [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<1, 1>::Patch() [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<1, 1>::swap(dealii::DataOutBase::Patch<1, 1>&) [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutInterface<1, 2>::validate_dataset_names() const [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<1, 2>::no_neighbor [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<1, 2>::Patch() [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<1, 2>::swap(dealii::DataOutBase::Patch<1, 2>&) [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutInterface<2, 2>::validate_dataset_names() const [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<2, 2>::no_neighbor [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<2, 2>::Patch() [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<2, 2>::swap(dealii::DataOutBase::Patch<2, 2>&) [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutInterface<2, 3>::validate_dataset_names() const [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<2, 3>::no_neighbor [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<2, 3>::Patch() [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<2, 3>::swap(dealii::DataOutBase::Patch<2, 3>&) [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutInterface<3, 3>::validate_dataset_names() const [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<3, 3>::no_neighbor [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<3, 3>::Patch() [--no-allow-shlib-undefined]
ld.lld: error: /home/tamiko/workspace/dealii/build/lib/libdeal_II.g.so.9.5.0-pre: undefined reference to dealii::DataOutBase::Patch<3, 3>::swap(dealii::DataOutBase::Patch<3, 3>&) [--no-allow-shlib-undefined]
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)

tamiko avatar Aug 24 '22 21:08 tamiko

Setting DEAL_II_LINKER_FLAGS="-Wl,--allow-shlib-undefined" works around the issue. Ideally, however, we should fix all undefined references.

tamiko avatar Aug 24 '22 22:08 tamiko

What do we need to do about this?

bangerth avatar Jun 16 '23 15:06 bangerth

@bangerth I will try to reproduce early next week.

We would either need to add some explicit (dummy) instantiations, or remove some obscure instantations, I guess.

tamiko avatar Jun 16 '23 16:06 tamiko

I can no longer reproduce.

tamiko avatar Jun 21 '23 17:06 tamiko