From e27df5a5fe365480b0809ce523b0e9cd1096a43d Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 7 Jan 2019 20:57:18 -0600 Subject: Add variables to set up module switch between configure and build for cross compiling on CrayXC40. --- config/cmake/scripts/CTestScript.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index bfe9c4e..eb466d2 100644 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -254,6 +254,15 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") endif () + # On Cray XC40, configuring fails in the Fortran section when using the craype-mic-knl module. + # When the configure phase is done with the craype-haswell module and the build phase is done + # with the craype-mic-knl module, configure succeeds and tests pass on the knl compute nodes + # for Intel, Cray, GCC and Clang compilers. If the variables aren't set or if not + # cross compiling, the module switch will not occur. + if (CMAKE_CROSSCOMPILING AND COMPILENODE_HWCOMPILE_MODULE AND COMPUTENODE_HWCOMPILE_MODULE) + execute_process (COMMAND module switch ${COMPILENODE_HWCOMPILE_MODULE} ${COMPUTENODE_HWCOMPILE_MODULE}) + endif () + ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval) if (LOCAL_SUBMIT) ctest_submit (PARTS Build) -- cgit v0.12