Building my app with trunk Clang with appropriate offloading flags fails:
[ 32%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/archiving_node.cpp.o
In file included from /p/project/cpcp0/pcp0151/projects/nest-simulator/nestkernel/archiving_node.cpp:30:
In file included from /p/project/cpcp0/pcp0151/projects/nest-simulator/nestkernel/archiving_node.h:40:
/p/project/cpcp0/pcp0151/projects/nest-simulator/nestkernel/nest_time.h:127:10: error: call to ‘abs’ is ambiguous
return std::abs( n );
^~~~~~~~
/p/project/cpcp0/pcp0151/projects/nest-simulator/nestkernel/nest_time.h:312:15: note: in instantiation of function template specialization ‘nest::time_abs’ requested here
: tics( ( time_abs( t.t ) < LIM_MAX.steps )
^
/usr/include/stdlib.h:770:12: note: candidate function
extern int abs (int __x) __THROW attribute ((const)) __wur;
^
/p/scratch/cpcp0/pcp0151/opt/clang/201911030759/lib/clang/10.0.0/include/__clang_cuda_cmath.h:56:24: note: candidate function
DEVICE const float abs(const float __x) { return ::fabsf((float)__x); }
^
/p/scratch/cpcp0/pcp0151/opt/clang/201911030759/lib/clang/10.0.0/include/__clang_cuda_cmath.h:57:25: note: candidate function
DEVICE const double abs(const double __x) { return ::fabs((double)__x); }
^
1 error generated.
make[2]: *** [nestkernel/CMakeFiles/nestkernel.dir/archiving_node.cpp.o] Error 1
make[1]: *** [nestkernel/CMakeFiles/nestkernel.dir/all] Error 2
make: *** [all] Error 2
please note that without those offloading flags build as expected succeeds.
I am not sure what’s going on with the trunk clang at this moment.
$ cat a.cpp
#include
int main() {
}
$ clang++ -std=c++11 -fopenmp -fopenmp-targets=nvptx64 a.cpp
In file included from a.cpp:1:
In file included from /gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/iostream:39:
In file included from /gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/ostream:38:
In file included from /gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/ios:42:
In file included from /gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/bits/ios_base.h:41:
In file included from /gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/bits/locale_classes.h:40:
In file included from /gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/string:52:
In file included from /gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/bits/basic_string.h:6159:
In file included from /gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/ext/string_conversions.h:41:
In file included from /gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/cstdlib:77:
/gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/bits/std_abs.h:70:3: error: declaration conflicts with target of using declaration already in scope
abs(double __x)
^
/p/scratch/cpcp0/pcp0151/opt/clang/201911040249/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h:50:25: note: target of using declaration
DEVICE const double abs(const double);
^
/gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/bits/std_abs.h:52:11: note: using declaration
using ::abs;
^
/gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/bits/std_abs.h:74:3: error: declaration conflicts with target of using declaration already in scope
abs(float __x)
^
/p/scratch/cpcp0/pcp0151/opt/clang/201911040249/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h:51:24: note: target of using declaration
DEVICE const float abs(const float);
^
/gpfs/software/opt/gcc/7.2.0/lib/gcc/powerpc64le-unknown-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/bits/std_abs.h:52:11: note: using declaration
using ::abs;
^
2 errors generated.