Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for quartz, newer clang versions, optional CUDA #128

Merged
merged 7 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions src/c/host-configs/[email protected]@8.3.1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
12 changes: 12 additions & 0 deletions src/c/host-configs/[email protected]
Original file line number Diff line number Diff line change
@@ -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 "")
18 changes: 11 additions & 7 deletions src/c/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
4 changes: 4 additions & 0 deletions src/c/weaver/weave/perfflow_weave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading