[Openmp-dev] Offloading app build error with Trunk

Itaru Kitayama via Openmp-dev openmp-dev at lists.llvm.org
Sun Dec 15 18:15:08 PST 2019


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20191216/de318b47/attachment.html>


More information about the Openmp-dev mailing list