Open dextorious opened 5 years ago
Apologies for the delay - finally had a chance to look at this today.
To fix this we need to make LLVM part of the the PUBLIC
interface in CMake, so that LLVM gets linked into the executables as well. Here's the patch I used to get this building on a Manjaro Docker image:
index df4323d..41815e1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -216,8 +216,9 @@ add_library(oclgrind ${CORE_LIB_TYPE}
target_link_libraries(oclgrind PRIVATE ${CORE_EXTRA_LIBS}
clangCodeGen clangFrontend clangSerialization clangDriver
clangParse clangSema clangAnalysis clangEdit clangAST clangASTMatchers
- clangLex clangBasic
- ${LLVM_LIBS})
+ clangLex clangBasic)
+
+target_link_libraries(oclgrind PUBLIC LLVM)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
target_link_libraries(oclgrind PRIVATE Version)```
@jrprice I was also affected by https://github.com/jrprice/Oclgrind/issues/164#issuecomment-477168536 .
Linux, Fedora 31.
This change fixed it for me also:
- clangLex clangBasic
- ${LLVM_LIBS})
+ clangLex clangBasic)
+
+target_link_libraries(oclgrind PUBLIC LLVM)
Following the workaround given in #164 I changed the CMakeLists.txt file on the latest master commit of Oclgrind to link to LLVM dynamically on Manjaro Linux (which is basically Arch). Unfortunately, it doesn't compile:
Is there any reasonable workaround for this, or is it a case of ABI incompatibility that needs to be addressed?