Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building sample program fails: undefined reference to symbol '_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3' #125

Closed
bluebear94 opened this issue Aug 26, 2019 · 6 comments

Comments

@bluebear94
Copy link
Contributor

  • distro is Ubuntu 18.04 (on aarch64, Jetson TX2 to be precise)
  • Clang: 8.0.0
  • CUDA: 10.0
  • Python: 3.6.8 (in case you want to know :P)
  • Boost: 1.65

I built hipSYCL successfully, but when I try to compile a program with syclcc-clang, I get the linker error below:

$ /opt/hipSYCL/bin/syclcc-clang test.cpp -o test --hipsycl-platform=cuda --hipsycl-gpu-arch=sm_62 -v
clang version 8.0.0-3~ubuntu18.04.1 (tags/RELEASE_800/final)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/aarch64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/aarch64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/8
Selected GCC installation: /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda-10.0, version 10.0
 "/usr/lib/llvm-8/bin/clang" -cc1 -triple nvptx64-nvidia-cuda -aux-triple aarch64-unknown-linux-gnu -S -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -no-integrated-as -fuse-init-array -fcuda-is-device -mlink-builtin-bitcode /usr/local/cuda-10.0/nvvm/libdevice/libdevice.10.bc -target-feature +ptx61 -target-cpu sm_62 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/llvm-8/lib/clang/8.0.0 -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.0/include/cuda_wrappers -internal-isystem /usr/local/cuda-10.0/include -include __clang_cuda_runtime_wrapper.h -D HIPSYCL_CLANG -I /opt/hipSYCL/bin/../include/ -I /opt/hipSYCL/bin/../include/hipSYCL/ -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward -internal-isystem /usr/include/clang/8.0.0/include/ -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward -internal-isystem /usr/include/clang/8.0.0/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.0/include -internal-externc-isystem /usr/include/aarch64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.0/include -internal-externc-isystem /usr/include/aarch64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++14 -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /home/kozet/sycl-test -ferror-limit 19 -fmessage-length 190 -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -load /opt/hipSYCL/bin/../lib/libhipSYCL_clang.so -o /tmp/test-6d28b3.s -x cuda test.cpp
clang -cc1 version 8.0.0 based upon LLVM 8.0.0 default target aarch64-unknown-linux-gnu
ignoring nonexistent directory "/include"
ignoring nonexistent directory "/include"
ignoring duplicate directory "/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0"
ignoring duplicate directory "/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0"
ignoring duplicate directory "/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0"
ignoring duplicate directory "/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0"
ignoring duplicate directory "/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward"
ignoring duplicate directory "/usr/include/clang/8.0.0/include"
ignoring duplicate directory "/usr/include/clang/8.0.0/include"
ignoring duplicate directory "/usr/local/include"
ignoring duplicate directory "/usr/include/clang/8.0.0/include"
ignoring duplicate directory "/usr/include/aarch64-linux-gnu"
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/hipSYCL/bin/../include
 /opt/hipSYCL/bin/../include/hipSYCL
 /usr/lib/llvm-8/lib/clang/8.0.0/include/cuda_wrappers
 /usr/local/cuda-10.0/include
 /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0
 /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0
 /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward
 /usr/include/clang/8.0.0/include
 /usr/local/include
 /usr/include/aarch64-linux-gnu
 /usr/include
End of search list.
 "/usr/local/cuda-10.0/bin/ptxas" -m64 -O0 -v --gpu-name sm_62 --output-file /tmp/test-50e5c7.o /tmp/test-6d28b3.s
ptxas info    : 0 bytes gmem
ptxas info    : Compiling entry function '__hipsycl_kernel_$vector_add' for 'sm_62'
ptxas info    : Function properties for __hipsycl_kernel_$vector_add
    296 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 33 registers, 448 bytes cmem[0]
ptxas info    : Function properties for _ZN2cl4sycl2idILi1EEC1ERKS2_
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl2idILi1EEC1Ev
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl2idILi1EEC1ILb0EEERKNS0_4itemILi1EXT_EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl2idILi1EEC1ILi1EvEEm
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl2idILi1EEC2ERKS2_
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl2idILi1EEC2Ev
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl2idILi1EEC2ILb0EEERKNS0_4itemILi1EXT_EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl2idILi1EEC2ILi1EvEEm
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl4itemILi1ELb0EEC1ERKNS0_2idILi1EEERKNS0_5rangeILi1EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl4itemILi1ELb0EEC2ERKNS0_2idILi1EEERKNS0_5rangeILi1EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl6detail12device_arrayImLm1EEixEm
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl6detail13get_global_idILi1EEENS0_2idIXT_EEEv
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl6detail15get_global_id_xEv
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl6detail8dispatch16item_is_in_rangeILi1ELb0EEEbRKNS0_4itemIXT_EXT0_EEERKNS0_5rangeIXT_EEERKNS0_2idIXT_EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl6detail8dispatch6device20get_global_id_helperILi1EEENS0_2idIXT_EEEv
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl6detail9item_baseILi1EEC2ERKNS0_2idILi1EEERKNS0_5rangeILi1EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl6detail9linear_idILi1EE3getERKNS0_2idILi1EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl6detail9linear_idILi1EE3getERKNS0_2idILi1EEERKNS0_5rangeILi1EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZN2cl4sycl6detail9make_itemILi1EEENS0_4itemIXT_ELb0EEERKNS0_2idIXT_EEERKNS0_5rangeIXT_EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZNK2cl4sycl2idILi1EE3getEi
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZNK2cl4sycl2idILi1EEixEi
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZNK2cl4sycl5rangeILi1EE3getEi
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZNK2cl4sycl6detail12device_arrayImLm1EEixEm
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZNK2cl4sycl6detail9item_baseILi1EE6get_idEi
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZNK2cl4sycl8accessorIfLi1ELNS0_6access4modeE1024ELNS2_6targetE2014ELNS2_11placeholderE0EEixILi1ELS3_1024EvEEfNS0_2idILi1EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZNK2cl4sycl8accessorIfLi1ELNS0_6access4modeE1025ELNS2_6targetE2014ELNS2_11placeholderE0EEixILS3_1025ELi1EvEERfNS0_2idILi1EEE
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Function properties for _ZZZ3addRN2cl4sycl5queueERKSt6vectorIfSaIfEES7_ENK3$_0clERNS0_7handlerEENKUlNS0_2idILi1EEEE_clESC_
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
 "/usr/local/cuda-10.0/bin/fatbinary" --cuda -64 --create /tmp/test-d4e11e.fatbin --image=profile=sm_62,file=/tmp/test-50e5c7.o --image=profile=compute_62,file=/tmp/test-6d28b3.s
 "/usr/lib/llvm-8/bin/clang" -cc1 -triple aarch64-unknown-linux-gnu -aux-triple nvptx64-nvidia-cuda -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu generic -target-feature +neon -target-abi aapcs -fallow-half-arguments-and-returns -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/llvm-8/lib/clang/8.0.0 -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.0/include/cuda_wrappers -internal-isystem /usr/local/cuda-10.0/include -include __clang_cuda_runtime_wrapper.h -D HIPSYCL_CLANG -I /opt/hipSYCL/bin/../include/ -I /opt/hipSYCL/bin/../include/hipSYCL/ -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward -internal-isystem /usr/include/clang/8.0.0/include/ -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0 -internal-isystem /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward -internal-isystem /usr/include/clang/8.0.0/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.0/include -internal-externc-isystem /usr/include/aarch64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.0/include -internal-externc-isystem /usr/include/aarch64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++14 -fdeprecated-macro -fdebug-compilation-dir /home/kozet/sycl-test -ferror-limit 19 -fmessage-length 190 -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -load /opt/hipSYCL/bin/../lib/libhipSYCL_clang.so -o /tmp/test-6a824a.o -x cuda test.cpp -fcuda-include-gpubinary /tmp/test-d4e11e.fatbin -faddrsig
clang -cc1 version 8.0.0 based upon LLVM 8.0.0 default target aarch64-unknown-linux-gnu
ignoring nonexistent directory "/include"
ignoring nonexistent directory "/include"
ignoring duplicate directory "/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0"
ignoring duplicate directory "/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0"
ignoring duplicate directory "/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0"
ignoring duplicate directory "/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0"
ignoring duplicate directory "/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward"
ignoring duplicate directory "/usr/include/clang/8.0.0/include"
ignoring duplicate directory "/usr/include/clang/8.0.0/include"
ignoring duplicate directory "/usr/local/include"
ignoring duplicate directory "/usr/include/clang/8.0.0/include"
ignoring duplicate directory "/usr/include/aarch64-linux-gnu"
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/hipSYCL/bin/../include
 /opt/hipSYCL/bin/../include/hipSYCL
 /usr/lib/llvm-8/lib/clang/8.0.0/include/cuda_wrappers
 /usr/local/cuda-10.0/include
 /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0
 /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/aarch64-linux-gnu/c++/7.4.0
 /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward
 /usr/include/clang/8.0.0/include
 /usr/local/include
 /usr/include/aarch64-linux-gnu
 /usr/include
End of search list.
 "/usr/bin/ld" -EL -z relro --hash-style=gnu --build-id --eh-frame-hdr -m aarch64linux -dynamic-linker /lib/ld-linux-aarch64.so.1 -o test /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../aarch64-linux-gnu/crt1.o /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../aarch64-linux-gnu/crti.o /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/crtbegin.o -L/usr/local/cuda-10.0/lib64/ -L/opt/hipSYCL/bin/../lib/ -L/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0 -L/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../aarch64-linux-gnu -L/lib/aarch64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../.. -L/usr/lib/llvm-8/bin/../lib -L/lib -L/usr/lib -lcudart -lhipSYCL_cuda /tmp/test-6a824a.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/crtend.o /usr/bin/../lib/gcc/aarch64-linux-gnu/7.4.0/../../../aarch64-linux-gnu/crtn.o
/usr/bin/ld: /opt/hipSYCL/bin/../lib//libhipSYCL_cuda.so: undefined reference to symbol '_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3'
//usr/lib/aarch64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@illuhad
Copy link
Collaborator

illuhad commented Aug 26, 2019

Hi!

aarch64, always nice to see people trying hipSYCL on some new platform :) The downside is that I don't have any experience on that platform, but let's see if we can get it working :)

clang 8 doesn't support cuda 10 as documented here. You should either upgrade to clang 9 or use CUDA 9.x. Normally, clang refuses to do anything if it has detected an incompatible CUDA version, so I'm surprised you even got to the linking stage. Perhaps on aarch64, this behavior is different.

In any way, I don't think the cuda-clang version mismatch is related to your issue. It seems there is some ABI incompatibility here. I'm not sure if this is even related to hipSYCL. Could you please verify

  • that you can compile C++ programs with clang
  • that you can compile regular CUDA code with clang, e.g. clang++ -x cuda --cuda-gpu-arch=sm_62 ...

If all this works, please describe how you have built hipSYCL and post a dump of your cmake configuration, e.g. cmake -LA <source dir> from your build directory.
It could be that you have compiled hipSYCL with another compiler (e.g. gcc) which has built a runtime library that has an ABI that is incompatible with clang, and so cannot be linked. Normally clang and gcc are binary compatible such that this is not an issue, but if one is very new and the other very old things may be different. In that case, please try compiling hipSYCL with clang 8.

@fodinabor
Copy link
Collaborator

Shouldn't be much of a problem.. I got hipSYCL running on a Jetson Xavier AGX, also aarch64.
It's been CUDA 10 there but 9 should work as well as 10. At the time of doing it, Clang 9 has not been available as packages, but building it was successful.

@bluebear94
Copy link
Contributor Author

Yes, I can compile both C++ and CUDA code. I used the following commands to build hipSYCL:

cmake \
	-DCMAKE_C_COMPILER=/usr/bin/clang-8 \
	-DCMAKE_CXX_COMPILER=/usr/bin/clang++-8 \
	-DCMAKE_INSTALL_PREFIX=/opt/hipSYCL/ \
	-DLLVM_DIR=/usr/lib/llvm-8/cmake \
	-DCLANG_EXECUTABLE_PATH=/usr/bin/clang-8 \
	-DCLANG_INCLUDE_PATH=/usr/include/clang/8/include \
	../hipSYCL/

make
sudo make install

And my CMake configuration is below:

-- Building hipSYCL against LLVM configured from /usr/lib/llvm-8/cmake
-- Selecting clang: /usr/bin/clang-8
-- Using clang include directory: /usr/include/clang/8/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kozet/hipSYCL-build
-- Cache values
CLANG_EXECUTABLE_PATH:FILEPATH=/usr/bin/clang-8
CLANG_INCLUDE_PATH:PATH=/usr/include/clang/8/include
CMAKE_AR:FILEPATH=/usr/bin/ar
CMAKE_BUILD_TYPE:STRING=
CMAKE_COLOR_MAKEFILE:BOOL=ON
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/lib/llvm-8/bin/llvm-ar
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/lib/llvm-8/bin/llvm-ranlib
CMAKE_CXX_FLAGS:STRING=
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_C_COMPILER_AR:FILEPATH=/usr/lib/llvm-8/bin/llvm-ar
CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/lib/llvm-8/bin/llvm-ranlib
CMAKE_C_FLAGS:STRING=
CMAKE_C_FLAGS_DEBUG:STRING=-g
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
CMAKE_INSTALL_PREFIX:PATH=/opt/hipSYCL
CMAKE_LINKER:FILEPATH=/usr/bin/ld
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_NM:FILEPATH=/usr/bin/nm
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
CMAKE_SHARED_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
CMAKE_STATIC_LINKER_FLAGS:STRING=
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_STRIP:FILEPATH=/usr/bin/strip
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
COMPILE_SOURCE_TRANSFORMATION_TOOLS:BOOL=false
CUDA_64_BIT_DEVICE_CODE:BOOL=ON
CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE:BOOL=ON
CUDA_BUILD_CUBIN:BOOL=OFF
CUDA_BUILD_EMULATION:BOOL=OFF
CUDA_CUDART_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libcudart.so
CUDA_CUDA_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/libcuda.so
CUDA_GENERATED_OUTPUT_DIR:PATH=
CUDA_HOST_COMPILATION_CPP:BOOL=ON
CUDA_HOST_COMPILER:FILEPATH=/usr/bin/clang-8
CUDA_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-10.0/bin/nvcc
CUDA_NVCC_FLAGS:STRING=
CUDA_NVCC_FLAGS_DEBUG:STRING=
CUDA_NVCC_FLAGS_MINSIZEREL:STRING=
CUDA_NVCC_FLAGS_RELEASE:STRING=
CUDA_NVCC_FLAGS_RELWITHDEBINFO:STRING=
CUDA_PROPAGATE_HOST_FLAGS:BOOL=ON
CUDA_SDK_ROOT_DIR:PATH=CUDA_SDK_ROOT_DIR-NOTFOUND
CUDA_SEPARABLE_COMPILATION:BOOL=OFF
CUDA_TOOLKIT_INCLUDE:PATH=/usr/local/cuda-10.0/include
CUDA_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-10.0
CUDA_USE_STATIC_CUDA_RUNTIME:BOOL=ON
CUDA_VERBOSE_BUILD:BOOL=OFF
CUDA_VERSION:STRING=10.0
CUDA_cublas_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libcublas.so
CUDA_cublas_device_LIBRARY:FILEPATH=CUDA_cublas_device_LIBRARY-NOTFOUND
CUDA_cudadevrt_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libcudadevrt.a
CUDA_cudart_static_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libcudart_static.a
CUDA_cufft_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libcufft.so
CUDA_cupti_LIBRARY:FILEPATH=/usr/local/cuda-10.0/extras/CUPTI/lib64/libcupti.so
CUDA_curand_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libcurand.so
CUDA_cusolver_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libcusolver.so
CUDA_cusparse_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libcusparse.so
CUDA_nppc_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppc.so
CUDA_nppial_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppial.so
CUDA_nppicc_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppicc.so
CUDA_nppicom_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppicom.so
CUDA_nppidei_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppidei.so
CUDA_nppif_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppif.so
CUDA_nppig_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppig.so
CUDA_nppim_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppim.so
CUDA_nppist_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppist.so
CUDA_nppisu_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppisu.so
CUDA_nppitc_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnppitc.so
CUDA_npps_LIBRARY:FILEPATH=/usr/local/cuda-10.0/lib64/libnpps.so
CUDA_rt_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/librt.so
DEFAULT_GPU_ARCH:STRING=
HIPCC_COMPILER:FILEPATH=HIPCC_COMPILER-NOTFOUND
HIPSYCL_DEBUG_LEVEL:STRING=1
LLVM_DIR:PATH=/usr/lib/llvm-8/cmake
ROCM_PATH:PATH=/opt/rocm
USE_NVCC:BOOL=false
WITH_CPU_BACKEND:BOOL=true
WITH_CUDA_BACKEND:BOOL=TRUE
WITH_ROCM_BACKEND:BOOL=false

@illuhad
Copy link
Collaborator

illuhad commented Aug 27, 2019

Does anything change if you use -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-8 instead of /usr/bin/clang-8?

@bluebear94
Copy link
Contributor Author

Yep, that seems to resolve the issue:

$ /opt/hipSYCL/bin/syclcc-clang test.cpp -o test --hipsycl-platform=cuda --hipsycl-gpu-arch=sm_62 # success!
$ LD_LIBRARY_PATH=/opt/hipSYCL/lib/:$LD_LIBRARY_PATH ./test
Result: 
0
4
0
8
0

@illuhad
Copy link
Collaborator

illuhad commented Aug 27, 2019

Excellent! Issue was most likely that libstdc++ was not linked by clang because the C++ wrapper was not used. Maybe we should check in cmake that clang is clang++-XX and print a warning otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants