Closed pvelesko closed 8 months ago
-Wl,-soname,libCHIP.so -o libCHIP.so
Also, .so.0.0 etc are not accepted
rpath option looks broken: ... -Wl,-rpath, ...
. It is missing a path. Would it compile if it were removed?
leads to other errors down the path
I get compile error too with -DOpenCL_LIBRARY
:
[ 63%] Linking CXX shared library libCHIP.so
/home/linehill/.local/lib/python3.10/site-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/CHIP.dir/link.txt --verbose=1
/mnt/md1/linehill/ws-chipstar-2/install/bin/clang++ -fPIC -Wno-duplicate-decl-specifier -Wno-tautological-constant-compare -Wno-c++20-extensions -Wno-unused-result -Wno-delete-abstract-non-virtual-dtor -Wno-deprecated-declarations -Wunused-command-line-argument -g -Wl,-rpath, -Wl,-rpath,/usr/lib/x86_64-linux-gnu -shared -Wl,-soname,libCHIP.so -o libCHIP.so CMakeFiles/CHIP.dir/src/spirv.cc.o CMakeFiles/CHIP.dir/src/spirv_hiprtc.cc.o CMakeFiles/CHIP.dir/src/CHIPDriver.cc.o CMakeFiles/CHIP.dir/src/CHIPBackend.cc.o CMakeFiles/CHIP.dir/src/SPVRegister.cc.o CMakeFiles/CHIP.dir/src/CHIPGraph.cc.o CMakeFiles/CHIP.dir/src/CHIPBindings.cc.o CMakeFiles/CHIP.dir/src/logging.cc.o CMakeFiles/CHIP.dir/src/Utils.cc.o CMakeFiles/CHIP.dir/src/SPIRVFuncInfo.cc.o CMakeFiles/CHIP.dir/src/backend/OpenCL/CHIPBackendOpenCL.cc.o CMakeFiles/CHIP.dir/src/backend/OpenCL/SVMemoryRegion.cc.o CMakeFiles/CHIP.dir/src/backend/Level0/CHIPBackendLevel0.cc.o bitcode/CMakeFiles/rtdevlib.dir/atomicAddFloat_native.cc.o bitcode/CMakeFiles/rtdevlib.dir/atomicAddFloat_emulation.cc.o bitcode/CMakeFiles/rtdevlib.dir/atomicAddDouble_native.cc.o bitcode/CMakeFiles/rtdevlib.dir/atomicAddDouble_emulation.cc.o bitcode/CMakeFiles/rtdevlib.dir/ballot_native.cc.o /usr/lib/x86_64-linux-gnu/libze_loader.so /usr/lib/x86_64-linux-gnu/libOpenCL.so -lOpenCL -lze_loader
/usr/bin/ld: cannot find /usr/lib/x86_64-linux-gnu: file format not recognized
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
But with different error message.
The chipStar builds successfully (from scratch) on my machine with the following change:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff392f95..b4556104 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,12 +68,13 @@ endforeach()
if(NOT DEFINED OpenCL_LIBRARY)
message(STATUS "OpenCL_LIBRARY was not set. Searching for libOpenCL.so in LD_LIBRARY_PATH")
find_library(OpenCL_LIBRARY NAMES OpenCL PATHS ENV LD_LIBRARY_PATH ./ NO_CACHE)
- if(OpenCL_LIBRARY)
- get_filename_component(OpenCL_DIR ${OpenCL_LIBRARY} DIRECTORY CACHE)
- message(STATUS "Setting OpenCL_DIR to ${OpenCL_DIR}")
- else()
- message(STATUS "OpenCL not found")
- endif()
+endif()
+
+if(OpenCL_LIBRARY)
+ get_filename_component(OpenCL_DIR ${OpenCL_LIBRARY} DIRECTORY CACHE)
+ message(STATUS "Setting OpenCL_DIR to ${OpenCL_DIR}")
+else()
+ message(STATUS "OpenCL not found")
endif()
if(NOT DEFINED LevelZero_LIBRARY)
This patch solves the broken -Wl,-rpath
option with the missing path value.
@pvelesko can you confirm it fixes it? Can we create a PR of this and merge it in main?
checking now On Thu, Dec 21, 2023 at 14:41 Pekka Jääskeläinen @.***> wrote:
@pvelesko https://github.com/pvelesko can you confirm it fixes it? Can we create a PR of this and merge it in main?
— Reply to this email directly, view it on GitHub https://github.com/CHIP-SPV/chipStar/issues/734#issuecomment-1866180904, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCJBQM7V32W3OVYT7SAJETYKQU7ZAVCNFSM6AAAAABA55MSXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRWGE4DAOJQGQ . You are receiving this because you were mentioned.Message ID: @.***>