diff --git a/src/c/CMakeLists.txt b/src/c/CMakeLists.txt index 385cb658..543a7e23 100644 --- a/src/c/CMakeLists.txt +++ b/src/c/CMakeLists.txt @@ -14,6 +14,11 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # require at least Clang 9.0 if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) message(FATAL_ERROR "Clang++ version must be at least 9.0!") + elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11) + set(PERFFLOWASPECT_CLANG_11_NEWER TRUE CACHE BOOL "using >=clang11") + add_definitions(-DPERFFLOWASPECT_CLANG_11_NEWER) + elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11) + set(PERFFLOWASPECT_CLANG_11_NEWER FALSE CACHE BOOL "using >=clang11") endif() else() message(WARNING "Unsupported CXX compiler: please use Clang >= 9.0") diff --git a/src/c/host-configs/lassen-4.14.0-ppc64le-clang@10.0.1-gcc@8.3.1.cmake b/src/c/host-configs/lassen-4.14.0-ppc64le-clang@10.0.1-gcc@8.3.1.cmake index 37f3db28..f74cf58f 100644 --- a/src/c/host-configs/lassen-4.14.0-ppc64le-clang@10.0.1-gcc@8.3.1.cmake +++ b/src/c/host-configs/lassen-4.14.0-ppc64le-clang@10.0.1-gcc@8.3.1.cmake @@ -9,3 +9,4 @@ ############################################################## set(CMAKE_CXX_COMPILER "/usr/tce/packages/clang/clang-10.0.1-gcc-8.3.1/bin/clang++" CACHE PATH "") +set(LLVM_DIR "/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/lib/cmake/llvm" CACHE PATH "") diff --git a/src/c/host-configs/quartz-4.18.0-x86_64-clang@14.0.6.cmake b/src/c/host-configs/quartz-4.18.0-x86_64-clang@14.0.6.cmake new file mode 100644 index 00000000..baee2638 --- /dev/null +++ b/src/c/host-configs/quartz-4.18.0-x86_64-clang@14.0.6.cmake @@ -0,0 +1,12 @@ +############################################################## +# Copyright 2021 Lawrence Livermore National Security, LLC +# (c.f. AUTHORS, NOTICE.LLNS, COPYING) +# +# This file is part of the Flux resource manager framework. +# For details, see https://github.com/flux-framework. +# +# SPDX-License-Identifier: LGPL-3.0 +############################################################## + +set(CMAKE_CXX_COMPILER "/usr/tce/packages/clang/clang-14.0.6/bin/clang++" CACHE PATH "") +set(LLVM_DIR "/usr/tce/packages/clang/clang-14.0.6/lib/cmake/llvm" CACHE PATH "") diff --git a/src/c/test/CMakeLists.txt b/src/c/test/CMakeLists.txt index 26f7fa05..a57bbb0f 100644 --- a/src/c/test/CMakeLists.txt +++ b/src/c/test/CMakeLists.txt @@ -9,7 +9,7 @@ set(SMOKETESTS find_package(MPI REQUIRED) find_package(Threads REQUIRED) -find_package(CUDA REQUIRED) +find_package(CUDA) include_directories(${MPI_INCLUDE_PATH}) set(perfflow_deps "-L../runtime -lperfflow_runtime -lcrypto") @@ -25,17 +25,21 @@ foreach(TEST ${SMOKETESTS}) target_link_libraries(${TEST} ${perfflow_deps}) endforeach() -message(STATUS " [*] Adding test: smoketest_cuda") -set(CUDA_NVCC_FLAGS "-ccbin ${CMAKE_CXX_COMPILER} -Xcompiler=-Xclang -Xcompiler=-load -Xcompiler=-Xclang -Xcompiler=../../../weaver/weave/libWeavePass.so") -cuda_add_executable(smoketest_cuda smoketest_cuda_wrapper.cpp smoketest_cuda_kernel.cu) -target_link_libraries(smoketest_cuda ${perfflow_deps} ${CUDA_LIBRARIES} cuda) +if(CUDA_FOUND) + message(STATUS " [*] Adding test: smoketest_cuda") + set(CUDA_NVCC_FLAGS "-ccbin ${CMAKE_CXX_COMPILER} -Xcompiler=-Xclang -Xcompiler=-load -Xcompiler=-Xclang -Xcompiler=../../../weaver/weave/libWeavePass.so") + cuda_add_executable(smoketest_cuda smoketest_cuda_wrapper.cpp smoketest_cuda_kernel.cu) + target_link_libraries(smoketest_cuda ${perfflow_deps} ${CUDA_LIBRARIES} cuda) +endif() configure_file(t0001-cbinding-basic.t.in ${CMAKE_CURRENT_BINARY_DIR}/t0001-cbinding-basic.t @ONLY) -install(TARGETS ${SMOKETESTS} smoketest_cuda - DESTINATION test) +if(CUDA_FOUND) + install(TARGETS ${SMOKETESTS} smoketest_cuda + DESTINATION test) +endif() install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/t0001-cbinding-basic.t DESTINATION test) diff --git a/src/c/weaver/weave/perfflow_weave.cpp b/src/c/weaver/weave/perfflow_weave.cpp index edae7b2b..dffd693a 100644 --- a/src/c/weaver/weave/perfflow_weave.cpp +++ b/src/c/weaver/weave/perfflow_weave.cpp @@ -12,7 +12,11 @@ #include "llvm/IR/Attributes.h" #include "llvm/IR/Constants.h" #include "llvm/IR/LegacyPassManager.h" +#ifdef PERFFLOWASPECT_CLANG_11_NEWER +#include "llvm/IR/AbstractCallSite.h" +#else #include "llvm/IR/CallSite.h" +#endif #include "llvm/IR/Module.h" #include "llvm/IR/Argument.h" #include "llvm/IR/IRBuilder.h"