Fix Nanos6 and NODES rt tests

This commit is contained in:
Rodrigo Arias 2023-05-31 19:16:18 +02:00
parent 5a7f7b0f70
commit f8a15df1b9
2 changed files with 10 additions and 21 deletions

View File

@ -1,11 +1,8 @@
# Copyright (c) 2022 Barcelona Supercomputing Center (BSC) # Copyright (c) 2022 Barcelona Supercomputing Center (BSC)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
find_package(Nanos6) include(CheckOmpSs2Compiler)
if(NOT OMPSS2_COMPILER_FOUND)
include(CheckCCompilerFlag)
check_c_compiler_flag("-fompss-2" HAVE_FOMPSS2_FLAG)
if(NOT HAVE_FOMPSS2_FLAG)
if(ENABLE_ALL_TESTS) if(ENABLE_ALL_TESTS)
message(FATAL_ERROR "Compiler doesn't support -fompss-2 flag, cannot enable Nanos6 RT tests") message(FATAL_ERROR "Compiler doesn't support -fompss-2 flag, cannot enable Nanos6 RT tests")
else() else()
@ -14,6 +11,7 @@ if(NOT HAVE_FOMPSS2_FLAG)
return() return()
endif() endif()
find_package(Nanos6)
if(NOT NANOS6_FOUND) if(NOT NANOS6_FOUND)
if(ENABLE_ALL_TESTS) if(ENABLE_ALL_TESTS)
message(FATAL_ERROR "Nanos6 not found, cannot enable Nanos6 RT tests") message(FATAL_ERROR "Nanos6 not found, cannot enable Nanos6 RT tests")
@ -32,9 +30,8 @@ function(nanos6_rt_test)
cmake_parse_arguments( cmake_parse_arguments(
NANOS6_TEST "${switches}" "${single}" "${multi}" ${ARGN}) NANOS6_TEST "${switches}" "${single}" "${multi}" ${ARGN})
ovni_test(${ARGN}) ovni_test(${ARGN})
target_compile_options("${OVNI_TEST_NAME}" PUBLIC "-fompss-2") target_compile_options("${OVNI_TEST_NAME}" PUBLIC "-fompss-2=libnanos6")
target_link_options("${OVNI_TEST_NAME}" PUBLIC "-fompss-2") target_link_options("${OVNI_TEST_NAME}" PUBLIC "-fompss-2=libnanos6")
target_link_libraries("${OVNI_TEST_NAME}" PRIVATE Nanos6::nanos6)
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
ENVIRONMENT "NANOS6_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nanos6/nanos6.toml") ENVIRONMENT "NANOS6_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nanos6/nanos6.toml")
if(NANOS6_TEST_LEVEL) if(NANOS6_TEST_LEVEL)

View File

@ -1,11 +1,8 @@
# Copyright (c) 2022-2023 Barcelona Supercomputing Center (BSC) # Copyright (c) 2022-2023 Barcelona Supercomputing Center (BSC)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
find_package(Nodes) include(CheckOmpSs2Compiler)
if(NOT OMPSS2_COMPILER_FOUND)
include(CheckCCompilerFlag)
check_c_compiler_flag("-fompss-2" HAVE_FOMPSS2_FLAG)
if(NOT HAVE_FOMPSS2_FLAG)
if(ENABLE_ALL_TESTS) if(ENABLE_ALL_TESTS)
message(FATAL_ERROR "Compiler doesn't support -fompss-2 flag, cannot enable NODES RT tests") message(FATAL_ERROR "Compiler doesn't support -fompss-2 flag, cannot enable NODES RT tests")
else() else()
@ -14,6 +11,7 @@ if(NOT HAVE_FOMPSS2_FLAG)
return() return()
endif() endif()
find_package(Nodes)
if(NOT NODES_FOUND) if(NOT NODES_FOUND)
if(ENABLE_ALL_TESTS) if(ENABLE_ALL_TESTS)
message(FATAL_ERROR "NODES not found, cannot enable NODES RT tests") message(FATAL_ERROR "NODES not found, cannot enable NODES RT tests")
@ -28,14 +26,8 @@ endif()
function(nodes_rt_test) function(nodes_rt_test)
ovni_test(${ARGN}) ovni_test(${ARGN})
target_compile_options("${OVNI_TEST_NAME}" PUBLIC target_compile_options("${OVNI_TEST_NAME}" PUBLIC "-fompss-2=libnodes")
"-fompss-2" "-fdo-not-use-nanos6") target_link_options("${OVNI_TEST_NAME}" PUBLIC "-fompss-2=libnodes")
target_link_options("${OVNI_TEST_NAME}" PUBLIC
"-fompss-2" "-fdo-not-use-nanos6" "-z" "lazy"
"-rpath" "${NODES_HOME}/lib")
target_link_libraries("${OVNI_TEST_NAME}" PRIVATE Nodes::nodes Nodes::wrapper)
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
ENVIRONMENT "NANOS6_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nodes/nanos6.toml") ENVIRONMENT "NANOS6_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nodes/nanos6.toml")