Hi,
I am getting a build error:
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/201912160138/lib/clang/10.0.0/include/__clang_cuda_cmath.h:57:25: note: target of using declaration
DEVICE const double abs(const double __x) { return ::fabs((double)__x); }
^
/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/201912160138/lib/clang/10.0.0/include/__clang_cuda_cmath.h:56:24: note: target of using declaration
DEVICE const float abs(const float __x) { return ::fabsf((float)__x); }
^
/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;
^
/p/project/cpcp0/pcp0151/projects/nest-simulator/librandom/binomial_randomdev.cpp:233:34: warning: implicit conversion from ‘long’ to ‘double’ changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion]
static_cast< long >( 0.998 * std::numeric_limits< long >::max() );
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.
make[2]: *** [librandom/CMakeFiles/random.dir/binomial_randomdev.cpp.o] Error 1
make[1]: *** [librandom/CMakeFiles/random.dir/all] Error 2
make: *** [all] Error 2
Although I have this hunk:
$ git diff
diff --git a/clang/lib/Headers/__clang_cuda_math_forward_declares.h b/clang/lib/Headers/__clang_cuda_math_f
index 0afe4db…46b95db 100644
— a/clang/lib/Headers/__clang_cuda_math_forward_declares.h
+++ b/clang/lib/Headers/__clang_cuda_math_forward_declares.h
@@ -47,8 +47,8 @@ DEVICE float abs(float);
// TODO: Once variant is supported the additional functions will have
// to be removed.
#if defined(_OPENMP) && defined(__cplusplus)
-DEVICE const double abs(const double);
-DEVICE const float abs(const float);
+//DEVICE const double abs(const double);
+//DEVICE const float abs(const float);
#endif
DEVICE int abs(int) __NOEXCEPT;
DEVICE double acos(double);
, as Alexey suggested.