diff_fem icon indicating copy to clipboard operation
diff_fem copied to clipboard

Build Failure with CMake and pydifem

Open abdelhakim96 opened this issue 4 months ago • 0 comments

Issue: Build Failure with CMake and pydifem Summary: I'm experiencing a build failure when compiling the pydifem.cc file due to an error related to the isfinite function in Eigen with CppAD::AD. The issue occurs while building the project using CMake on a Linux environment.

Environment Details: OS: Linux (Ubuntu/Debian) Compiler: GCC (version 11.4) Eigen Version: 3.4 CppAD Version: 2021.00.00.8 Python Version: 3.8 (Conda environment) CMake Version: 3.22.1

FAILED: CMakeFiles/pydifem.dir/python/pydifem.cc.o /usr/bin/c++ -DBOOST_ALL_NO_LIB ... -c /home/hakim/diff_fem/python/pydifem.cc In file included from /usr/include/eigen3/Eigen/Core:171, from /home/hakim/diff_fem/python/../sim/diff/cppad_utils.h:25, from /home/hakim/diff_fem/python/pydifem.cc:8: /usr/include/eigen3/Eigen/src/Core/MathFunctions.h: In instantiation of ‘typename Eigen::internal::enable_if<((! std::is_integral<_Tp>::value) && (! Eigen::NumTraits<T>::IsComplex)), bool>::type Eigen::internal::isfinite_impl(const T&) [with T = CppAD::AD; typename Eigen::internal::enable_if<((! std::is_integral<_Tp>::value) && (! Eigen::NumTraits<T>::IsComplex)), bool>::type = bool]’: /usr/include/eigen3/Eigen/src/SVD/JacobiSVD.h:680:26: required from ‘Eigen::JacobiSVD<MatrixType, QRPreconditioner>::JacobiSVD(const MatrixType&, unsigned int)’ [with _MatrixType = Eigen::Matrix<CppAD::AD, 3, 3, 0, 3, 3>; int QRPreconditioner = 2]

...

/usr/include/c++/11/cmath:578:5: note: candidate: ‘template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isfinite(_Tp)’ error: no matching function for call to ‘isfinite(const CppAD::AD&)’

abdelhakim96 avatar Oct 26 '24 17:10 abdelhakim96