Open suds12 opened 4 years ago
I did not try to compile hipcl yet myself, but this sounds like you didn't use the patched clang that's mentioned in the README? Also note how you specify the patched clang.
I had another crack at it today. I actually did use the patched clang. When I try to make install, I get
[srinivasans@iris19 build]$ make -j
[ 2%] Built target RecursiveGaussian_image
[ 3%] Built target hipcl_config
[ 19%] Built target LLVMHipDynMem
[ 43%] Built target kernellib_bc
[ 44%] Linking CXX shared library libhipcl.so
[ 48%] Built target hipcl
[ 51%] Building CXX object samples/2_vecadd/CMakeFiles/VecAdd.dir/VecAdd.cpp.o
[ 51%] Building CXX object samples/bit_extract/CMakeFiles/bit_extract.dir/bit_extract.cpp.o
[ 51%] Building CXX object samples/0_MatrixMultiply/CMakeFiles/MatrixMultiply.dir/MatrixMultiply.cpp.o
[ 53%] Building CXX object samples/hiptest/CMakeFiles/hiptest.dir/hiptest.cc.o
[ 53%] Building CXX object samples/fp16/CMakeFiles/fp16.dir/haxpy-base.cpp.o
[ 68%] Building CXX object samples/1_hipEvent/CMakeFiles/hipEvent.dir/hipEvent.cpp.o
[ 68%] Building CXX object samples/hipmath/CMakeFiles/hipmath.dir/hipmath.cc.o
[ 70%] Building CXX object samples/0_MatrixTranspose/CMakeFiles/MatrixTranspose.dir/MatrixTranspose.cpp.o
[ 70%] Building CXX object samples/hcc_dialects/CMakeFiles/vadd_hip.dir/vadd_hip.cpp.o
[ 70%] Building CXX object samples/3_shared_memory/CMakeFiles/sharedMemory.dir/sharedMemory.cpp.o
[ 70%] Building CXX object samples/6_dynamic_shared/CMakeFiles/dynamic_shared.dir/dynamic_shared.cpp.o
[ 70%] Building CXX object samples/6_dynamic_shared/CMakeFiles/hipDynamicShared2.dir/hipDynamicShared2.cpp.o
[ 70%] Building CXX object samples/4_shfl/CMakeFiles/broadcast2.dir/broadcast2.cpp.o
[ 70%] Building CXX object samples/4_shfl/CMakeFiles/shfl.dir/shfl.cpp.o
[ 71%] Building CXX object samples/hipInfo/CMakeFiles/hipInfo.dir/hipInfo.cpp.o
[ 73%] Building CXX object samples/6_dynamic_shared/CMakeFiles/hipDynamicShared.dir/hipDynamicShared.cpp.o
[ 73%] Building CXX object samples/5_2dshfl/CMakeFiles/2dshfl.dir/2dshfl.cpp.o
[ 73%] Building CXX object samples/hip-cuda/FloydWarshall/CMakeFiles/FloydWarshall.dir/FloydWarshall.cpp.o
[ 73%] Building CXX object samples/hip-cuda/DCT/CMakeFiles/DCT.dir/DCT.cpp.o
[ 74%] Building CXX object samples/hip-cuda/BinomialOption/CMakeFiles/BinomialOption.dir/BinomialOption.cpp.o
[ 74%] Building CXX object samples/4_shfl/CMakeFiles/broadcast.dir/broadcast.cpp.o
[ 74%] Building CXX object samples/hip-cuda/Histogram/CMakeFiles/Histogram.dir/Histogram.cpp.o
[ 74%] Building CXX object samples/hip-cuda/BitonicSort/CMakeFiles/BitonicSort.dir/BitonicSort.cpp.o
[ 74%] Building CXX object samples/hip-cuda/dwtHaar1D/CMakeFiles/dwtHaar1D.dir/dwtHaar1D.cpp.o
[ 74%] Building CXX object samples/hip-cuda/RecursiveGaussian/CMakeFiles/RecursiveGaussian.dir/RecursiveGaussian.cpp.o
[ 74%] Building CXX object samples/hip-cuda/FastWalshTransform/CMakeFiles/FastWalshTransform.dir/FastWalshTransform.cpp.o
[ 74%] Building CXX object samples/hip-cuda/SimpleConvolution/CMakeFiles/SimpleConvolution.dir/SimpleConvolution.cpp.o
Error opening '/home/srinivasans/hipcl/build/llvm_passes/libLLVMHipDynMem.so': /home/srinivasans/hipcl/build/llvm_passes/libLLVMHipDynMem.so: undefined symbol: _ZNK4llvm10ModulePass17createPrinterPassERNS_11raw_ostreamERKSs
-load request ignored.
opt: Unknown command line argument '-hip-dyn-mem'. Try: '/home/srinivasans/bin/llvm/bin/opt -help'
opt: Did you mean '-hsdr-no-mem'?
clang-8: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)
make[2]: *** [samples/fp16/CMakeFiles/fp16.dir/haxpy-base.cpp.o] Error 1
make[1]: *** [samples/fp16/CMakeFiles/fp16.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/srinivasans/hipcl/samples/2_vecadd/VecAdd.cpp:230:21: error: no member named 'hexfloat' in namespace 'std'
std::cerr << std::hexfloat;
~~~~~^
Error opening '/home/srinivasans/hipcl/build/llvm_passes/libLLVMHipDynMem.so': /home/srinivasans/hipcl/build/llvm_passes/libLLVMHipDynMem.so: undefined symbol: _ZNK4llvm10ModulePass17createPrinterPassERNS_11raw_ostreamERKSs
-load request ignored.
Error opening '/home/srinivasans/hipcl/build/llvm_passes/libLLVMHipDynMem.so': /home/srinivasans/hipcl/build/llvm_passes/libLLVMHipDynMem.so: undefined symbol: _ZNK4llvm10ModulePass17createPrinterPassERNS_11raw_ostreamERKSs
-load request ignored.
Error opening '/home/srinivasans/hipcl/build/llvm_passes/libLLVMHipDynMem.so': /home/srinivasans/hipcl/build/llvm_passes/libLLVMHipDynMem.so: undefined symbol: _ZNK4llvm10ModulePass17createPrinterPassERNS_11raw_ostreamERKSs
-load request ignored
I followed the same procedure given including specifying the patched clang as a cmake option. For some reason, it has trouble reading the llvm passes. After running cmake, I get
-- LLVM CMake directory: /home/srinivasans/bin/llvm/lib/cmake/llvm
-- hipcl private compile options: -Wno-unused-parameter
-- hipcl private include directories: $<INSTALL_INTERFACE:/home/srinivasans/bin/hipcl/include>;$<BUILD_INTERFACE:/home/srinivasans/hipcl/include>;/home/srinivasans/hipcl;/home/srinivasans/hipcl/include
-- hipcl public compile options: -x;hip;$<INSTALL_INTERFACE:--hip-device-lib-path=/home/srinivasans/bin/hipcl/share>;$<BUILD_INTERFACE:--hip-device-lib-path=/home/srinivasans/hipcl/build>;--hip-device-lib=kernellib.bc;$<INSTALL_INTERFACE:--hip-llvm-pass-path=/home/srinivasans/bin/hipcl/lib/llvm>;$<BUILD_INTERFACE:--hip-llvm-pass-path=/home/srinivasans/hipcl/build/llvm_passes>
-- hipcl public include directories: $<INSTALL_INTERFACE:/home/srinivasans/bin/hipcl/include>;$<BUILD_INTERFACE:/home/srinivasans/hipcl/include>
-- HIPCL_CXX_OPTIONS: -x hip $<1:--hip-device-lib-path=/home/srinivasans/bin/hipcl/share> $<0:--hip-device-lib-path=/home/srinivasans/hipcl/build> --hip-device-lib=kernellib.bc $<1:--hip-llvm-pass-path=/home/srinivasans/bin/hipcl/lib/llvm> $<0:--hip-llvm-pass-path=/home/srinivasans/hipcl/build/llvm_passes> $<1:-I/home/srinivasans/bin/hipcl/include> $<0:/home/srinivasans/hipcl/include>
-- Configuring done
-- Generating done
-- Build files have been written to: /home/srinivasans/hipcl/build
Which suggests the llvm passes are in the right directory. Is there something I can do ?
This looks like a symptom of accidentally compiling against different (debug enabled) LLVM headers than the lib (debug enabled, or the other way around) is built with. I have seen this before and ensuring system LLVM doesn't interfere at the build time helped.
When I try to build hipcl, I get this error
clang-8: error: unsupported option '--hip-llvm-pass-path =/hipcl/build/llvm_passes
make[2]: *** [samples/1_hipEvent/CMakeFiles/hipEvent.dir/hipEvent.cpp.o] Error 1
I tried searching for that option without any luck. Can you explain what exactly that option does so I can try and fix it?