Skip to content

Commit

Permalink
working version
Browse files Browse the repository at this point in the history
  • Loading branch information
cpt-harlock committed Jan 3, 2025
1 parent fc9e90d commit 20ecde3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
30 changes: 15 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ else()
message(STATUS "HWP-States not available")
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
# MPI
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
# Find MPI and export variable to global scope
#find_package(MPI REQUIRED)
find_package(MPI REQUIRED C)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
# HWLOC
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
find_package(HWLOC REQUIRED)
add_library(cntd_hwloc INTERFACE)
set_target_properties(cntd_hwloc
Expand All @@ -173,18 +173,18 @@ target_include_directories(cntd_hwloc
INTERFACE
${HWLOC_INCLUDE_DIRS})

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
# CUDA
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
if(CNTD_ENABLE_CUDA)
# CMake < 3.17 cannot use find_package(CUDAToolkit)
cmake_minimum_required(VERSION 3.17)
find_package(CUDAToolkit REQUIRED)
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
# MOSQUITTO
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
if(CNTD_ENABLE_MOSQUITTO)
find_package(MOSQUITTO REQUIRED)
add_library(cntd_mosquitto INTERFACE)
Expand All @@ -196,9 +196,9 @@ if(CNTD_ENABLE_MOSQUITTO)
${MOSQUITTO_INCLUDE_DIR})
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
# libfort
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
find_package(libfort)
# if libfort is not found, use the
if (NOT libfort_FOUND)
Expand All @@ -223,9 +223,9 @@ if (NOT libfort_FOUND)
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/libfort/include)
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
# Get compile definitions
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
if(DEFINED ENV{CNTD_GET_COMPILE_DEFINITIONS})
get_directory_property(DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
foreach(d ${DirDefs})
Expand All @@ -234,9 +234,9 @@ if(DEFINED ENV{CNTD_GET_COMPILE_DEFINITIONS})
message(STATUS "All compile definitions: " ${DirDefs})
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
# Add directories
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###########################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #########################
add_subdirectory(src)


Expand All @@ -250,4 +250,4 @@ if (CLANG_FORMAT)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()

add_subdirectory(./regression)
add_subdirectory(regression)
7 changes: 7 additions & 0 deletions regression/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_executable(hello hello.c)
target_link_libraries(hello ${MPI_LIBRARIES})
target_include_directories(hello PRIVATE ${MPI_INCLUDE_PATH})
# find executable path
# add test to run the executable with mpirun
add_test(NAME Regression COMMAND "mpirun" "${CMAKE_BINARY_DIR}/regression/hello")
set_property(TEST Regression PROPERTY ENVIRONMENT LD_PRELOAD=/leonardo/home/userinternal/amonteru/countdown/build/src/libcntd.so)

0 comments on commit 20ecde3

Please sign in to comment.