Skip to content

Commit

Permalink
Redoing the makefiles so things will build.
Browse files Browse the repository at this point in the history
  • Loading branch information
rblake-llnl committed Oct 26, 2021
1 parent a7e07c5 commit 2f66d9f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 26 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ SET(CMAKE_CUDA_FLAGS_RELEASE "-g -O3" CACHE STRING "")
SET(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "-g -O2" CACHE STRING "")
SET(CMAKE_CUDA_FLAGS_MINSIZEREL "-g -O3" CACHE STRING "")

set (CUDA_ARCH "sm_70" CACHE PATH "")
set (CMAKE_CUDA_FLAGS "-restrict -arch ${CUDA_ARCH} -std=c++11 --expt-extended-lambda" CACHE STRING "" )
set (CUDA_ARCH "sm_80" CACHE PATH "")
set (CMAKE_CUDA_FLAGS "-restrict -arch ${CUDA_ARCH} --expt-extended-lambda" CACHE STRING "" )
set (CMAKE_CUDA_HOST_COMPILER ${MPI_CXX_COMPILER} CACHE STRING "")

project(cardioid)
cmake_minimum_required(VERSION 3.2)

set (CMAKE_C_STANDARD 99)
set (CMAKE_CXX_STANDARD 11)

set(ENABLE_GTEST OFF CACHE BOOL "")
set(BUILD_GTEST OFF CACHE BOOL "")
Expand Down
52 changes: 28 additions & 24 deletions elec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,50 +261,54 @@ install(TARGETS cardioid singleCell

### Getting compile flags for making plugins.

function(get_recursive_libs retvar target)
set(${retvar} "" PARENT_SCOPE)
if (NOT TARGET ${target})
return()
endif()

get_target_property(libs ${target} INTERFACE_LINK_LIBRARIES)
set(retval "${libs}")
foreach(lib ${libs})
get_recursive_libs(recursive_val ${lib} ${prop} ${searched})
list(APPEND retval ${recursive_val})
endforeach()

function(get_recursive_list retvar target prop)
list(REMOVE_DUPLICATES retval)
set(${retvar} "${retval}" PARENT_SCOPE)
endfunction()

function(get_recursive_props retvar target prop)
set(${retvar} "" PARENT_SCOPE)
if (NOT TARGET ${target})
return()
endif()
set(searched ${ARGN})
list(APPEND searched ${target})
#message(SEND_ERROR "=== ${target} ${prop} ${searched}")

set(${retval} "")
get_property(propval TARGET ${target} PROPERTY ${prop} SET)
if (propval)
get_target_property(propval ${target} ${prop})
list(APPEND retval ${propval})
endif()
get_recursive_libs(libs target)

get_target_property(libs ${target} INTERFACE_LINK_LIBRARIES)
set(retval "")
foreach(lib ${libs})
list(FIND searched ${lib} lib_has_been_searched)
#message(SEND_ERROR "+++ ${lib} ${lib_has_been_searched}")
if (lib_has_been_searched EQUAL -1)
get_recursive_list(recursive_val ${lib} ${prop} ${searched})
list(APPEND retval ${recursive_val})
get_property(propval TARGET ${lib} PROPERTY ${prop} SET)
if (propval)
get_target_property(propval ${target} ${prop})
list(APPEND retval ${propval})
endif()
endforeach()

set(${retvar} ${retval} PARENT_SCOPE)
#message(SEND_ERROR "--- ${target} ${prop} ${retval}")
endfunction()


set(runtime_includes "")
get_recursive_list(val heart_gpu_aware INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
get_recursive_props(val heart_gpu_aware INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
list(APPEND runtime_includes ${val})
get_recursive_list(val heart_gpu_aware INTERFACE_INCLUDE_DIRECTORIES)
get_recursive_props(val heart_gpu_aware INTERFACE_INCLUDE_DIRECTORIES)
list(APPEND runtime_includes ${val})

set(runtime_defs "")
get_recursive_list(val heart_gpu_aware INTERFACE_COMPILE_DEFINITIONS)
get_recursive_props(val heart_gpu_aware INTERFACE_COMPILE_DEFINITIONS)
list(APPEND runtime_defs ${val})

set(runtime_flags "")
get_recursive_list(val heart_gpu_aware INTERFACE_COMPILE_OPTIONS)
get_recursive_props(val heart_gpu_aware INTERFACE_COMPILE_OPTIONS)
list(APPEND runtime_flags ${val})

set(heart_compile_flags "")
Expand Down

0 comments on commit 2f66d9f

Please sign in to comment.