If I compile with
clang++ --offload-arch=native -xhip -march=native -stdlib=libstdc++ oneComplex_hip.cpp
I get things like
lld: error: undefined hidden symbol: cacosh
referenced by /tmp/innocent/oneComplex_hip-gfx900-400399.o:(std::complex_acosh(double complex))
referenced by /tmp/innocent/oneComplex_hip-gfx900-400399.o:(std::complex_acosh(double complex))
clang++: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)
If I add to that file (Headers/cuda_wrappers/complex)
ifdef FIXC99
warning fixing C99_ARC
pragma push_macro("_GLIBCXX_USE_C99_COMPLEX_ARC")
define _GLIBCXX_USE_C99_COMPLEX_ARC 0
endif
it compiles and run
clang++ --offload-arch=native -xhip -march=native -stdlib=libstdc++ oneComplex_hip.cpp -DFIXC99
In file included from :1:
In file included from /afs/cern.ch/work/i/innocent/public/w5/lib/clang/20/include/__clang_hip_runtime_wrapper.h:146:
/afs/cern.ch/work/i/innocent/public/w5/lib/clang/20/include/cuda_wrappers/complex:76:2: warning: fixing C99_ARC [-W#warnings]
76 | #warning fixing C99_ARC
If I compile with
clang++ --offload-arch=native -xhip -march=native -stdlib=libstdc++ oneComplex_hip.cpp
I get things like
lld: error: undefined hidden symbol: cacosh
>>> referenced by /tmp/innocent/oneComplex_hip-gfx900-400399.o:(std::__complex_acosh(double complex))
>>> referenced by /tmp/innocent/oneComplex_hip-gfx900-400399.o:(std::__complex_acosh(double complex))
clang++: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)
while it does not complain for sin, sqrt,log etc
this is most probably related to a bug I submitted to gcc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117151
If I add to that file (Headers/cuda_wrappers/complex)
#ifdef FIXC99
#warning fixing C99_ARC
#pragma push_macro("_GLIBCXX_USE_C99_COMPLEX_ARC")
#define _GLIBCXX_USE_C99_COMPLEX_ARC 0
#endif
it compiles and run
clang++ --offload-arch=native -xhip -march=native -stdlib=libstdc++ oneComplex_hip.cpp -DFIXC99
In file included from <built-in>:1:
In file included from /afs/cern.ch/work/i/innocent/public/w5/lib/clang/20/include/__clang_hip_runtime_wrapper.h:146:
/afs/cern.ch/work/i/innocent/public/w5/lib/clang/20/include/cuda_wrappers/complex:76:2: warning: fixing C99_ARC [-W#warnings]
76 | #warning fixing C99_ARC
etc...
If I compile with clang++ --offload-arch=native -xhip -march=native -stdlib=libstdc++ oneComplex_hip.cpp I get things like lld: error: undefined hidden symbol: cacosh
clang++: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)
while it does not complain for sin, sqrt,log etc this is most probably related to a bug I submitted to gcc https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117151
If I add to that file (Headers/cuda_wrappers/complex)
ifdef FIXC99
warning fixing C99_ARC
pragma push_macro("_GLIBCXX_USE_C99_COMPLEX_ARC")
define _GLIBCXX_USE_C99_COMPLEX_ARC 0
endif
it compiles and run clang++ --offload-arch=native -xhip -march=native -stdlib=libstdc++ oneComplex_hip.cpp -DFIXC99 In file included from:1:
In file included from /afs/cern.ch/work/i/innocent/public/w5/lib/clang/20/include/__clang_hip_runtime_wrapper.h:146:
/afs/cern.ch/work/i/innocent/public/w5/lib/clang/20/include/cuda_wrappers/complex:76:2: warning: fixing C99_ARC [-W#warnings]
76 | #warning fixing C99_ARC
etc...