mimesis-inria / caribou

Multi-physics computation library
GNU Lesser General Public License v3.0
29 stars 17 forks source link

Fix EigenSolver template specialization export on recent version of clang #105

Closed jnbrunet closed 2 years ago

jnbrunet commented 2 years ago

Seems like recent version of Clang compiler were not exporting the following EigenSolver symbols:

_SofaCaribou::solver::EigenSolver<Eigen::SparseMatrix<double, 0, int> >::GetCustomTemplateName()
_SofaCaribou::solver::EigenSolver<Eigen::SparseMatrix<double, 1, int> >::GetCustomTemplateName()

I think that GCC and older version of clang were exporting these automatically from the instanciation of Caribou's solver which inherits from EigenSolver<EigenType>, for example:

template <class EigenSolver_t>
class LDLTSolver : public EigenSolver<typename EigenSolver_t::MatrixType> {}
// (...)
extern template class LDLTSolver<Eigen::SimplicialLDLT<Eigen::SparseMatrix<FLOATING_POINT_TYPE, Eigen::ColMajor, int>, Eigen::Lower, Eigen::AMDOrdering<int>>>

This PR forces the instanciation and export of the missing symbols, which seems to do the trick.

/cc @fredroy