[Trilinos-Users] Trilinos 11.10.2: sacado test fail to compile with clang

Simone Rossi simone.rossi at epfl.ch
Sun Nov 9 08:18:26 MST 2014


Dear Denis,
we had a discussion not long ago about it. 
I solved this issue by including in Sacado_MathFunctions.hpp, the c math library, that is:
#include <cmath>

The bugfix should be included included in future versions of Trilinos,
Best,
Simone



Il giorno 09/nov/2014, alle ore 09:17, Denis Davydov <davydden at gmail.com> ha scritto:

> Dear all,
> 
> when compiling Trilinos with clang, the error bellow related to fabs() occurs.
> 
> Regards,
> Denis.
> 
> clang --version
> Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
> Target: x86_64-apple-darwin14.0.0
> Thread model: posix
> 
> cmake -D Trilinos_ENABLE_TESTS:BOOL=ON -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/trilinos/11.10.2 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DTPL_ENABLE_MPI:BOOL=ON -DTPL_ENABLE_BLAS=ON -DTPL_ENABLE_LAPACK=ON -DTPL_ENABLE_Zlib:BOOL=ON -DTrilinos_ENABLE_ALL_PACKAGES=ON -DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON -DTrilinos_ENABLE_Fortran:BOOL=ON -DTrilinos_ENABLE_EXAMPLES:BOOL=OFF -DTrilinos_VERBOSE_CONFIGURE:BOOL=OFF -DTrilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=""
> 
> 
> [  6%] Building CXX object packages/sacado/test/tradoptest/CMakeFiles/Sacado_hesopcheck.dir/hesopcheck.cpp.o
> In file included from /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/test/tradoptest/hesopcheck.cpp:36:
> In file included from /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_trad.hpp:39:
> In file included from /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_trad_Traits.hpp:35:
> In file included from /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_Traits.hpp:56:
> In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:246:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:664:35: error: no matching function for call to 'fabs'
> abs(double __x) _NOEXCEPT {return fabs(__x);}
>                                  ^~~~
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:124:17: note: candidate template ignored: could not match 'Expr<type-parameter-0-0>' against 'double'
> UNARYFUNC_MACRO(fabs, FAbsOp)
>                ^
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:43:30: note: expanded from macro 'UNARYFUNC_MACRO'
>    Expr< FADOP< Expr<T> > > OP (const Expr<T>&);                       \
>                             ^
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:124:17: note: candidate template ignored: could not match 'SimpleFad<type-parameter-0-0>' against 'double'
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:46:18: note: expanded from macro 'UNARYFUNC_MACRO'
>    SimpleFad<T> OP (const SimpleFad<T>&);                              \
>                 ^
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:124:17: note: candidate template ignored: could not match 'Expr<type-parameter-0-0>' against 'double'
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:53:30: note: expanded from macro 'UNARYFUNC_MACRO'
>    Expr< FADOP< Expr<T> > > OP (const Expr<T>&);                       \
>                             ^
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:124:17: note: candidate template ignored: could not match 'Expr<type-parameter-0-0>' against 'double'
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:60:30: note: expanded from macro 'UNARYFUNC_MACRO'
>    Expr< FADOP< Expr<T> > > OP (const Expr<T>&);                       \
>                             ^
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:124:17: note: candidate template ignored: could not match 'Expr<type-parameter-0-0>' against 'double'
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:67:30: note: expanded from macro 'UNARYFUNC_MACRO'
>    Expr< FADOP< Expr<T> > > OP (const Expr<T>&);                       \
>                             ^
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:124:17: note: candidate template ignored: could not match 'Expr<type-parameter-0-0>' against 'double'
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:74:30: note: expanded from macro 'UNARYFUNC_MACRO'
>    Expr< FADOP< Expr<T> > > OP (const Expr<T>&);                       \
>                             ^
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:124:17: note: candidate template ignored: could not match 'Taylor<type-parameter-0-0>' against 'double'
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:79:37: note: expanded from macro 'UNARYFUNC_MACRO'
>    template <typename T> Taylor<T> OP (const Taylor<T>&);              \
>                                    ^
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:124:17: note: candidate template ignored: could not match 'ScalarFlopCounter<type-parameter-0-0>' against 'double'
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:85:26: note: expanded from macro 'UNARYFUNC_MACRO'
>    ScalarFlopCounter<T> OP (const ScalarFlopCounter<T>&);              \
>                         ^
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:124:17: note: candidate template ignored: could not match 'ADvari<type-parameter-0-0>' against 'double'
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:91:38: note: expanded from macro 'UNARYFUNC_MACRO'
>    template <typename T> ADvari<T>& OP (const ADvari<T>&);             \
>                                     ^
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:124:17: note: candidate template ignored: could not match 'IndepADvar<type-parameter-0-0>' against 'double'
> /Users/davydden/Downloads/trilinos-11.10.2-Source/packages/sacado/src/Sacado_MathFunctions.hpp:92:38: note: expanded from macro 'UNARYFUNC_MACRO'
>    template <typename T> ADvari<T>& OP (const IndepADvar<T>&);         \
>                                     ^
> 1 error generated.
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> https://software.sandia.gov/mailman/listinfo/trilinos-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://software.sandia.gov/pipermail/trilinos-users/attachments/20141109/c906eca9/attachment-0001.html>


More information about the Trilinos-Users mailing list