diff --git a/core/clingutils/CMakeLists.txt b/core/clingutils/CMakeLists.txt index ec4024f1d9b14..4e592dbdecde9 100644 --- a/core/clingutils/CMakeLists.txt +++ b/core/clingutils/CMakeLists.txt @@ -80,31 +80,19 @@ foreach(dict ${stldicts}) target_include_directories(${dict}Dict PRIVATE ${CMAKE_SOURCE_DIR}/interpreter/cling/include/cling/cint) endforeach() -set(CLANG_RESOURCE_DIR_STEM) if (builtin_clang) - set(CLANG_RESOURCE_DIR_STEM ${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/${CMAKE_CFG_INTDIR}/lib/clang) - set(CLANG_RESOURCE_DIR_VERSION ${LLVM_VERSION_MAJOR}) + set(CLANG_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/${CMAKE_CFG_INTDIR}) else () - set(CLANG_RESOURCE_DIR_STEM ${LLVM_LIBRARY_DIR}/clang) - # A user can define a clang version to use, otherwise find it (but will error if more than one version is present) - if (NOT DEFINED CLANG_RESOURCE_DIR_VERSION) - if (NOT EXISTS ${CLANG_RESOURCE_DIR_STEM}) - message(FATAL_ERROR "${CLANG_RESOURCE_DIR_STEM} does not exist. Please install clang.") - endif() - # There is no reasonable way to get the version of clang under which is its resource directory. - # For example, lib/clang/5.0.0/include. Deduce it. - file(GLOB CHILDREN RELATIVE ${CLANG_RESOURCE_DIR_STEM} ${CLANG_RESOURCE_DIR_STEM}/*) - list(LENGTH CHILDREN CHILDREN_LENGTH) - if (${CHILDREN_LENGTH} GREATER 1) - message(FATAL_ERROR "Found more than one version of clang. CLANG_RESOURCE_DIR_VERSION contains: '${CHILDREN}'." ) - endif() - - list(GET CHILDREN 0 CLANG_RESOURCE_DIR_VERSION) + # If no explicit Clang prefix is set, assume it lives inside LLVM prefix. + if(NOT DEFINED CLANG_INSTALL_PREFIX) + set(CLANG_INSTALL_PREFIX ${LLVM_DIR}) endif() endif() +# We only look for the Clang version that matches the LLVM version, because other setups are not supported. +set(CLANG_RESOURCE_DIR_VERSION ${LLVM_VERSION_MAJOR}) -set(CLANG_RESOURCE_DIR ${CLANG_RESOURCE_DIR_STEM}/${CLANG_RESOURCE_DIR_VERSION}/include) +set(CLANG_RESOURCE_DIR ${CLANG_INSTALL_PREFIX}/lib/clang/${CLANG_RESOURCE_DIR_VERSION}/include) #---Deal with clang resource here---------------------------------------------- install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/cling/lib/clang/${CLANG_RESOURCE_DIR_VERSION}/include/ diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt index e6512a888284c..0df222284c792 100644 --- a/interpreter/CMakeLists.txt +++ b/interpreter/CMakeLists.txt @@ -407,6 +407,12 @@ if (builtin_clang) else() find_package(Clang REQUIRED CONFIG) message(STATUS "Found Clang ${CLANG_PACKAGE_VERSION} in ${CLANG_CMAKE_DIR}") + + # Disable linking against shared LLVM. + # We have to do this after find_package(Clang). Finding Clang internally + # calls find_package(LLVM), which overwrites LLVM_LINK_LLVM_DYLIB to what it + # was set when building LLVM. + set(LLVM_LINK_LLVM_DYLIB FALSE) endif() # Reset the compiler flags after compiling LLVM and Clang diff --git a/tmva/pymva/test/CMakeLists.txt b/tmva/pymva/test/CMakeLists.txt index f0f76f74b6a65..9605c0bb5e7fa 100644 --- a/tmva/pymva/test/CMakeLists.txt +++ b/tmva/pymva/test/CMakeLists.txt @@ -16,7 +16,6 @@ set(Libraries Core MathCore TMVA PyMVA ROOTTMVASofie) # Look for needed python modules ROOT_FIND_PYTHON_MODULE(torch) ROOT_FIND_PYTHON_MODULE(keras) -ROOT_FIND_PYTHON_MODULE(theano) ROOT_FIND_PYTHON_MODULE(tensorflow) ROOT_FIND_PYTHON_MODULE(sklearn)