marcinlos / iga-ads

Isogeometric Finite Element Method framework
MIT License
15 stars 9 forks source link

Linker error with Clang 5 #43

Closed marcinlos closed 3 years ago

marcinlos commented 3 years ago

With Clang 5.0.1, the library compiles but misses some symbols. Using it leads to linker errors:

[ 18%] Linking CXX executable stokes_dg
/usr/bin/ld: ../libads.a(gauss_data.cpp.o):(.data+0x10): undefined reference to `ads::quad::gauss::gauss_data<2ul>::X'
...
/usr/bin/ld: ../libads.a(gauss_data.cpp.o):(.data+0x410): undefined reference to `ads::quad::gauss::gauss_data<64ul>::W'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
marcinlos commented 3 years ago

This is caused by a clang bug: https://bugs.llvm.org/show_bug.cgi?id=34332

Explicitly adding inline doesn't help (and should not be necessary, since constexpr member variables are implicitly inline since C++17). This has been fixed in clang 6.0, so this is the minimal version ADS requires.