Skip to content

Commit c6e2410

Browse files
committed
ENH: Only run python summary tests with compatible versions
The summary tests python script requires features that are only available in python 2.7 and greater. If the python version is insufficient, simply disable the summary tests. This was identified on a nightly dashboard build zoot.icl.utk.edu where the python version found is 2.4.
1 parent 86f6b1e commit c6e2410

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ set(
3737
configure_file(
3838
"${LAPACK_SOURCE_DIR}/CTestCustom.cmake.in"
3939
"${LAPACK_BINARY_DIR}/CTestCustom.cmake"
40-
COPYONLY
40+
@ONLY
4141
)
4242

4343
# Add the CMake directory for custon CMake modules
@@ -85,10 +85,12 @@ if ( CMAKE_Fortran_COMPILER_ID STREQUAL "Compaq" )
8585
endif()
8686

8787
# Get Python
88-
find_package(PythonInterp)
89-
message(STATUS "Looking for Python found - ${PYTHONINTERP_FOUND}")
88+
message(STATUS "Looking for Python greater than 2.6 - ${PYTHONINTERP_FOUND}")
89+
find_package(PythonInterp 2.7) # lapack_testing.py uses features from python 2.7 and greater
9090
if (PYTHONINTERP_FOUND)
9191
message(STATUS "Using Python version ${PYTHON_VERSION_STRING}")
92+
else()
93+
message(STATUS "No suitable Python version found, so skipping summary tests.")
9294
endif()
9395
# --------------------------------------------------
9496

CTestCustom.cmake.in

+7-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,10 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
4343
"Character string truncated to length 1 on assignment"
4444
)
4545

46-
set(CTEST_CUSTOM_POST_TEST "./lapack_testing.py -s -d TESTING")
46+
# Only rung post test if suitable python interpreter was found
47+
set(PYTHONINTERP_FOUND @PYTHONINTERP_FOUND@)
48+
set(PYTHON_EXECUTABLE @PYTHON_EXECUTABLE@)
49+
if(PYTHONINTERP_FOUND)
50+
set(CTEST_CUSTOM_POST_TEST "${PYTHON_EXECUTABLE} ./lapack_testing.py -s -d TESTING")
51+
endif()
52+

TESTING/CMakeLists.txt

+10-7
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,13 @@ if (BUILD_COMPLEX)
307307
endif()
308308

309309
# ==============================================================================
310-
311-
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${LAPACK_SOURCE_DIR}/lapack_testing.py ${LAPACK_BINARY_DIR})
312-
add_test(
313-
NAME LAPACK_Test_Summary
314-
WORKING_DIRECTORY ${LAPACK_BINARY_DIR}
315-
COMMAND ${PYTHON_EXECUTABLE} "lapack_testing.py"
316-
)
310+
# Only run this test if python 2.7 or greater is found
311+
if(PYTHONINTERP_FOUND)
312+
message(STATUS "Running Summary")
313+
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${LAPACK_SOURCE_DIR}/lapack_testing.py ${LAPACK_BINARY_DIR})
314+
add_test(
315+
NAME LAPACK_Test_Summary
316+
WORKING_DIRECTORY ${LAPACK_BINARY_DIR}
317+
COMMAND ${PYTHON_EXECUTABLE} "lapack_testing.py"
318+
)
319+
endif()

0 commit comments

Comments
 (0)