diff --git a/cmake/tribits/CHANGELOG.md b/cmake/tribits/CHANGELOG.md index b3f1edd1ef0d..d824c7810d16 100644 --- a/cmake/tribits/CHANGELOG.md +++ b/cmake/tribits/CHANGELOG.md @@ -2,6 +2,46 @@ ChangeLog for TriBITS ---------------------------------------- +## 2024-10-08: + +* **Changed:** The TriBITS framework find operation for + Python[†](#tribits_python_support) has been changed from + calling `find_package(PythonInterp)` (which uses the deprecated + `FindPythonInterp.cmake` module) to calling `find_package(Python3)` (which + uses [FindPython3.cmake]). In the process, the internal CMake cache + variable set by this operation was changed from `PYTHON_EXECUTABLE` to + `Python3_EXECUTABLE`, and TriBITS projects need make that change as well + when upgrading TriBITS. (This change can be made automatically in all of + the project's CMake files by running the script + `tribits/refactoring/to-python3.sh `.) However, backward compatibility + is provided for users confiugring TriBITS CMake projects which set `-D + PYTHON_EXECUTABLE=`. In this case, if user sets `-D + PYTHON_EXECUTABLE=` in the cache, TriBITS will set that value `` + to the variable `Python3_EXECUTABLE` and avoid the call to + `find_package(Python3)` (however, a deprecation warning we be issued by + default, see [tribits_deprecated()] and [adjusting CMake DEPRECATION + warnings]). TriBITS project users should change to use `-D + Python3_EXECUTABLE=` instead, or just remove setting + `PYTHON_EXECUTABLE` or `Python3_EXECUTABLE` altogether and just make sure + that the desired `python3` executable is in the path. See issue + [TriBITSPub/TriBITS#610] for more details. + +† **TriBITS Python Support**: See "Find Python" at [Full Processing of TriBITS Project Files], [Python Support] and [Setting or disabling Python] + +[FindPython3.cmake]: https://cmake.org/cmake/help/latest/module/FindPython3.html + +[Full Processing of TriBITS Project Files]: https://tribitspub.github.io/TriBITS/users_guide/index.html#full-tribits-project-configuration + +[Python Support]: https://tribitspub.github.io/TriBITS/users_guide/index.html#python-support + +[Setting or disabling Python]: https://tribitspub.github.io/TriBITS/build_ref/index.html#setting-or-disabling-python + +[tribits_deprecated()]: https://tribitspub.github.io/TriBITS/users_guide/index.html#tribits-deprecated + +[Adjusting CMake DEPRECATION warnings]: https://tribitspub.github.io/TriBITS/build_ref/index.html#adjusting-cmake-deprecation-warnings + +[TriBITSPub/TriBITS#610]: https://github.com/TriBITSPub/TriBITS/issues/610 + ## 2023-06-22: * **Added:** Packages are now determined to be missing if their dependencies diff --git a/cmake/tribits/LICENSE b/cmake/tribits/LICENSE index 107d3f0d3c7e..266ee2add564 100644 --- a/cmake/tribits/LICENSE +++ b/cmake/tribits/LICENSE @@ -1,3 +1,5 @@ +SPDX-License-Identifier: BSD-3-Clause + Copyright (c) 2013 NTESS and the TriBITS contributors. Redistribution and use in source and binary forms, with or without diff --git a/cmake/tribits/ci_support/TribitsDependencies.py b/cmake/tribits/ci_support/TribitsDependencies.py index fae95321a442..2ba8d611ec6f 100644 --- a/cmake/tribits/ci_support/TribitsDependencies.py +++ b/cmake/tribits/ci_support/TribitsDependencies.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake b/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake index 75b0a02763a4..021a235e45a3 100644 --- a/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake +++ b/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake @@ -52,7 +52,7 @@ macro(tribits_write_xml_dependency_files) " ${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE} ..." ) set(tribitsCiSupportDir "${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CI_SUPPORT_DIR}") execute_process( - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${tribitsCiSupportDir}/dump-package-dep-table.py --input-xml-deps-file=${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} --output-html-deps-file=${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE} ) @@ -70,7 +70,7 @@ macro(tribits_write_xml_dependency_files) "${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CTEST_DRIVER_DIR}") if (EXISTS "${tribitsCtestDriverDir}") execute_process( - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${tribitsCtestDriverDir}/dump-cdash-deps-xml-file.py --input-xml-deps-file=${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} --output-cdash-deps-xml-file=${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) diff --git a/cmake/tribits/ci_support/cdash_analyze_and_report.py b/cmake/tribits/ci_support/cdash_analyze_and_report.py index 6062f4526eff..9f64282df9d2 100755 --- a/cmake/tribits/ci_support/cdash_analyze_and_report.py +++ b/cmake/tribits/ci_support/cdash_analyze_and_report.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/ci_support/cdash_build_testing_date.py b/cmake/tribits/ci_support/cdash_build_testing_date.py index 1791e68da2cc..fb2fb04ee568 100755 --- a/cmake/tribits/ci_support/cdash_build_testing_date.py +++ b/cmake/tribits/ci_support/cdash_build_testing_date.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/ci_support/checkin-test.py b/cmake/tribits/ci_support/checkin-test.py index b7132ea32335..23d95e307570 100755 --- a/cmake/tribits/ci_support/checkin-test.py +++ b/cmake/tribits/ci_support/checkin-test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/ci_support/clone_extra_repos.py b/cmake/tribits/ci_support/clone_extra_repos.py index 0b7d457c6b1a..cc2d6f5cfa7f 100755 --- a/cmake/tribits/ci_support/clone_extra_repos.py +++ b/cmake/tribits/ci_support/clone_extra_repos.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/ci_support/dump-package-dep-table.py b/cmake/tribits/ci_support/dump-package-dep-table.py index 7bfe11fe303b..216a7c2f7f5f 100755 --- a/cmake/tribits/ci_support/dump-package-dep-table.py +++ b/cmake/tribits/ci_support/dump-package-dep-table.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/ci_support/filter-packages-list.py b/cmake/tribits/ci_support/filter-packages-list.py index 6bb1f7fea5fd..8a70816c4df5 100755 --- a/cmake/tribits/ci_support/filter-packages-list.py +++ b/cmake/tribits/ci_support/filter-packages-list.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/ci_support/get-tribits-packages-from-last-tests-failed.py b/cmake/tribits/ci_support/get-tribits-packages-from-last-tests-failed.py index 3f322e1c5330..8e9d6d0e2a48 100755 --- a/cmake/tribits/ci_support/get-tribits-packages-from-last-tests-failed.py +++ b/cmake/tribits/ci_support/get-tribits-packages-from-last-tests-failed.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/ci_support/get-tribits-packages.py b/cmake/tribits/ci_support/get-tribits-packages.py index 1f5c0e8b7598..6454ad55d632 100755 --- a/cmake/tribits/ci_support/get-tribits-packages.py +++ b/cmake/tribits/ci_support/get-tribits-packages.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/ci_support/is_checkin_tested_commit.py b/cmake/tribits/ci_support/is_checkin_tested_commit.py index 19a68702ead8..e09ced5be1b6 100755 --- a/cmake/tribits/ci_support/is_checkin_tested_commit.py +++ b/cmake/tribits/ci_support/is_checkin_tested_commit.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/core/common/TribitsConstants.cmake b/cmake/tribits/core/common/TribitsConstants.cmake index 8c5906c78efd..26af761c39ed 100644 --- a/cmake/tribits/core/common/TribitsConstants.cmake +++ b/cmake/tribits/core/common/TribitsConstants.cmake @@ -14,8 +14,9 @@ set(TRIBITS_CMAKE_MINIMUM_REQUIRED 3.23.0) macro(tribits_asesrt_minimum_cmake_version) if (CMAKE_VERSION VERSION_LESS ${TRIBITS_CMAKE_MINIMUM_REQUIRED}) - message(FATAL_ERROR "Error, TriBiTS must have version" - " ${TRIBITS_CMAKE_MINIMUM_REQUIRED} or higher!") + message(FATAL_ERROR "Error, this TriBITS project ${PROJECT_NAME} must have a" + " version of CMake ${TRIBITS_CMAKE_MINIMUM_REQUIRED} or higher but was" + " only provided CMake version ${CMAKE_VERSION}!" ) endif() endmacro() diff --git a/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 120f2f65d776..d62d67fbb396 100644 --- a/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -418,20 +418,23 @@ endmacro() # macro(tribits_disable_parents_subpackages parentPackageName) - if(NOT ${PROJECT_NAME}_ENABLE_${parentPackageName} - AND (NOT ${PROJECT_NAME}_ENABLE_${parentPackageName} STREQUAL "") - ) + tribits_package_is_explicitly_disabled(${PROJECT_NAME}_ENABLE_${parentPackageName} + parentPackageIsExplicityDisabled) + + if(parentPackageIsExplicityDisabled) foreach(tap2_subPkgName IN LISTS ${parentPackageName}_SUBPACKAGES) set(subpkgFullName ${parentPackageName}${tap2_subPkgName}) - if (NOT ${PROJECT_NAME}_ENABLE_${subpkgFullName} STREQUAL "OFF") - set(packageBeingDisabledVarName ${PROJECT_NAME}_ENABLE_${subpkgFullName}) + set(subpkgBeingDisabledVarName ${PROJECT_NAME}_ENABLE_${subpkgFullName}) + tribits_package_is_explicitly_disabled(${subpkgBeingDisabledVarName} + subpkgIExplicitlyDisabled) + if (NOT subpkgIsExplicitlyDisabled) message("-- " - "Setting subpackage enable ${packageBeingDisabledVarName}=OFF" + "Setting subpackage enable ${subpkgBeingDisabledVarName}=OFF" " because parent package ${PROJECT_NAME}_ENABLE_${parentPackageName}=OFF") - set(${packageBeingDisabledVarName} OFF) + set(${subpkgBeingDisabledVarName} OFF) endif() endforeach() @@ -439,13 +442,20 @@ macro(tribits_disable_parents_subpackages parentPackageName) endif() endmacro() +# +# NOTE: Above, we don't need to use the function +# tribits_get_package_enable_status() because a subpackage in this context +# will never be an external package and therefore the enable var name will +# always be ${PROJECT_NAME}_ENABLE_${subpkgFullName}. (At least I can't think +# of a use case where that would occur.) # Macro that disables forward package that depends on the passed-in package # macro(tribits_disable_forward_required_dep_packages packageName) tribits_get_package_enable_status(${packageName} packageEnable "") - if ((NOT packageEnable) AND (NOT "${packageEnable}" STREQUAL "")) + tribits_package_is_explicitly_disabled(packageEnable packageIsExplicitlyDisabled) + if (packageIsExplicitlyDisabled) foreach(fwdDepPkg IN LISTS ${packageName}_FORWARD_LIB_DEFINED_DEPENDENCIES) if (${fwdDepPkg}_LIB_DEP_REQUIRED_${packageName}) tribits_private_disable_required_package_enables(${fwdDepPkg} @@ -475,13 +485,13 @@ macro(tribits_enable_parents_subpackages parentPackageName) foreach(tap2_subPkgName IN LISTS ${parentPackageName}_SUBPACKAGES) set(subpkgFullName ${parentPackageName}${tap2_subPkgName}) + tribits_package_is_explicitly_disabled(${PROJECT_NAME}_ENABLE_${subpkgFullName} + subpkgIsExplicitlyDisabled) - if (NOT ${PROJECT_NAME}_ENABLE_${subpkgFullName} AND - NOT "${${PROJECT_NAME}_ENABLE_${subpkgFullName}}" STREQUAL "" - ) - # The subpackage is already disabled and is not just empty! + if (subpkgIsExplicitlyDisabled) + # The subpackage is already explicitly disabled elseif (${PROJECT_NAME}_ENABLE_${subpkgFullName}) - # The subpackage is already enabled so there is no reason to enable it! + # The subpackage is already enabled so there is no reason to enable it else() # The subpackage is not hard off or on so turn it on by default tribits_implicit_package_enable_is_allowed( "" ${subpkgFullName} @@ -513,7 +523,7 @@ macro(tribits_apply_all_package_enables packageName) tribits_implicit_package_enable_is_allowed( "" ${packageName} processThisPackageEnable ) if (packageIsPmpp AND processThisPackageEnable) - tribits_set_package_enable_based_on_project_enable( + tribits_enable_package_based_on_project_enable_on( ${PROJECT_NAME}_ENABLE_ALL_PACKAGES ${PROJECT_NAME}_ENABLE_${packageName} ) endif() endmacro() @@ -548,8 +558,9 @@ endmacro() # ${parentPackageName)_ENABLE_TESTS is explicitly disabled. # macro(tribits_apply_package_examples_disable parentPackageName) - if ( (NOT ${parentPackageName}_ENABLE_TESTS) - AND (NOT "${${parentPackageName}_ENABLE_TESTS}" STREQUAL "") + tribits_package_is_explicitly_disabled(${parentPackageName}_ENABLE_TESTS + parentPackageTestsIsExplicitlyDisabled) + if (parentPackageTestsIsExplicitlyDisabled AND ("${${parentPackageName}_ENABLE_EXAMPLES}" STREQUAL "") ) message("-- " "Setting" @@ -574,7 +585,9 @@ macro(tribits_apply_subpackage_tests_or_examples_disables parentPackageName testsOrExamples ) set(parentPkgEnableVar ${parentPackageName}_ENABLE_${testsOrExamples}) - if ((NOT ${parentPkgEnableVar}) AND (NOT "${${parentPkgEnableVar}}" STREQUAL "")) + tribits_package_is_explicitly_disabled(${parentPkgEnableVar} + parentPkgIsExplicitlyDisabled) + if (parentPkgIsExplicitlyDisabled) foreach(subpkgName IN LISTS ${parentPackageName}_SUBPACKAGES) set(fullSpkgName ${parentPackageName}${subpkgName}) if (${PROJECT_NAME}_ENABLE_${fullSpkgName}) @@ -599,9 +612,9 @@ macro(tribits_apply_test_example_enables packageName) if (${PROJECT_NAME}_ENABLE_${packageName}) tribits_is_primary_meta_project_package(${packageName} packageIsPmmp) if (packageIsPmmp) - tribits_set_package_enable_based_on_project_enable_on( + tribits_enable_package_based_on_project_enable_on( ${PROJECT_NAME}_ENABLE_TESTS ${packageName}_ENABLE_TESTS ) - tribits_set_package_enable_based_on_project_enable_on( + tribits_enable_package_based_on_project_enable_on( ${PROJECT_NAME}_ENABLE_EXAMPLES ${packageName}_ENABLE_EXAMPLES ) endif() endif() @@ -936,7 +949,9 @@ macro(tribits_private_disable_required_package_enables fwdDepPkgName packageName libraryDep ) tribits_get_package_enable_status(${fwdDepPkgName} "" fwdDepPkgEnableVarName) - if (${fwdDepPkgEnableVarName} OR "${${fwdDepPkgEnableVarName}}" STREQUAL "") + tribits_package_is_enabled_or_unset(${fwdDepPkgEnableVarName} + fwdDepPkgIsEnabledOrUnset) + if (fwdDepPkgIsEnabledOrUnset) if ("${libraryDep}" STREQUAL "TRUE") tribits_private_print_disable_required_package_enable( ${packageName} ${fwdDepPkgEnableVarName} @@ -944,18 +959,18 @@ macro(tribits_private_disable_required_package_enables set(${fwdDepPkgEnableVarName} OFF) else() set(depTypeStr "test/example") - if (${fwdDepPkgName}_ENABLE_TESTS - OR "${${fwdDepPkgName}_ENABLE_TESTS}" STREQUAL "" - ) + tribits_package_is_enabled_or_unset(${fwdDepPkgName}_ENABLE_TESTS + fwdDepPkgEnableTestsIsEnabledOrUnset) + if (fwdDepPkgEnableTestsIsEnabledOrUnset) tribits_private_print_disable_required_package_enable( ${packageName} ${fwdDepPkgName}_ENABLE_TESTS ${fwdDepPkgName} "${depTypeStr}" ) set(${fwdDepPkgName}_ENABLE_TESTS OFF) endif() - if (${fwdDepPkgName}_ENABLE_EXAMPLES - OR "${${fwdDepPkgName}_ENABLE_EXAMPLES}" STREQUAL "" - ) + tribits_package_is_enabled_or_unset(${fwdDepPkgName}_ENABLE_EXAMPLES + fwdDepPkgEnableExamplesIsEnabledOrUnset) + if (fwdDepPkgEnableExamplesIsEnabledOrUnset) tribits_private_print_disable_required_package_enable( ${packageName} ${fwdDepPkgName}_ENABLE_EXAMPLES ${fwdDepPkgName} "${depTypeStr}" ) @@ -1013,9 +1028,9 @@ endfunction() macro(tribits_private_disable_optional_package_enables fwdDepPkgName packageName) - if (${fwdDepPkgName}_ENABLE_${packageName} - OR "${${fwdDepPkgName}_ENABLE_${packageName}}" STREQUAL "" - ) + tribits_package_is_enabled_or_unset(${fwdDepPkgName}_ENABLE_${packageName} + fwdDepPkgEnablePackageIsEnabledOrUnset) + if (fwdDepPkgEnablePackageIsEnabledOrUnset) # Always disable the conditional enable but only print the message if the # package is enabled or if a disable overrides an enable if (${PROJECT_NAME}_ENABLE_${fwdDepPkgName}) @@ -1032,10 +1047,9 @@ macro(tribits_private_disable_optional_package_enables fwdDepPkgName packageNa " on disabled package ${packageName}") endif() endif() - if (${fwdDepPkgName}_ENABLE_${packageName} - AND (NOT ${PROJECT_NAME}_ENABLE_${packageName}) - AND (NOT "${${PROJECT_NAME}_ENABLE_${packageName}}" STREQUAL "") - ) + tribits_package_is_explicitly_disabled(${PROJECT_NAME}_ENABLE_${packageName} + packageIsExplicitlyDisabled) + if (${fwdDepPkgName}_ENABLE_${packageName} AND packageIsExplicitlyDisabled) message("-- " "NOTE: ${fwdDepPkgName}_ENABLE_${packageName}=" "${${fwdDepPkgName}_ENABLE_${packageName}} but" " ${PROJECT_NAME}_ENABLE_${packageName}=" @@ -1048,37 +1062,10 @@ macro(tribits_private_disable_optional_package_enables fwdDepPkgName packageNa endmacro() -# Set an individual package variable enable variable (to ON or OFF) based on a -# global enable value -# -macro(tribits_set_package_enable_based_on_project_enable projectEnableVar - packageEnableVar - ) - - if ("${${packageEnableVar}}" STREQUAL "") - if (${projectEnableVar}) - message("-- " "Setting ${packageEnableVar}=ON") - set(${packageEnableVar} ON) - elseif ( (NOT ${projectEnableVar}) - AND (NOT "${projectEnableVar}" STREQUAL "") - ) - message("-- " "Setting ${packageEnableVar}=OFF") - set(${packageEnableVar} OFF) - else() - # Otherwise, we will leave it up the the individual package - # to decide? - endif() - else() - # "${packageEnableVar} not at the default empty '' - endif() - -endmacro() - - # Set an individual package test or examples enable to on only if global # enable var is on # -macro(tribits_set_package_enable_based_on_project_enable_on projectEnableVar +macro(tribits_enable_package_based_on_project_enable_on projectEnableVar packageEnableVar ) if (("${${packageEnableVar}}" STREQUAL "") AND ${projectEnableVar}) @@ -1133,7 +1120,9 @@ endmacro() macro(tribits_private_postprocess_optional_package_enable packageName optDepPkg) tribits_get_package_enable_status(${optDepPkg} optDepPkgEnable optDepPkgEnableVar) - tribits_get_package_enable_status(${packageName} packageEnable packageEnableVar) + tribits_get_package_enable_status(${packageName} packageEnable packageEnableVar) + tribits_package_is_explicitly_disabled(${packageName}_ENABLE_${optDepPkg} + package_Enable_OptDeptPkg_IsExplicitlyDisabled) if (${packageName}_ENABLE_${optDepPkg} AND optDepPkgEnable) message("-- " "NOTE:" @@ -1149,10 +1138,7 @@ macro(tribits_private_postprocess_optional_package_enable packageName optDepPk message("-- " "NOT setting ${packageName}_ENABLE_${optDepPkg}=ON" " since ${optDepPkg} is NOT enabled at this point!") endif() - elseif ((NOT "${${packageName}_ENABLE_${optDepPkg}}" STREQUAL "") - AND (NOT ${packageName}_ENABLE_${optDepPkg}) - AND optDepPkgEnable - ) + elseif (package_Enable_OptDeptPkg_IsExplicitlyDisabled AND optDepPkgEnable) message("-- " "NOTE: ${packageName}_ENABLE_${optDepPkg}=" "${${packageName}_ENABLE_${optDepPkg}} is already set so not enabling even" " though ${optDepPkgEnableVar}=" diff --git a/cmake/tribits/core/package_arch/TribitsFindPythonInterp.cmake b/cmake/tribits/core/package_arch/TribitsFindPythonInterp.cmake index 3e57bbbe0cc3..209fbd47e004 100644 --- a/cmake/tribits/core/package_arch/TribitsFindPythonInterp.cmake +++ b/cmake/tribits/core/package_arch/TribitsFindPythonInterp.cmake @@ -7,34 +7,6 @@ # ***************************************************************************** # @HEADER -# Find Python executable which is needed for dependency file building -macro(tribits_find_python) - set(PythonInterp_FIND_VERSION_MIN "2.6") - if ("${PythonInterp_FIND_VERSION_DEFAULT}" STREQUAL "") - set(PythonInterp_FIND_VERSION_DEFAULT "${PythonInterp_FIND_VERSION_MIN}") - endif() - advanced_set(PythonInterp_FIND_VERSION ${PythonInterp_FIND_VERSION_DEFAULT} - CACHE STRING - "Default version of Python to find (must be ${PythonInterp_FIND_VERSION_DEFAULT} or greater") - if (PythonInterp_FIND_VERSION VERSION_LESS "${PythonInterp_FIND_VERSION_MIN}") - message_wrapper(FATAL_ERROR "Error," - " PythonInterp_FIND_VERSION=${PythonInterp_FIND_VERSION} < ${PythonInterp_FIND_VERSION_MIN}" - " is not allowed!" ) - endif() - advanced_set(PythonInterp_MUST_BE_FOUND FALSE CACHE BOOL "Require Python to be found or not.") - if (${PROJECT_NAME}_REQUIRES_PYTHON) - set(PythonInterp_REQUIRED_ARG "REQUIRED") - else() - set(PythonInterp_REQUIRED_ARG "") - endif() - set(FIND_PythonInterp_ARGS PythonInterp ${PythonInterp_REQUIRED_ARG}) - if (TRIBITS_FIND_PYTHON_UNITTEST) - set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE_UNITTEST_VAL}) - else() - find_package(${FIND_PythonInterp_ARGS}) - endif() -endmacro() - # TriBITS Wrapper for finding Python (or not) for a TriBITS project. macro(tribits_find_python_interp) @@ -48,9 +20,9 @@ macro(tribits_find_python_interp) endif() if (${PROJECT_NAME}_USES_PYTHON) tribits_find_python() - print_var(PYTHON_EXECUTABLE) - if (${PROJECT_NAME}_REQUIRES_PYTHON AND PYTHON_EXECUTABLE STREQUAL "") - message_wrapper(FATAL_ERROR "Error, PYTHON_EXECUTABLE='' but" + print_var(Python3_EXECUTABLE) + if (${PROJECT_NAME}_REQUIRES_PYTHON AND Python3_EXECUTABLE STREQUAL "") + message_wrapper(FATAL_ERROR "Error, Python3_EXECUTABLE='' but" " ${PROJECT_NAME}_REQUIRES_PYTHON=${${PROJECT_NAME}_REQUIRES_PYTHON}!" ) endif() else() @@ -58,3 +30,64 @@ macro(tribits_find_python_interp) " ${PROJECT_NAME}_USES_PYTHON='${${PROJECT_NAME}_USES_PYTHON}'") endif() endmacro() + + +# Find Python executable which is needed for dependency file building +macro(tribits_find_python) + tribits_find_python_set_python3_find_version() + tribits_find_python_backward_compatible_python_executable() + tribits_find_python_find_python3() +endmacro() + + +macro(tribits_find_python_set_python3_find_version) + # Get minimum version of Python to find + set(${PROJECT_NAME}_Python3_FIND_VERSION_MIN "3.6") + if ("${${PROJECT_NAME}_Python3_FIND_VERSION_DEFAULT}" STREQUAL "") + set(${PROJECT_NAME}_Python3_FIND_VERSION_DEFAULT + "${${PROJECT_NAME}_Python3_FIND_VERSION_MIN}") + endif() + advanced_set(${PROJECT_NAME}_Python3_FIND_VERSION + ${${PROJECT_NAME}_Python3_FIND_VERSION_DEFAULT} + CACHE STRING + "Default version of Python to find (must be ${${PROJECT_NAME}_Python3_FIND_VERSION_DEFAULT} or greater") + if (${PROJECT_NAME}_Python3_FIND_VERSION VERSION_LESS + "${${PROJECT_NAME}_Python3_FIND_VERSION_MIN}" + ) + message_wrapper(FATAL_ERROR "Error," + " ${PROJECT_NAME}_Python3_FIND_VERSION=${${PROJECT_NAME}_Python3_FIND_VERSION} < ${${PROJECT_NAME}_Python3_FIND_VERSION_MIN}" + " is not allowed!" ) + endif() +endmacro() + + +macro(tribits_find_python_backward_compatible_python_executable) + # Provide backward compatibility for user setting PYTHON_EXECUTABLE + if ((NOT "${PYTHON_EXECUTABLE}" STREQUAL "") AND ("${Python3_EXECUTABLE}" STREQUAL "")) + tribits_deprecated("Python3_EXECUTABLE being set by default to PYTHON_EXECUTABLE = '${PYTHON_EXECUTABLE}' is deprecated!") + set(Python3_EXECUTABLE "${PYTHON_EXECUTABLE}" CACHE FILEPATH + "Set by default to PYTHON_EXECUTABLE!") + endif() +endmacro() + + +macro(tribits_find_python_find_python3) + # Find Python3 + if (${PROJECT_NAME}_REQUIRES_PYTHON) + set(Python3_REQUIRED_ARG "REQUIRED") + else() + set(Python3_REQUIRED_ARG "") + endif() + set(FIND_Python3_ARGS + Python3 ${${PROJECT_NAME}_Python3_FIND_VERSION} ${Python3_REQUIRED_ARG}) + if(DEFINED Python3_EXECUTABLE) + # Already defined (even if it is set to empty), so no need to call anything! + elseif (TRIBITS_FIND_PYTHON_UNITTEST) + set(Python3_EXECUTABLE ${Python3_EXECUTABLE_UNITTEST_VAL}) + else() + find_package(${FIND_Python3_ARGS}) + endif() +endmacro() + + + diff --git a/cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake b/cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake index 2cfeb4946667..062c44c35655 100644 --- a/cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake +++ b/cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake @@ -10,8 +10,8 @@ # @FUNCTION: tribits_get_package_enable_status() # -# Function that determines if a given external or internal package's enable -# status (e.g. 'ON' or 'OFF') +# Function that determines a given external or internal package's enable +# status (e.g. 'ON' or 'OFF' or any valid CMake bool) # # Usage:: # @@ -21,8 +21,8 @@ # On return, if non-empty, the variable ```` will contain # the actual value of ``${${PROJECT_NAME}_ENABLE_}`` or # ``${TPL_ENABLE_}`` or will return empty "". If -# ``${packageName}_PACKAGE_BUILD_STATUS == "INTERNAL", then only the value of -# ``${PROJECT_NAME}_ENABLE_`` will be considered. +# ``${packageName}_PACKAGE_BUILD_STATUS == "INTERNAL"``, then only the value +# of ``${PROJECT_NAME}_ENABLE_`` will be considered. # # On return, if non-empty, the variable ```` will be # either ``${${PROJECT_NAME}_ENABLE_}`` or @@ -61,6 +61,62 @@ function(tribits_get_package_enable_status packageName packageEnableOut endfunction() +# @FUNCTION: tribits_package_is_enabled_or_unset() +# +# Function that determines if a package's enable variable evaluates to true or +# is unset. +# +# Usage:: +# +# tribits_package_is_enabled_or_unset(( +# ) +# +# On return, the value of ```` will set to +# ``TRUE`` if the variable ```` evaluates to true and +# or is empty "". Otherwise, ```` will set +# to ``FALSE`` on return. +# +function(tribits_package_is_enabled_or_unset packageEnableVarName + packageIsEnabledOrUnsetOut + ) + if (${packageEnableVarName} OR ("${${packageEnableVarName}}" STREQUAL "")) + set(packageIsEnabledOrUnset TRUE) + else() + set(packageIsEnabledOrUnset FALSE) + endif() + set(${packageIsEnabledOrUnsetOut} ${packageIsEnabledOrUnset} + PARENT_SCOPE) +endfunction() + + +# @FUNCTION: tribits_package_is_explicitly_disabled() +# +# Function that determines if a package's enable variable is +# explicitly disabled (i.e. evaluates to false but is not emapty). +# +# Usage:: +# +# tribits_package_is_explicitly_disabled(( +# ) +# +# On return, the value of ```` will set to +# ``TRUE`` if the variable ```` evaluates to false and +# is not empty "". Otherwise, ```` will set +# to ``FALSE`` on return. +# +function(tribits_package_is_explicitly_disabled packageEnableVarName + packageIsExplicitlyDisabledOut + ) + if ((NOT ${packageEnableVarName}) AND (NOT "${${packageEnableVarName}}" STREQUAL "")) + set(packageIsExplicitlyDisabled TRUE) + else() + set(packageIsExplicitlyDisabled FALSE) + endif() + set(${packageIsExplicitlyDisabledOut} ${packageIsExplicitlyDisabled} + PARENT_SCOPE) +endfunction() + + # @FUNCTION: tribits_assert_package_enable_status() # # Function that asserts that if both ``${PROJECT_NAME}_ENABLE_${packageName}`` diff --git a/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake b/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake index 5ca67ede6e5f..d060ebd69a65 100644 --- a/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -806,7 +806,7 @@ macro(tribits_define_global_options_and_define_extra_repos) "Output XML file containing ${PROJECT_NAME} dependenices used by tools (if not empty)." ) if(${PROJECT_NAME}_DEPS_DEFAULT_OUTPUT_DIR AND - ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE AND PYTHON_EXECUTABLE + ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE AND Python3_EXECUTABLE ) set(${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE_DEFAULT "${${PROJECT_NAME}_DEPS_DEFAULT_OUTPUT_DIR}/${${PROJECT_NAME}_CDASH_SUBPROJECT_DEPS_XML_FILE_NAME}" ) @@ -819,7 +819,7 @@ macro(tribits_define_global_options_and_define_extra_repos) "Output XML file used by CDash in ${PROJECT_NAME}-independent format (if not empty)." ) if(${PROJECT_NAME}_DEPS_DEFAULT_OUTPUT_DIR AND - ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE AND PYTHON_EXECUTABLE + ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE AND Python3_EXECUTABLE ) set(${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE_DEFAULT "${${PROJECT_NAME}_DEPS_DEFAULT_OUTPUT_DIR}/${${PROJECT_NAME}_PACKAGE_DEPS_TABLE_HTML_FILE_NAME}" ) diff --git a/cmake/tribits/core/test_support/TribitsAddAdvancedTest.cmake b/cmake/tribits/core/test_support/TribitsAddAdvancedTest.cmake index 3a6aa01dc29a..704a0d11e4b4 100644 --- a/cmake/tribits/core/test_support/TribitsAddAdvancedTest.cmake +++ b/cmake/tribits/core/test_support/TribitsAddAdvancedTest.cmake @@ -345,7 +345,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/../utils/PrintVar.cmake") # instead. **WARNING:** If you want to run such tests using valgrind, you # have to use the raw executable as the ```` argument and *not* # the script. For example, if you have a python script -# ``my_python_test.py`` with ``/usr/bin/env python`` at the top, you can't +# ``my_python_test.py`` with ``/usr/bin/env python3`` at the top, you can't # just use:: # # CMND /my_python_test.py ARGS "" "" ... @@ -354,7 +354,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/../utils/PrintVar.cmake") # # Instead, you have to use:: # -# CMND ${PYTHON_EXECUTABLE} ARGS /my_python_test.py ... +# CMND ${Python3_EXECUTABLE} ARGS /my_python_test.py ... # # ``ARGS "" "" ... ""`` # diff --git a/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake b/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake index ccd1a2b8c5ec..d33c29fbfc42 100644 --- a/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake +++ b/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake @@ -141,7 +141,7 @@ tribits_project_read_version_file(${TRIBITS_PROJECT_ROOT}) include(TribitsFindPythonInterp) tribits_find_python() -message("PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}") +message("Python3_EXECUTABLE = ${Python3_EXECUTABLE}") ############################# ### Do some initial setup ### diff --git a/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake b/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake index 76cfa19c6222..e0b7116cc492 100644 --- a/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake +++ b/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake @@ -175,7 +175,7 @@ endfunction() # function(tribits_create_repo_updates_file) extrarepo_execute_process_wrapper( - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${GITDIST_EXE} --dist-no-color log "--pretty=format:%h: %s%nAuthor: %an <%ae>%nDate: %ad%n" --name-status -C ORIG_HEAD..HEAD @@ -376,14 +376,14 @@ macro(enable_only_modified_packages) # A.3) Get the names of the modified packages - if (NOT PYTHON_EXECUTABLE) + if (NOT Python3_EXECUTABLE) message(FATAL_ERROR "Error, Python must be enabled to map from modified" " files to packages!") endif() if (EXISTS "${MODIFIED_FILES_FILE_NAME}") execute_process( - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${${PROJECT_NAME}_TRIBITS_DIR}/ci_support/get-tribits-packages-from-files-list.py --files-list-file=${MODIFIED_FILES_FILE_NAME} --project-dir=${TRIBITS_PROJECT_ROOT} @@ -847,7 +847,7 @@ function(tribits_get_failed_packages_from_failed_tests LAST_TESTS_FAILED_FILE FAILED_PACKAGES_OUT ) execute_process( - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} "${${PROJECT_NAME}_TRIBITS_DIR}/ci_support/get-tribits-packages-from-last-tests-failed.py" "--deps-xml-file=${CTEST_BINARY_DIRECTORY}/${${PROJECT_NAME}_PACKAGE_DEPS_XML_FILE_NAME}" "--last-tests-failed-file=${LAST_TESTS_FAILED_FILE}" diff --git a/cmake/tribits/ctest_driver/dump-cdash-deps-xml-file.py b/cmake/tribits/ctest_driver/dump-cdash-deps-xml-file.py index 3ebc60cd45a0..ceeebe807148 100755 --- a/cmake/tribits/ctest_driver/dump-cdash-deps-xml-file.py +++ b/cmake/tribits/ctest_driver/dump-cdash-deps-xml-file.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/dashboard_driver/tdd_driver.py b/cmake/tribits/dashboard_driver/tdd_driver.py index 099c6b2a9f19..3d68026f46bf 100755 --- a/cmake/tribits/dashboard_driver/tdd_driver.py +++ b/cmake/tribits/dashboard_driver/tdd_driver.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/devtools_install/install-autoconf.py b/cmake/tribits/devtools_install/install-autoconf.py index 700a2a787d40..88b9974acf9f 100755 --- a/cmake/tribits/devtools_install/install-autoconf.py +++ b/cmake/tribits/devtools_install/install-autoconf.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/devtools_install/install-cmake.py b/cmake/tribits/devtools_install/install-cmake.py index fbf07832ad23..2c69291d1392 100755 --- a/cmake/tribits/devtools_install/install-cmake.py +++ b/cmake/tribits/devtools_install/install-cmake.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/devtools_install/install-gcc.py b/cmake/tribits/devtools_install/install-gcc.py index d2cd4fbd1f0e..e2ab794da22b 100755 --- a/cmake/tribits/devtools_install/install-gcc.py +++ b/cmake/tribits/devtools_install/install-gcc.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/devtools_install/install-git.py b/cmake/tribits/devtools_install/install-git.py index 4a52a2d3d102..3a9ee1ba4d66 100755 --- a/cmake/tribits/devtools_install/install-git.py +++ b/cmake/tribits/devtools_install/install-git.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/devtools_install/install-mpich.py b/cmake/tribits/devtools_install/install-mpich.py index 529570f32c76..172f2383ff42 100755 --- a/cmake/tribits/devtools_install/install-mpich.py +++ b/cmake/tribits/devtools_install/install-mpich.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/devtools_install/install-openmpi.py b/cmake/tribits/devtools_install/install-openmpi.py index cac874f663dd..0d975be7fe76 100755 --- a/cmake/tribits/devtools_install/install-openmpi.py +++ b/cmake/tribits/devtools_install/install-openmpi.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/devtools_install/install_devtools.py b/cmake/tribits/devtools_install/install_devtools.py index a84e4f0aa862..0f308469b31f 100755 --- a/cmake/tribits/devtools_install/install_devtools.py +++ b/cmake/tribits/devtools_install/install_devtools.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst b/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst index 3ab4ce13f1b9..b8601d6e81ad 100644 --- a/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst +++ b/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst @@ -2230,6 +2230,21 @@ This will override the global behavior set by ````. +Setting or disabling Python +---------------------------- + +To set which Python interpreter is used, configure with:: + + -D Python3_EXECUTABLE= + +Otherwise, Python will be found automatically by default using +``find_python(Python3)`` internally (see `FindPython3.cmake`_). + +To disable the finding and usage of Python, configure with (empty):: + + -D Python3_EXECUTABLE= + + Outputting package dependency information ----------------------------------------- @@ -2952,7 +2967,7 @@ printed to cmake STDOUT. Show parent(s) commit info in the repo version output ----------------------------------------------------- +----------------------------------------------------- .. __SHOW_GIT_COMMIT_PARENTS: @@ -4490,4 +4505,7 @@ dashboard``. .. _xSDK Community Package Policies: https://doi.org/10.6084/m9.figshare.4495136 +.. _FindPython3.cmake: https://cmake.org/cmake/help/latest/module/FindPython3.html + + .. LocalWords: templated instantiation Makefiles CMake diff --git a/cmake/tribits/doc/build_ref/create-project-build-ref.py b/cmake/tribits/doc/build_ref/create-project-build-ref.py index ce0ee6a92800..acd76c59a9a1 100755 --- a/cmake/tribits/doc/build_ref/create-project-build-ref.py +++ b/cmake/tribits/doc/build_ref/create-project-build-ref.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 usageHelp = r"""create-project-build-ref.py [options] diff --git a/cmake/tribits/doc/guides/TribitsGuidesBody.rst b/cmake/tribits/doc/guides/TribitsGuidesBody.rst index c978a2d103ce..29a319fc664c 100644 --- a/cmake/tribits/doc/guides/TribitsGuidesBody.rst +++ b/cmake/tribits/doc/guides/TribitsGuidesBody.rst @@ -1107,7 +1107,7 @@ can be used in the logic in these files. Some of the variables that should already be defined (in addition to all of the basic user TriBITS cache variables set in ``tribits_define_global_options_and_define_extra_repos()``) include ``CMAKE_HOST_SYSTEM_NAME``, ``${PROJECT_NAME}_HOSTNAME``, and -``PYTHON_EXECUTABLE`` (see `Python Support`_). The types of commands and +``Python3_EXECUTABLE`` (see `Python Support`_). The types of commands and logic to put in this file include: * Setting additional user cache variable options that are used by multiple @@ -2228,7 +2228,7 @@ proceeds through the call to `tribits_project()`_. | 3) Set variables ``CMAKE_HOST_SYSTEM_NAME`` and ``${PROJECT_NAME}_HOSTNAME`` | (both of these can be overridden in the cache by the user) | 4) Find some optional command-line tools: -| a) Find Python (sets ``PYTHON_EXECUTABLE``, see `Python Support`_) +| a) Find Python (sets ``Python3_EXECUTABLE``, see `Python Support`_) | b) Find Git (sets ``GIT_EXECUTABLE`` and ``GIT_VERSION_STRING``) | 5) ``include(`` `/Version.cmake`_ ``)`` | 6) Define primary TriBITS options and read in the list of extra repositories @@ -2667,6 +2667,9 @@ satisfy the following requirements: * Test names must be prefixed with the package name ``_``. +* The package name ```` must be appended to the ``LABELS`` test + property list. + * Tests should only be added if the variable ``_ENABLE_TESTS`` is true. @@ -4230,7 +4233,8 @@ repositories if specified). There are several python tools under ``tribits/ci_support/`` that read in this file and use the created data-structure for various tasks. This file and these tools are used by `checkin-test.py`_ and `tribits_ctest_driver()`_. But these tools can also be -used to construct other workflows and tools. +used to construct other workflows and tools. These tools require a Python3 +installation and for the `python3` executable to be installed. .. _TribitsDumpDepsXmlScript.cmake: @@ -7000,17 +7004,16 @@ Python Support TriBITS Core does not require anything other than raw CMake. However, Python Utils, TriBITS CI Support, and other extended TriBITS components require -Python. These extra TriBITS tools only require Python 2.7+ (and 3.x). By -default, when a TriBITS project starts to configure using CMake, it will try -to find Python 2.7+ on the system (see `Full Processing of TriBITS Project -Files`_). If Python is found, it will set the global cache variable -``PYTHON_EXECUTABLE``. If it is not found, then it will print a warning and -``PYTHON_EXECUTABLE`` will be empty. With this default behavior, if Python is -found, then the TriBITS project can use it. Otherwise, it can do without it. +Python. These extra TriBITS tools only require Python 3.6+. By default, when +a TriBITS project starts to configure using CMake, it will try to find Python +3.6+ on the system (see `Full Processing of TriBITS Project Files`_). If +Python is found, it will set the global cache variable ``Python3_EXECUTABLE``. +If it is not found, then it will print a warning and ``Python3_EXECUTABLE`` +will be empty. With this default behavior, if Python is found, then the +TriBITS project can use it. Otherwise, it can do without it. While the default behavior for finding Python described above is useful for -many TriBITS project (such as Trilinos), some TriBITS projects need different -behavior such as: +many TriBITS projects, some TriBITS projects need different behavior such as: 1. The TriBITS project may not ever use Python so there is no need to look for it at all. In this case, the TriBITS project would set @@ -7020,11 +7023,12 @@ behavior such as: can't be found. In this case, the TriBITS project would set `${PROJECT_NAME}_REQUIRES_PYTHON`_ to ``TRUE``. -3. Some TriBITS projects may require a version of Python more recent than 2.7. - In this case, the TriBITS project would set `PythonInterp_FIND_VERSION`_ to - some value higher than ``2.7``. For example, may newer systems have only - Python 3.5.2 or higher versions installed by default and projects developed - on such a system typically requires this version or higher. +3. Some TriBITS projects may require a version of Python more recent than 3.6. + In this case, the TriBITS project would set + `${PROJECT_NAME}_Python3_FIND_VERSION`_ to some value higher than ``3.6``. + For example, may newer systems have higher versions of Python installed by + default, and projects developed on such a system typically require this + version or higher. Project-Specific Build Reference diff --git a/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst b/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst index 15e079ea7067..1546777bf499 100644 --- a/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst +++ b/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst @@ -31,6 +31,7 @@ @FUNCTION: tribits_find_most_recent_binary_file_timestamp() + @FUNCTION: tribits_find_most_recent_file_timestamp() + @FUNCTION: tribits_find_most_recent_source_file_timestamp() + +@FUNCTION: tribits_get_package_enable_status() + @FUNCTION: tribits_install_headers() + @MACRO: tribits_include_directories() + @MACRO: tribits_pkg_export_cache_var() + @@ -38,9 +39,11 @@ @MACRO: tribits_package_decl() + @MACRO: tribits_package_def() + @MACRO: tribits_package_define_dependencies() + +@MACRO: tribits_process_enabled_standard_tpl() + +@FUNCTION: tribits_package_is_enabled_or_unset() + +@FUNCTION: tribits_package_is_explicitly_disabled() + @MACRO: tribits_package_postprocess() + @MACRO: tribits_process_subpackages() + -@MACRO: tribits_process_enabled_standard_tpl() + @MACRO: tribits_project() + @MACRO: tribits_project_define_extra_repositories() + @MACRO: tribits_project_enable_all() + diff --git a/cmake/tribits/examples/MockTrilinos/Copyright.txt b/cmake/tribits/examples/MockTrilinos/Copyright.txt deleted file mode 100644 index 70962ece0e27..000000000000 --- a/cmake/tribits/examples/MockTrilinos/Copyright.txt +++ /dev/null @@ -1,38 +0,0 @@ -# @HEADER -# ************************************************************************ -# -# TriBITS: Tribal Build, Integrate, and Test System -# Copyright 2013 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# ************************************************************************ -# @HEADER diff --git a/cmake/tribits/examples/TribitsExampleProject/Copyright.txt b/cmake/tribits/examples/TribitsExampleProject/Copyright.txt index 70962ece0e27..0113c98fa77b 100644 --- a/cmake/tribits/examples/TribitsExampleProject/Copyright.txt +++ b/cmake/tribits/examples/TribitsExampleProject/Copyright.txt @@ -1,38 +1,8 @@ -# @HEADER -# ************************************************************************ -# -# TriBITS: Tribal Build, Integrate, and Test System -# Copyright 2013 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# ************************************************************************ -# @HEADER + TriBITS: Tribal Build, Integrate, and Test System + Copyright (c) 2013 NTESS + +Copyright 2013 National Technology & Engineering Solutions of Sandia, +LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the +U.S. Government retains certain rights in this software. + +Copyright the TriBITS contributors. diff --git a/cmake/tribits/examples/TribitsExampleProject/LICENSE b/cmake/tribits/examples/TribitsExampleProject/LICENSE index 8574da5f5a8d..266ee2add564 100644 --- a/cmake/tribits/examples/TribitsExampleProject/LICENSE +++ b/cmake/tribits/examples/TribitsExampleProject/LICENSE @@ -1,6 +1,31 @@ -TribitsExampleProject is part of the TriBITS system and is provided under a -very liberal 3-clause BSD-like license that is described in the file -~/Copyright.txt. All of the software under this directory is subject to the -conditions of this license by default unless otherwise noted in the individual -files or directories. In particular, there are no files that violate GPL or -any other licnese agreements that would limit distribution. +SPDX-License-Identifier: BSD-3-Clause + +Copyright (c) 2013 NTESS and the TriBITS contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + 3. Neither the name of the copyright holder nor the names of + its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/cmake/tribits/examples/TribitsExampleProject/cmake/CallbackSetupExtraOptions.cmake b/cmake/tribits/examples/TribitsExampleProject/cmake/CallbackSetupExtraOptions.cmake index 7a66eb1f9969..fd9d8f539c6f 100644 --- a/cmake/tribits/examples/TribitsExampleProject/cmake/CallbackSetupExtraOptions.cmake +++ b/cmake/tribits/examples/TribitsExampleProject/cmake/CallbackSetupExtraOptions.cmake @@ -12,11 +12,11 @@ macro(TRIBITS_REPOSITORY_SETUP_EXTRA_OPTIONS) set(${PROJECT_NAME}_ENABLE_WrapExternal OFF) endif() - if ("${PYTHON_EXECUTABLE}" STREQUAL "") + if ("${Python3_EXECUTABLE}" STREQUAL "") message( "\n***" "\n*** NOTE: Setting ${PROJECT_NAME}_ENABLE_WrapExternal=OFF" - " because PYTHON_EXECUTABLE=''!" + " because Python3_EXECUTABLE=''!" "\n***\n" ) set(${PROJECT_NAME}_ENABLE_WrapExternal OFF) diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt index a9f8b0a37331..bd0f4ef752ee 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt @@ -82,7 +82,7 @@ add_custom_command( OUTPUT ${EXTERNAL_FUNC_MAKEFILE} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${EXTERNAL_FUNC_SOURCE_DIR}/configure.py - COMMAND ${PYTHON_EXECUTABLE} ${EXTERNAL_FUNC_SOURCE_DIR}/configure.py + COMMAND ${Python3_EXECUTABLE} ${EXTERNAL_FUNC_SOURCE_DIR}/configure.py "--cxx=${CMAKE_CXX_COMPILER}" "--cxx-flags=${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${upperBuildType}}" "--ar=${CMAKE_AR}" diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/external_func/configure.py b/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/external_func/configure.py index 9da2e1347217..bdbba413ee82 100755 --- a/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/external_func/configure.py +++ b/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/external_func/configure.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import os diff --git a/cmake/tribits/python_utils/download-cmake.py b/cmake/tribits/python_utils/download-cmake.py index 97fa24d152d7..e2a2f045011f 100755 --- a/cmake/tribits/python_utils/download-cmake.py +++ b/cmake/tribits/python_utils/download-cmake.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/python_utils/extract_rst_cmake_doc.py b/cmake/tribits/python_utils/extract_rst_cmake_doc.py index 703896ce0f38..016757aae1c7 100755 --- a/cmake/tribits/python_utils/extract_rst_cmake_doc.py +++ b/cmake/tribits/python_utils/extract_rst_cmake_doc.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/python_utils/generate-docutils-output.py b/cmake/tribits/python_utils/generate-docutils-output.py index 27fc8aa77c9c..bb70709d7a62 100755 --- a/cmake/tribits/python_utils/generate-docutils-output.py +++ b/cmake/tribits/python_utils/generate-docutils-output.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 usageHelp = r"""generate-docutils-output.py --file-base= [options] diff --git a/cmake/tribits/python_utils/generic-looping-demon.py b/cmake/tribits/python_utils/generic-looping-demon.py index ab6cc52d4cd0..5494278e382f 100755 --- a/cmake/tribits/python_utils/generic-looping-demon.py +++ b/cmake/tribits/python_utils/generic-looping-demon.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/python_utils/gitdist.py b/cmake/tribits/python_utils/gitdist.py index 6800e2e20ca7..e10b6716fe28 100755 --- a/cmake/tribits/python_utils/gitdist.py +++ b/cmake/tribits/python_utils/gitdist.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # diff --git a/cmake/tribits/python_utils/lower_case_cmake.py b/cmake/tribits/python_utils/lower_case_cmake.py index ea769dbdb877..454cabdd83ad 100755 --- a/cmake/tribits/python_utils/lower_case_cmake.py +++ b/cmake/tribits/python_utils/lower_case_cmake.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys diff --git a/cmake/tribits/python_utils/mailmsg.py b/cmake/tribits/python_utils/mailmsg.py index 4c7017d698d6..220c39b4dd39 100755 --- a/cmake/tribits/python_utils/mailmsg.py +++ b/cmake/tribits/python_utils/mailmsg.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/python_utils/mockprogram.py b/cmake/tribits/python_utils/mockprogram.py index 7813c23a9223..05b898b226f5 100755 --- a/cmake/tribits/python_utils/mockprogram.py +++ b/cmake/tribits/python_utils/mockprogram.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** diff --git a/cmake/tribits/python_utils/snapshot-dir.py b/cmake/tribits/python_utils/snapshot-dir.py index 76436dca4753..e2cf687eaaac 100755 --- a/cmake/tribits/python_utils/snapshot-dir.py +++ b/cmake/tribits/python_utils/snapshot-dir.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # @HEADER # ***************************************************************************** # TriBITS: Tribal Build, Integrate, and Test System diff --git a/cmake/tribits/python_utils/tree.py b/cmake/tribits/python_utils/tree.py index 15047bf6f7a2..720ece0437b3 100755 --- a/cmake/tribits/python_utils/tree.py +++ b/cmake/tribits/python_utils/tree.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # tree.py # diff --git a/cmake/tribits/refactoring/string-replace.py b/cmake/tribits/refactoring/string-replace.py new file mode 100755 index 000000000000..bb6b33a34640 --- /dev/null +++ b/cmake/tribits/refactoring/string-replace.py @@ -0,0 +1,64 @@ +#!/bin/env python3 + +usageHelp = r""" + +Replace a given string with another string in a file (but only touch the file +if there were changes). + +""" + + +def getCmndLineOptions(): + from argparse import ArgumentParser, RawDescriptionHelpFormatter + + clp = ArgumentParser(description=usageHelp, + formatter_class=RawDescriptionHelpFormatter) + + clp.add_argument( + "-s", dest="stringToReplace", required=True, + help="String to repalce" ) + + clp.add_argument( + "-r", dest="replacementString", required=True, + help="Replacement string" ) + + clp.add_argument( + "-f", dest="inputFile", required=True, + help="Input file (and also output if -o not specified)" ) + + clp.add_argument( + "-o", dest="outputFile", default="", + help="Output file (optional)" ) + + options = clp.parse_args(sys.argv[1:]) + + if options.outputFile == "": + options.outputFile = options.inputFile + + return options + + +# +# Main() +# + +if __name__ == '__main__': + + import sys + + inOptions = getCmndLineOptions() + + with open(inOptions.inputFile, 'r') as file: + lines = file.readlines() + + fileWasChanged = False + newLines = [] + for line in lines: + newLine = line.replace(inOptions.stringToReplace, inOptions.replacementString) + if newLine != line: + fileWasChanged = True + newLines.append(newLine) + + if (fileWasChanged or inOptions.outputFile != inOptions.inputFile): + with open(inOptions.outputFile, 'w') as file: + file.writelines(newLines) diff --git a/cmake/tribits/refactoring/to-python3.sh b/cmake/tribits/refactoring/to-python3.sh new file mode 100755 index 000000000000..4c40c0d67643 --- /dev/null +++ b/cmake/tribits/refactoring/to-python3.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# +# Refactor a TriBITS project's CMake files for the change from +# find_package(PythonInterp) to find_package(Python3) (see CHANGELOG.md entry +# for 2024-10-08). +# +# Usage: +# +# to-python3.sh +# +# NOTES: +# * This is safe to run multiple times on the same set of files. +# * This is safe to run from the base project source tree. +# * This will exclude any files under '.git/' +# * This will exclude any files under 'tribits/' directories (so it will not mess up TriBITS) +# + +_SCRIPT_DIR=`echo $0 | sed "s/\(.*\)\/to-python3[.]sh/\1/g"` +baseDir=$1 +find ${baseDir} -type f \ + \( -name CMakeLists.txt -or -name "*.cmake" -or -name "*.cmake.in" -or -name "*.rst" \) \ + ! -wholename "*/.git/*" ! -wholename "*/tribits/*" \ + -exec $_SCRIPT_DIR/token-replace.py -t PYTHON_EXECUTABLE -r Python3_EXECUTABLE -f {} ';' diff --git a/cmake/tribits/refactoring/token-replace.py b/cmake/tribits/refactoring/token-replace.py new file mode 100755 index 000000000000..9c425a65ab52 --- /dev/null +++ b/cmake/tribits/refactoring/token-replace.py @@ -0,0 +1,77 @@ +#!/bin/env python3 + +usageHelp = r""" + +Replace a given token string with another string in a file (but only touch the +file if there were changes). + +This will only match complete tokens that match the regex: + + ([^A-Za-z0-9_])|^)Build System during the copy procedure. For example, the first line of each test script source file is now:

-#! ${PYTHON_EXECUTABLE}
+#! ${Python3_EXECUTABLE}
 

which means that the python executable that is recognized (and compiled against) by the CMake build system will also be the python diff --git a/packages/PyTrilinos/doc/DevelopersGuide/Testing.txt b/packages/PyTrilinos/doc/DevelopersGuide/Testing.txt index 089946e00b03..c98a32442662 100644 --- a/packages/PyTrilinos/doc/DevelopersGuide/Testing.txt +++ b/packages/PyTrilinos/doc/DevelopersGuide/Testing.txt @@ -44,7 +44,7 @@ reason for this is that CMake variable values can be substituted during the copy procedure. For example, the first line of each test script source file is now:: - #! ${PYTHON_EXECUTABLE} + #! ${Python3_EXECUTABLE} which means that the python executable that is recognized (and compiled against) by the CMake build system will also be the python diff --git a/packages/PyTrilinos/doc/Doxygen/CMakeLists.txt b/packages/PyTrilinos/doc/Doxygen/CMakeLists.txt index 37dc7c7e38e7..d46df421389d 100644 --- a/packages/PyTrilinos/doc/Doxygen/CMakeLists.txt +++ b/packages/PyTrilinos/doc/Doxygen/CMakeLists.txt @@ -63,7 +63,7 @@ FOREACH(Package ${PyTrilinos_PACKAGES}) ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_${Package} @ONLY ) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/docstrings.py + EXECUTE_PROCESS(COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/docstrings.py --doxygen=${DOXYGEN_EXECUTABLE} ${Package} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ERROR_VARIABLE Doxy_CONVERT_ERROR) diff --git a/packages/PyTrilinos/doc/Doxygen/docstrings.py.in b/packages/PyTrilinos/doc/Doxygen/docstrings.py.in index c0a537af9b29..ac59b6b38cd6 100755 --- a/packages/PyTrilinos/doc/Doxygen/docstrings.py.in +++ b/packages/PyTrilinos/doc/Doxygen/docstrings.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # System includes from __future__ import print_function diff --git a/packages/PyTrilinos/doc/Doxygen/doxy2swig.py.in b/packages/PyTrilinos/doc/Doxygen/doxy2swig.py.in index ba7088ecc27e..878bd9721ffc 100755 --- a/packages/PyTrilinos/doc/Doxygen/doxy2swig.py.in +++ b/packages/PyTrilinos/doc/Doxygen/doxy2swig.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} """ Doxygen XML to SWIG docstring converter. diff --git a/packages/PyTrilinos/doc/Doxygen/makedeps.py.in b/packages/PyTrilinos/doc/Doxygen/makedeps.py.in index e7c18c441311..3a94a5590bfc 100755 --- a/packages/PyTrilinos/doc/Doxygen/makedeps.py.in +++ b/packages/PyTrilinos/doc/Doxygen/makedeps.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} """ Create a Makefile dependency file that includes all of the names of the source diff --git a/packages/PyTrilinos/doc/UsersGuide/BuildingAndInstalling.txt b/packages/PyTrilinos/doc/UsersGuide/BuildingAndInstalling.txt index 99b5ec781a64..0392cd4df3b2 100644 --- a/packages/PyTrilinos/doc/UsersGuide/BuildingAndInstalling.txt +++ b/packages/PyTrilinos/doc/UsersGuide/BuildingAndInstalling.txt @@ -62,7 +62,7 @@ Python and SWIG You may specify the python interpreter (and thus the version of the Python/C API) with the ``cmake`` option:: - -D PYTHON_EXECUTABLE:FILEPATH=... + -D Python3_EXECUTABLE:FILEPATH=... If you do not specify this option, ``cmake`` actually looks for an executable named ``python2.7`` (and then ``python2.6``, etc., down to diff --git a/packages/PyTrilinos/doc/UsersGuide/UsersGuide.html b/packages/PyTrilinos/doc/UsersGuide/UsersGuide.html index 6a2425e34a7d..377b14dd0b58 100644 --- a/packages/PyTrilinos/doc/UsersGuide/UsersGuide.html +++ b/packages/PyTrilinos/doc/UsersGuide/UsersGuide.html @@ -427,7 +427,7 @@

Python and SWIG

You may specify the python interpreter (and thus the version of the Python/C API) with the cmake option:

--D PYTHON_EXECUTABLE:FILEPATH=...
+-D Python3_EXECUTABLE:FILEPATH=...
 

If you do not specify this option, cmake actually looks for an executable named python2.7 (and then python2.6, etc., down to diff --git a/packages/PyTrilinos/example/CMakeLists.txt b/packages/PyTrilinos/example/CMakeLists.txt index e0b9d4f89ed2..725334ed2869 100644 --- a/packages/PyTrilinos/example/CMakeLists.txt +++ b/packages/PyTrilinos/example/CMakeLists.txt @@ -47,7 +47,7 @@ ENABLE_TESTING() INCLUDE(PyTrilinosMakeTest) ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/testutil.py - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py ${CMAKE_CURRENT_SOURCE_DIR}/testutil.py.in ${CMAKE_CURRENT_BINARY_DIR}/testutil.py @@ -57,7 +57,7 @@ ADD_CUSTOM_TARGET(PyTrilinos_Example_testutil ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/testutil.py) ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gre__115.rua - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py ${CMAKE_CURRENT_SOURCE_DIR}/gre__115.mx ${CMAKE_CURRENT_BINARY_DIR}/gre__115.rua diff --git a/packages/PyTrilinos/example/exAmesos_Factory.py.in b/packages/PyTrilinos/example/exAmesos_Factory.py.in index 0e3d3481ea00..8b2279f78c26 100755 --- a/packages/PyTrilinos/example/exAmesos_Factory.py.in +++ b/packages/PyTrilinos/example/exAmesos_Factory.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exAmesos_Solvers.py.in b/packages/PyTrilinos/example/exAmesos_Solvers.py.in index c056d4341ebf..273200a054ff 100755 --- a/packages/PyTrilinos/example/exAmesos_Solvers.py.in +++ b/packages/PyTrilinos/example/exAmesos_Solvers.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exAnasazi_BlockDavidson.py.in b/packages/PyTrilinos/example/exAnasazi_BlockDavidson.py.in index 2de10323d03f..69a94881498f 100755 --- a/packages/PyTrilinos/example/exAnasazi_BlockDavidson.py.in +++ b/packages/PyTrilinos/example/exAnasazi_BlockDavidson.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exAztecOO.py.in b/packages/PyTrilinos/example/exAztecOO.py.in index 0c3f04afacc9..23d357963874 100755 --- a/packages/PyTrilinos/example/exAztecOO.py.in +++ b/packages/PyTrilinos/example/exAztecOO.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exAztecOO_BasicRowMatrix.py.in b/packages/PyTrilinos/example/exAztecOO_BasicRowMatrix.py.in index e52348c1a679..83a21b88c21d 100755 --- a/packages/PyTrilinos/example/exAztecOO_BasicRowMatrix.py.in +++ b/packages/PyTrilinos/example/exAztecOO_BasicRowMatrix.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exAztecOO_Operator.py.in b/packages/PyTrilinos/example/exAztecOO_Operator.py.in index 9ad6a7d25254..d1690befac1c 100755 --- a/packages/PyTrilinos/example/exAztecOO_Operator.py.in +++ b/packages/PyTrilinos/example/exAztecOO_Operator.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exAztecOO_RowMatrix.py.in b/packages/PyTrilinos/example/exAztecOO_RowMatrix.py.in index dcc4f8e83e39..f9a2e09b7f1e 100755 --- a/packages/PyTrilinos/example/exAztecOO_RowMatrix.py.in +++ b/packages/PyTrilinos/example/exAztecOO_RowMatrix.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exDomi_Simple.py.in b/packages/PyTrilinos/example/exDomi_Simple.py.in index 89b739d115a7..1bb1b0f340f2 100755 --- a/packages/PyTrilinos/example/exDomi_Simple.py.in +++ b/packages/PyTrilinos/example/exDomi_Simple.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetra.py.in b/packages/PyTrilinos/example/exEpetra.py.in index f27b511520bb..49fcb6c0bee7 100755 --- a/packages/PyTrilinos/example/exEpetra.py.in +++ b/packages/PyTrilinos/example/exEpetra.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetraExt_IO_HDF5.py.in b/packages/PyTrilinos/example/exEpetraExt_IO_HDF5.py.in index 3d90da47e640..d35f64db9cd6 100755 --- a/packages/PyTrilinos/example/exEpetraExt_IO_HDF5.py.in +++ b/packages/PyTrilinos/example/exEpetraExt_IO_HDF5.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetraExt_IO_MatrixMarket.py.in b/packages/PyTrilinos/example/exEpetraExt_IO_MatrixMarket.py.in index 83e1df3fc8b3..fecc442d3b97 100755 --- a/packages/PyTrilinos/example/exEpetraExt_IO_MatrixMarket.py.in +++ b/packages/PyTrilinos/example/exEpetraExt_IO_MatrixMarket.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetraExt_IO_XML.py.in b/packages/PyTrilinos/example/exEpetraExt_IO_XML.py.in index 4c338604eb51..b56c447cd88e 100755 --- a/packages/PyTrilinos/example/exEpetraExt_IO_XML.py.in +++ b/packages/PyTrilinos/example/exEpetraExt_IO_XML.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetraExt_MatrixMatrix.py.in b/packages/PyTrilinos/example/exEpetraExt_MatrixMatrix.py.in index 4205551be1e0..d4fd5be9a91f 100755 --- a/packages/PyTrilinos/example/exEpetraExt_MatrixMatrix.py.in +++ b/packages/PyTrilinos/example/exEpetraExt_MatrixMatrix.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetra_Comm.py.in b/packages/PyTrilinos/example/exEpetra_Comm.py.in index ec499a8c3522..4286f676cd99 100755 --- a/packages/PyTrilinos/example/exEpetra_Comm.py.in +++ b/packages/PyTrilinos/example/exEpetra_Comm.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetra_CrsMatrix_Easy.py.in b/packages/PyTrilinos/example/exEpetra_CrsMatrix_Easy.py.in index 6abadf1e4338..ec6d02a78e13 100755 --- a/packages/PyTrilinos/example/exEpetra_CrsMatrix_Easy.py.in +++ b/packages/PyTrilinos/example/exEpetra_CrsMatrix_Easy.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetra_CrsMatrix_Efficient.py.in b/packages/PyTrilinos/example/exEpetra_CrsMatrix_Efficient.py.in index bedee3eb2148..59feca1aab25 100755 --- a/packages/PyTrilinos/example/exEpetra_CrsMatrix_Efficient.py.in +++ b/packages/PyTrilinos/example/exEpetra_CrsMatrix_Efficient.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetra_DAP.py.in b/packages/PyTrilinos/example/exEpetra_DAP.py.in index d112a8f45a05..a3a3fd165c43 100755 --- a/packages/PyTrilinos/example/exEpetra_DAP.py.in +++ b/packages/PyTrilinos/example/exEpetra_DAP.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetra_FECrsMatrix_Easy.py.in b/packages/PyTrilinos/example/exEpetra_FECrsMatrix_Easy.py.in index 72b75666e425..9e0d4f064d35 100755 --- a/packages/PyTrilinos/example/exEpetra_FECrsMatrix_Easy.py.in +++ b/packages/PyTrilinos/example/exEpetra_FECrsMatrix_Easy.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exEpetra_ImportExport.py.in b/packages/PyTrilinos/example/exEpetra_ImportExport.py.in index 37b690100d76..3880f9377ccf 100755 --- a/packages/PyTrilinos/example/exEpetra_ImportExport.py.in +++ b/packages/PyTrilinos/example/exEpetra_ImportExport.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exGaleri.py.in b/packages/PyTrilinos/example/exGaleri.py.in index 4625ae8061eb..172437b804f9 100755 --- a/packages/PyTrilinos/example/exGaleri.py.in +++ b/packages/PyTrilinos/example/exGaleri.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exGaleri_ReadHB.py.in b/packages/PyTrilinos/example/exGaleri_ReadHB.py.in index d4d291c2a5db..ef3028537641 100755 --- a/packages/PyTrilinos/example/exGaleri_ReadHB.py.in +++ b/packages/PyTrilinos/example/exGaleri_ReadHB.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exIFPACK.py.in b/packages/PyTrilinos/example/exIFPACK.py.in index 85da04dfe92a..b8848fd4ca40 100755 --- a/packages/PyTrilinos/example/exIFPACK.py.in +++ b/packages/PyTrilinos/example/exIFPACK.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exIsorropia.py.in b/packages/PyTrilinos/example/exIsorropia.py.in index 846367e6b23f..911ef3c3b8b4 100755 --- a/packages/PyTrilinos/example/exIsorropia.py.in +++ b/packages/PyTrilinos/example/exIsorropia.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exKomplex_Simple.py.in b/packages/PyTrilinos/example/exKomplex_Simple.py.in index e3f4e98b36c0..1fc22a553020 100755 --- a/packages/PyTrilinos/example/exKomplex_Simple.py.in +++ b/packages/PyTrilinos/example/exKomplex_Simple.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exLOCA_Chan.py.in b/packages/PyTrilinos/example/exLOCA_Chan.py.in index 95a3efc5d4b3..a7e713957dd2 100755 --- a/packages/PyTrilinos/example/exLOCA_Chan.py.in +++ b/packages/PyTrilinos/example/exLOCA_Chan.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # ************************************************************************ diff --git a/packages/PyTrilinos/example/exLOCA_Chan_Jac.py.in b/packages/PyTrilinos/example/exLOCA_Chan_Jac.py.in index 874930734eb3..ac2b993e8044 100755 --- a/packages/PyTrilinos/example/exLOCA_Chan_Jac.py.in +++ b/packages/PyTrilinos/example/exLOCA_Chan_Jac.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # ************************************************************************ diff --git a/packages/PyTrilinos/example/exMLAPI.py.in b/packages/PyTrilinos/example/exMLAPI.py.in index 80710cee17f6..2143e440ac8b 100755 --- a/packages/PyTrilinos/example/exMLAPI.py.in +++ b/packages/PyTrilinos/example/exMLAPI.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exMLAPI_AztecOO.py.in b/packages/PyTrilinos/example/exMLAPI_AztecOO.py.in index ecee9419a9e9..a54438b4211a 100755 --- a/packages/PyTrilinos/example/exMLAPI_AztecOO.py.in +++ b/packages/PyTrilinos/example/exMLAPI_AztecOO.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exMLAPI_Iterate.py.in b/packages/PyTrilinos/example/exMLAPI_Iterate.py.in index 146efc841ba2..a2dd0c6d8658 100755 --- a/packages/PyTrilinos/example/exMLAPI_Iterate.py.in +++ b/packages/PyTrilinos/example/exMLAPI_Iterate.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exMLAPI_PyMatrix.py.in b/packages/PyTrilinos/example/exMLAPI_PyMatrix.py.in index 840f36179e63..c7762fe76f36 100755 --- a/packages/PyTrilinos/example/exMLAPI_PyMatrix.py.in +++ b/packages/PyTrilinos/example/exMLAPI_PyMatrix.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exMLAPI_Simple.py.in b/packages/PyTrilinos/example/exMLAPI_Simple.py.in index aaef201b7f27..004b6d09f62a 100755 --- a/packages/PyTrilinos/example/exMLAPI_Simple.py.in +++ b/packages/PyTrilinos/example/exMLAPI_Simple.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exMLAPI_Smoother.py.in b/packages/PyTrilinos/example/exMLAPI_Smoother.py.in index ef3c891d3bcc..49e96dbeeec4 100755 --- a/packages/PyTrilinos/example/exMLAPI_Smoother.py.in +++ b/packages/PyTrilinos/example/exMLAPI_Smoother.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exMPI_Init.py.in b/packages/PyTrilinos/example/exMPI_Init.py.in index 50734b6d7764..2de079f7340f 100755 --- a/packages/PyTrilinos/example/exMPI_Init.py.in +++ b/packages/PyTrilinos/example/exMPI_Init.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exNOXEpetraExt_2DSim.py.in b/packages/PyTrilinos/example/exNOXEpetraExt_2DSim.py.in index b138a090d67d..e4d7e73ea745 100755 --- a/packages/PyTrilinos/example/exNOXEpetraExt_2DSim.py.in +++ b/packages/PyTrilinos/example/exNOXEpetraExt_2DSim.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exNOX_1Dfdm.py.in b/packages/PyTrilinos/example/exNOX_1Dfdm.py.in index 44a3ff9563d1..aecd4893dff2 100755 --- a/packages/PyTrilinos/example/exNOX_1Dfdm.py.in +++ b/packages/PyTrilinos/example/exNOX_1Dfdm.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exNOX_2DSim.py.in b/packages/PyTrilinos/example/exNOX_2DSim.py.in index 4b79e9a051ba..c388b9e01dd3 100755 --- a/packages/PyTrilinos/example/exNOX_2DSim.py.in +++ b/packages/PyTrilinos/example/exNOX_2DSim.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exTeuchos.py.in b/packages/PyTrilinos/example/exTeuchos.py.in index 7a0075568952..2418b35dfc37 100755 --- a/packages/PyTrilinos/example/exTeuchos.py.in +++ b/packages/PyTrilinos/example/exTeuchos.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/exThyra.py.in b/packages/PyTrilinos/example/exThyra.py.in index 18614d00d130..f94e6bfaa203 100755 --- a/packages/PyTrilinos/example/exThyra.py.in +++ b/packages/PyTrilinos/example/exThyra.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/example/testutil.py.in b/packages/PyTrilinos/example/testutil.py.in index 57f7562811bb..0f115f102758 100644 --- a/packages/PyTrilinos/example/testutil.py.in +++ b/packages/PyTrilinos/example/testutil.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/CMakeLists.txt b/packages/PyTrilinos/src/CMakeLists.txt index 5e071091841f..5cdc5a45f6bd 100644 --- a/packages/PyTrilinos/src/CMakeLists.txt +++ b/packages/PyTrilinos/src/CMakeLists.txt @@ -262,7 +262,7 @@ SET_TARGET_PROPERTIES(pytrilinos # # Get the python version -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c +EXECUTE_PROCESS(COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.version[:3])" OUTPUT_VARIABLE PYTHON_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE @@ -323,7 +323,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${TEUCHOS_RCP_SCRIPT}.in ${CMAKE_CURRENT_BINARY_DIR}/${TEUCHOS_RCP_SCRIPT}) ADD_CUSTOM_COMMAND( OUTPUT "${TEUCHOS_RCP}" - COMMAND "${PYTHON_EXECUTABLE}" + COMMAND "${Python3_EXECUTABLE}" ARGS ${CMAKE_CURRENT_BINARY_DIR}/${TEUCHOS_RCP_SCRIPT} > ${CMAKE_CURRENT_BINARY_DIR}/${TEUCHOS_RCP} ) @@ -343,7 +343,7 @@ SET_TARGET_PROPERTIES(${TEUCHOS_RCP_TARGET} PROPERTIES LINK_FLAGS "${EXTRA_LINK_ARGS}" ) ADD_CUSTOM_COMMAND(TARGET ${TEUCHOS_RCP_TARGET} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/Teuchos/RCP.py', 'PyTrilinos/Teuchos/RCP.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/Teuchos/RCP.py', 'PyTrilinos/Teuchos/RCP.pyc')" COMMENT "Byte compiling Teuchos/RCP.py" VERBATIM) LIST(APPEND ADDITIONAL_CLEAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/${TEUCHOS_RCP}) @@ -399,7 +399,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) # causes other packages to "import Teuchos" properly. IF("${MODULE_OUTDIR}" MATCHES "PyTrilinos/Teuchos") ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/Teuchos/${MODULE_NAME}.py', 'PyTrilinos/Teuchos/${MODULE_NAME}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/Teuchos/${MODULE_NAME}.py', 'PyTrilinos/Teuchos/${MODULE_NAME}.pyc')" COMMENT "Byte compiling Teuchos/${MODULE_NAME}.py" VERBATIM) INSTALL(FILES @@ -414,7 +414,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) ELSEIF("${MODULE_OUTDIR}" MATCHES "PyTrilinos/NOX/Epetra") SET(TRILINOS_LIBS ${NOXEPETRA_LIBRARIES}) ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/NOX/Epetra/${MODULE_NAME}.py', 'PyTrilinos/NOX/Epetra/${MODULE_NAME}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/NOX/Epetra/${MODULE_NAME}.py', 'PyTrilinos/NOX/Epetra/${MODULE_NAME}.pyc')" COMMENT "Byte compiling NOX/Epetra/${MODULE_NAME}.py" VERBATIM) INSTALL(FILES @@ -430,7 +430,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) ELSEIF("${MODULE_OUTDIR}" MATCHES "PyTrilinos/NOX/PETSc") SET(TRILINOS_LIBS ${NOXPETSC_LIBRARIES}) ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/NOX/PETSc/${MODULE_NAME}.py', 'PyTrilinos/NOX/PETSc/${MODULE_NAME}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/NOX/PETSc/${MODULE_NAME}.py', 'PyTrilinos/NOX/PETSc/${MODULE_NAME}.pyc')" COMMENT "Byte compiling NOX/PETSc/${MODULE_NAME}.py" VERBATIM) INSTALL(FILES @@ -446,7 +446,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) ELSEIF("${MODULE_OUTDIR}" MATCHES "PyTrilinos/NOX") SET(TRILINOS_LIBS ${NOX_LIBRARIES}) ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/NOX/${MODULE_NAME}.py', 'PyTrilinos/NOX/${MODULE_NAME}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/NOX/${MODULE_NAME}.py', 'PyTrilinos/NOX/${MODULE_NAME}.pyc')" COMMENT "Byte compiling NOX/${MODULE_NAME}.py" VERBATIM) INSTALL(FILES @@ -462,7 +462,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) ELSEIF("${MODULE_OUTDIR}" MATCHES "PyTrilinos/LOCA/Hopf") SET(TRILINOS_LIBS ${LOCAEPETRA_LIBRARIES}) ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/LOCA/Hopf/${MODULE_NAME}.py', 'PyTrilinos/LOCA/Hopf/${MODULE_NAME}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/LOCA/Hopf/${MODULE_NAME}.py', 'PyTrilinos/LOCA/Hopf/${MODULE_NAME}.pyc')" COMMENT "Byte compiling LOCA/Hopf/${MODULE_NAME}.py" VERBATIM) INSTALL(FILES @@ -478,7 +478,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) ELSEIF("${MODULE_OUTDIR}" MATCHES "PyTrilinos/LOCA/Pitchfork") SET(TRILINOS_LIBS ${LOCAEPETRA_LIBRARIES}) ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/LOCA/Pitchfork/${MODULE_NAME}.py', 'PyTrilinos/LOCA/Pitchfork/${MODULE_NAME}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/LOCA/Pitchfork/${MODULE_NAME}.py', 'PyTrilinos/LOCA/Pitchfork/${MODULE_NAME}.pyc')" COMMENT "Byte compiling LOCA/Pitchfork/${MODULE_NAME}.py" VERBATIM) INSTALL(FILES @@ -494,7 +494,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) ELSEIF("${MODULE_OUTDIR}" MATCHES "PyTrilinos/LOCA/TurningPoint") SET(TRILINOS_LIBS ${LOCAEPETRA_LIBRARIES}) ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/LOCA/TurningPoint/${MODULE_NAME}.py', 'PyTrilinos/LOCA/TurningPoint/${MODULE_NAME}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/LOCA/TurningPoint/${MODULE_NAME}.py', 'PyTrilinos/LOCA/TurningPoint/${MODULE_NAME}.pyc')" COMMENT "Byte compiling LOCA/TurningPoint/${MODULE_NAME}.py" VERBATIM) INSTALL(FILES @@ -510,7 +510,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) ELSEIF("${MODULE_OUTDIR}" MATCHES "PyTrilinos/LOCA/Epetra") SET(TRILINOS_LIBS ${LOCAEPETRA_LIBRARIES}) ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/LOCA/Epetra/${MODULE_NAME}.py', 'PyTrilinos/LOCA/Epetra/${MODULE_NAME}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/LOCA/Epetra/${MODULE_NAME}.py', 'PyTrilinos/LOCA/Epetra/${MODULE_NAME}.pyc')" COMMENT "Byte compiling LOCA/Epetra/${MODULE_NAME}.py" VERBATIM) INSTALL(FILES @@ -526,7 +526,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) ELSEIF("${MODULE_OUTDIR}" MATCHES "PyTrilinos/LOCA") SET(TRILINOS_LIBS ${LOCA_LIBRARIES}) ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/LOCA/${MODULE_NAME}.py', 'PyTrilinos/LOCA/${MODULE_NAME}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/LOCA/${MODULE_NAME}.py', 'PyTrilinos/LOCA/${MODULE_NAME}.pyc')" COMMENT "Byte compiling LOCA/${MODULE_NAME}.py" VERBATIM) INSTALL(FILES @@ -542,7 +542,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) ELSEIF("${MODULE_OUTDIR}" MATCHES "PyTrilinos/Isorropia") SET(TRILINOS_LIBS ${ISORROPIA_LIBRARIES}) ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/Isorropia/${MODULE_NAME}.py', 'PyTrilinos/Isorropia/${MODULE_NAME}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/Isorropia/${MODULE_NAME}.py', 'PyTrilinos/Isorropia/${MODULE_NAME}.pyc')" COMMENT "Byte compiling Isorropia/${MODULE_NAME}.py" VERBATIM) INSTALL(FILES @@ -558,7 +558,7 @@ FOREACH(MODULE ${PyTrilinos_MODULES}) ELSE() SET(TRILINOS_LIBS ${${MODULE_UPPER}_LIBRARIES}) ADD_CUSTOM_COMMAND(TARGET ${PyTrilinos_TARGET_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/${MODULE}.py', 'PyTrilinos/${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('PyTrilinos/${MODULE}.py', 'PyTrilinos/${MODULE}.pyc')" COMMENT "Byte compiling ${MODULE}.py" VERBATIM) INSTALL(FILES diff --git a/packages/PyTrilinos/src/PyTrilinos/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/CMakeLists.txt index 3ca687f781f8..97fe157c0729 100644 --- a/packages/PyTrilinos/src/PyTrilinos/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/CMakeLists.txt @@ -71,7 +71,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling ${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/Isorropia/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/Isorropia/CMakeLists.txt index a06fb4c0b452..fcc954bb5e4a 100644 --- a/packages/PyTrilinos/src/PyTrilinos/Isorropia/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/Isorropia/CMakeLists.txt @@ -58,7 +58,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_Isorropia_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling Isorropia/${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/Isorropia/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/Isorropia/__init__.py.in index 56d8856619a2..45bec4cbc46f 100644 --- a/packages/PyTrilinos/src/PyTrilinos/Isorropia/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/Isorropia/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/PyTrilinos/LOCA/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/LOCA/CMakeLists.txt index 5d119713bb5a..f9d30e0bb252 100644 --- a/packages/PyTrilinos/src/PyTrilinos/LOCA/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/LOCA/CMakeLists.txt @@ -58,7 +58,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_LOCA_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling LOCA/${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/LOCA/Epetra/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/LOCA/Epetra/CMakeLists.txt index 221043450b01..c61356409bf4 100644 --- a/packages/PyTrilinos/src/PyTrilinos/LOCA/Epetra/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/LOCA/Epetra/CMakeLists.txt @@ -58,7 +58,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_LOCA_Epetra_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling LOCA/Epetra/${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/LOCA/Epetra/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/LOCA/Epetra/__init__.py.in index c87f4ec4e00b..23947fcef50b 100644 --- a/packages/PyTrilinos/src/PyTrilinos/LOCA/Epetra/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/LOCA/Epetra/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/PyTrilinos/LOCA/Hopf/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/LOCA/Hopf/CMakeLists.txt index 13d2e61841cc..ae379cf0475d 100644 --- a/packages/PyTrilinos/src/PyTrilinos/LOCA/Hopf/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/LOCA/Hopf/CMakeLists.txt @@ -58,7 +58,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_LOCA_Hopf_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling LOCA/Hopf/${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/LOCA/Hopf/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/LOCA/Hopf/__init__.py.in index c157a7d0476b..feebe7fa029b 100644 --- a/packages/PyTrilinos/src/PyTrilinos/LOCA/Hopf/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/LOCA/Hopf/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/PyTrilinos/LOCA/Pitchfork/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/LOCA/Pitchfork/CMakeLists.txt index ae010fc45c65..885deb0d8ffd 100644 --- a/packages/PyTrilinos/src/PyTrilinos/LOCA/Pitchfork/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/LOCA/Pitchfork/CMakeLists.txt @@ -58,7 +58,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_LOCA_Pitchfork_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling LOCA/Pitchfork/${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/LOCA/Pitchfork/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/LOCA/Pitchfork/__init__.py.in index fa29127825d3..1b274442514d 100644 --- a/packages/PyTrilinos/src/PyTrilinos/LOCA/Pitchfork/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/LOCA/Pitchfork/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/PyTrilinos/LOCA/TurningPoint/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/LOCA/TurningPoint/CMakeLists.txt index e2021357070e..324db7f7e37a 100644 --- a/packages/PyTrilinos/src/PyTrilinos/LOCA/TurningPoint/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/LOCA/TurningPoint/CMakeLists.txt @@ -58,7 +58,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_LOCA_TurningPoint_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling LOCA/TurningPoint/${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/LOCA/TurningPoint/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/LOCA/TurningPoint/__init__.py.in index 2e07b1b2c617..80dd1dbe1325 100644 --- a/packages/PyTrilinos/src/PyTrilinos/LOCA/TurningPoint/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/LOCA/TurningPoint/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/PyTrilinos/LOCA/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/LOCA/__init__.py.in index a1dd9d41fe66..1089800b759b 100644 --- a/packages/PyTrilinos/src/PyTrilinos/LOCA/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/LOCA/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/PyTrilinos/NOX/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/NOX/CMakeLists.txt index d7004ed6aea5..561235b3f775 100644 --- a/packages/PyTrilinos/src/PyTrilinos/NOX/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/NOX/CMakeLists.txt @@ -58,7 +58,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_NOX_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling NOX/${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/NOX/Epetra/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/NOX/Epetra/CMakeLists.txt index 93c5211c9178..78a05883d212 100644 --- a/packages/PyTrilinos/src/PyTrilinos/NOX/Epetra/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/NOX/Epetra/CMakeLists.txt @@ -58,7 +58,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_NOX_Epetra_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling NOX/Epetra/${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/NOX/Epetra/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/NOX/Epetra/__init__.py.in index 62fb83082991..c912295c13a0 100644 --- a/packages/PyTrilinos/src/PyTrilinos/NOX/Epetra/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/NOX/Epetra/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/PyTrilinos/NOX/PETSc/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/NOX/PETSc/CMakeLists.txt index f9632d20df48..1d33fd3cce93 100644 --- a/packages/PyTrilinos/src/PyTrilinos/NOX/PETSc/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/NOX/PETSc/CMakeLists.txt @@ -58,7 +58,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_NOX_PETSc_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling NOX/PETSc/${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/NOX/PETSc/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/NOX/PETSc/__init__.py.in index f254110ebea3..ff799ed50ab3 100644 --- a/packages/PyTrilinos/src/PyTrilinos/NOX/PETSc/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/NOX/PETSc/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/PyTrilinos/NOX/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/NOX/__init__.py.in index 0d477f1a5d20..c0fc512511d7 100644 --- a/packages/PyTrilinos/src/PyTrilinos/NOX/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/NOX/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/PyTrilinos/Teuchos/CMakeLists.txt b/packages/PyTrilinos/src/PyTrilinos/Teuchos/CMakeLists.txt index 05a0308af428..15e2a717d576 100644 --- a/packages/PyTrilinos/src/PyTrilinos/Teuchos/CMakeLists.txt +++ b/packages/PyTrilinos/src/PyTrilinos/Teuchos/CMakeLists.txt @@ -58,7 +58,7 @@ FOREACH(MODULE ${LOCAL_MODULES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.py) ADD_CUSTOM_COMMAND(TARGET PyTrilinos_Teuchos_Pure_Python_Modules - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" + COMMAND ${Python3_EXECUTABLE} -c "import py_compile; py_compile.compile('${MODULE}.py', '${MODULE}.pyc')" COMMENT "Byte compiling Teuchos/${MODULE}.py" BYPRODUCTS ${MODULE}.pyc VERBATIM) diff --git a/packages/PyTrilinos/src/PyTrilinos/Teuchos/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/Teuchos/__init__.py.in index 3cf921c10867..28c81e2b7712 100644 --- a/packages/PyTrilinos/src/PyTrilinos/Teuchos/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/Teuchos/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/PyTrilinos/__init__.py.in b/packages/PyTrilinos/src/PyTrilinos/__init__.py.in index 6c53789fd2c3..df2e9a056a91 100644 --- a/packages/PyTrilinos/src/PyTrilinos/__init__.py.in +++ b/packages/PyTrilinos/src/PyTrilinos/__init__.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/src/gen_teuchos_rcp.py.in b/packages/PyTrilinos/src/gen_teuchos_rcp.py.in index ac4ac19bc823..f56c3b12dfc3 100755 --- a/packages/PyTrilinos/src/gen_teuchos_rcp.py.in +++ b/packages/PyTrilinos/src/gen_teuchos_rcp.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- import glob diff --git a/packages/PyTrilinos/src/scripts/CMakeLists.txt b/packages/PyTrilinos/src/scripts/CMakeLists.txt index a30e4ff1a47b..4cbacec449a6 100644 --- a/packages/PyTrilinos/src/scripts/CMakeLists.txt +++ b/packages/PyTrilinos/src/scripts/CMakeLists.txt @@ -43,7 +43,7 @@ # @HEADER ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/testutil.py - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py ${CMAKE_CURRENT_SOURCE_DIR}/testutil.py.in ${CMAKE_CURRENT_BINARY_DIR}/testutil.py @@ -55,7 +55,7 @@ ADD_CUSTOM_TARGET(PyTrilinos_Scripts_testutil ALL MACRO(PyTrilinos_MAKE_SCRIPT SCRIPT_NAME) ADD_CUSTOM_COMMAND(OUTPUT ${SCRIPT_NAME}.py - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py ${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_NAME}.py.in ${CMAKE_CURRENT_BINARY_DIR}/${SCRIPT_NAME}.py diff --git a/packages/PyTrilinos/src/scripts/IsorropiaVisualizer.py.in b/packages/PyTrilinos/src/scripts/IsorropiaVisualizer.py.in index 1a319fe5c2d3..0c0d613bd5be 100755 --- a/packages/PyTrilinos/src/scripts/IsorropiaVisualizer.py.in +++ b/packages/PyTrilinos/src/scripts/IsorropiaVisualizer.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # TODO: diff --git a/packages/PyTrilinos/src/scripts/testutil.py.in b/packages/PyTrilinos/src/scripts/testutil.py.in index 846ba26319c6..ee32ee8257e4 100644 --- a/packages/PyTrilinos/src/scripts/testutil.py.in +++ b/packages/PyTrilinos/src/scripts/testutil.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testAmesos.py.in b/packages/PyTrilinos/test/testAmesos.py.in index 53837470a9b1..1378054c583a 100755 --- a/packages/PyTrilinos/test/testAmesos.py.in +++ b/packages/PyTrilinos/test/testAmesos.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testAnasazi.py.in b/packages/PyTrilinos/test/testAnasazi.py.in index 23023f3a861e..764c1c4fd17e 100755 --- a/packages/PyTrilinos/test/testAnasazi.py.in +++ b/packages/PyTrilinos/test/testAnasazi.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testAztecOO.py.in b/packages/PyTrilinos/test/testAztecOO.py.in index f991e98aa412..b807f561faf5 100755 --- a/packages/PyTrilinos/test/testAztecOO.py.in +++ b/packages/PyTrilinos/test/testAztecOO.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetraExt_Coloring.py.in b/packages/PyTrilinos/test/testEpetraExt_Coloring.py.in index 5322ddd55e09..47f910d8dcf1 100755 --- a/packages/PyTrilinos/test/testEpetraExt_Coloring.py.in +++ b/packages/PyTrilinos/test/testEpetraExt_Coloring.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetraExt_HDF5.py.in b/packages/PyTrilinos/test/testEpetraExt_HDF5.py.in index 8ea31e7fdb9c..051d9ee4c234 100755 --- a/packages/PyTrilinos/test/testEpetraExt_HDF5.py.in +++ b/packages/PyTrilinos/test/testEpetraExt_HDF5.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetraExt_Property.py.in b/packages/PyTrilinos/test/testEpetraExt_Property.py.in index 629f89bf3e5e..82ee253e1bb6 100755 --- a/packages/PyTrilinos/test/testEpetraExt_Property.py.in +++ b/packages/PyTrilinos/test/testEpetraExt_Property.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_BlockMap.py.in b/packages/PyTrilinos/test/testEpetra_BlockMap.py.in index d523e273cdd3..159fbae4b9db 100755 --- a/packages/PyTrilinos/test/testEpetra_BlockMap.py.in +++ b/packages/PyTrilinos/test/testEpetra_BlockMap.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_Comm.py.in b/packages/PyTrilinos/test/testEpetra_Comm.py.in index 81ebad421004..0dc7d6c2ddb3 100755 --- a/packages/PyTrilinos/test/testEpetra_Comm.py.in +++ b/packages/PyTrilinos/test/testEpetra_Comm.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_CompObject.py.in b/packages/PyTrilinos/test/testEpetra_CompObject.py.in index 408f30e27f48..e0d0bc923d11 100755 --- a/packages/PyTrilinos/test/testEpetra_CompObject.py.in +++ b/packages/PyTrilinos/test/testEpetra_CompObject.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_CrsGraph.py.in b/packages/PyTrilinos/test/testEpetra_CrsGraph.py.in index 877670766ffc..4147335f209f 100755 --- a/packages/PyTrilinos/test/testEpetra_CrsGraph.py.in +++ b/packages/PyTrilinos/test/testEpetra_CrsGraph.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_CrsMatrix.py.in b/packages/PyTrilinos/test/testEpetra_CrsMatrix.py.in index 223aa230986c..b1f8e68cd235 100755 --- a/packages/PyTrilinos/test/testEpetra_CrsMatrix.py.in +++ b/packages/PyTrilinos/test/testEpetra_CrsMatrix.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_FEVector.py.in b/packages/PyTrilinos/test/testEpetra_FEVector.py.in index 352c2bc4783a..7eaf90871602 100755 --- a/packages/PyTrilinos/test/testEpetra_FEVector.py.in +++ b/packages/PyTrilinos/test/testEpetra_FEVector.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_ImportExport.py.in b/packages/PyTrilinos/test/testEpetra_ImportExport.py.in index 3a578048c68a..08f25a5379eb 100755 --- a/packages/PyTrilinos/test/testEpetra_ImportExport.py.in +++ b/packages/PyTrilinos/test/testEpetra_ImportExport.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_IntSerialDense.py.in b/packages/PyTrilinos/test/testEpetra_IntSerialDense.py.in index 11acc1d7096d..ec2077db5daa 100755 --- a/packages/PyTrilinos/test/testEpetra_IntSerialDense.py.in +++ b/packages/PyTrilinos/test/testEpetra_IntSerialDense.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_IntVector.py.in b/packages/PyTrilinos/test/testEpetra_IntVector.py.in index fe2ece2400b9..b7aa34971ded 100755 --- a/packages/PyTrilinos/test/testEpetra_IntVector.py.in +++ b/packages/PyTrilinos/test/testEpetra_IntVector.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_LinearProblem.py.in b/packages/PyTrilinos/test/testEpetra_LinearProblem.py.in index a69775f8eda1..d704ed688394 100755 --- a/packages/PyTrilinos/test/testEpetra_LinearProblem.py.in +++ b/packages/PyTrilinos/test/testEpetra_LinearProblem.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_LocalMap.py.in b/packages/PyTrilinos/test/testEpetra_LocalMap.py.in index 3d7625604d8c..10c453103e59 100755 --- a/packages/PyTrilinos/test/testEpetra_LocalMap.py.in +++ b/packages/PyTrilinos/test/testEpetra_LocalMap.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_Map.py.in b/packages/PyTrilinos/test/testEpetra_Map.py.in index 639068f2490d..bd3900a1ec7a 100755 --- a/packages/PyTrilinos/test/testEpetra_Map.py.in +++ b/packages/PyTrilinos/test/testEpetra_Map.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_MapColoring.py.in b/packages/PyTrilinos/test/testEpetra_MapColoring.py.in index e7e960ed2dae..8dd64c962d9c 100755 --- a/packages/PyTrilinos/test/testEpetra_MapColoring.py.in +++ b/packages/PyTrilinos/test/testEpetra_MapColoring.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_MultiVector.py.in b/packages/PyTrilinos/test/testEpetra_MultiVector.py.in index ed41555a6fd0..b33b38a9d04f 100755 --- a/packages/PyTrilinos/test/testEpetra_MultiVector.py.in +++ b/packages/PyTrilinos/test/testEpetra_MultiVector.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_Object.py.in b/packages/PyTrilinos/test/testEpetra_Object.py.in index e3be8ccc18eb..b714ad57e0e0 100755 --- a/packages/PyTrilinos/test/testEpetra_Object.py.in +++ b/packages/PyTrilinos/test/testEpetra_Object.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_SerialDense.py.in b/packages/PyTrilinos/test/testEpetra_SerialDense.py.in index 51c4a6551a4f..2210b3907e40 100755 --- a/packages/PyTrilinos/test/testEpetra_SerialDense.py.in +++ b/packages/PyTrilinos/test/testEpetra_SerialDense.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_Time.py.in b/packages/PyTrilinos/test/testEpetra_Time.py.in index 7a33c8f6e15c..cc82a7a57103 100755 --- a/packages/PyTrilinos/test/testEpetra_Time.py.in +++ b/packages/PyTrilinos/test/testEpetra_Time.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_Util.py.in b/packages/PyTrilinos/test/testEpetra_Util.py.in index 33e66c4e40e2..278823382141 100755 --- a/packages/PyTrilinos/test/testEpetra_Util.py.in +++ b/packages/PyTrilinos/test/testEpetra_Util.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testEpetra_Vector.py.in b/packages/PyTrilinos/test/testEpetra_Vector.py.in index 0b40f57e575f..eaa5942d5db6 100755 --- a/packages/PyTrilinos/test/testEpetra_Vector.py.in +++ b/packages/PyTrilinos/test/testEpetra_Vector.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testGaleri_CrsMatrices.py.in b/packages/PyTrilinos/test/testGaleri_CrsMatrices.py.in index 66f1fbc7a23b..eba9f00c69a8 100755 --- a/packages/PyTrilinos/test/testGaleri_CrsMatrices.py.in +++ b/packages/PyTrilinos/test/testGaleri_CrsMatrices.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testGaleri_Maps.py.in b/packages/PyTrilinos/test/testGaleri_Maps.py.in index c9c3b0c4cbd2..0acd72c402fc 100755 --- a/packages/PyTrilinos/test/testGaleri_Maps.py.in +++ b/packages/PyTrilinos/test/testGaleri_Maps.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testIFPACK.py.in b/packages/PyTrilinos/test/testIFPACK.py.in index 05c1567ab06f..60613f3105f9 100755 --- a/packages/PyTrilinos/test/testIFPACK.py.in +++ b/packages/PyTrilinos/test/testIFPACK.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testIsorropia.py.in b/packages/PyTrilinos/test/testIsorropia.py.in index 87e5099bbcb9..ae8002c0cf92 100755 --- a/packages/PyTrilinos/test/testIsorropia.py.in +++ b/packages/PyTrilinos/test/testIsorropia.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testKomplex_LinearProblem.py.in b/packages/PyTrilinos/test/testKomplex_LinearProblem.py.in index 6d6f8b91fcb4..8489174dc236 100755 --- a/packages/PyTrilinos/test/testKomplex_LinearProblem.py.in +++ b/packages/PyTrilinos/test/testKomplex_LinearProblem.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testLOCA.py.in b/packages/PyTrilinos/test/testLOCA.py.in index f41db067693b..97f14791dd47 100755 --- a/packages/PyTrilinos/test/testLOCA.py.in +++ b/packages/PyTrilinos/test/testLOCA.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testML_CompObject.py.in b/packages/PyTrilinos/test/testML_CompObject.py.in index ede735a8651b..ae827a4dcb9c 100755 --- a/packages/PyTrilinos/test/testML_CompObject.py.in +++ b/packages/PyTrilinos/test/testML_CompObject.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testML_MultiVector.py.in b/packages/PyTrilinos/test/testML_MultiVector.py.in index aea1919eb942..267026731d99 100755 --- a/packages/PyTrilinos/test/testML_MultiVector.py.in +++ b/packages/PyTrilinos/test/testML_MultiVector.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testML_Preconditioner.py.in b/packages/PyTrilinos/test/testML_Preconditioner.py.in index 2a5ddc99b507..04a6c87779a5 100755 --- a/packages/PyTrilinos/test/testML_Preconditioner.py.in +++ b/packages/PyTrilinos/test/testML_Preconditioner.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testML_PyMatrix.py.in b/packages/PyTrilinos/test/testML_PyMatrix.py.in index ef0344371636..5e0aab4c3e73 100755 --- a/packages/PyTrilinos/test/testML_PyMatrix.py.in +++ b/packages/PyTrilinos/test/testML_PyMatrix.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testML_Space.py.in b/packages/PyTrilinos/test/testML_Space.py.in index c332d1e4ec00..4ce1c5b4d0c4 100755 --- a/packages/PyTrilinos/test/testML_Space.py.in +++ b/packages/PyTrilinos/test/testML_Space.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testML_TimeObject.py.in b/packages/PyTrilinos/test/testML_TimeObject.py.in index 4f10253e62ca..9a580277632e 100755 --- a/packages/PyTrilinos/test/testML_TimeObject.py.in +++ b/packages/PyTrilinos/test/testML_TimeObject.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testNOX_StatusTest.py.in b/packages/PyTrilinos/test/testNOX_StatusTest.py.in index ce15bc66e34d..8e0e411fee5f 100755 --- a/packages/PyTrilinos/test/testNOX_StatusTest.py.in +++ b/packages/PyTrilinos/test/testNOX_StatusTest.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testPliris.py.in b/packages/PyTrilinos/test/testPliris.py.in index 97fb331587eb..1d7fb0008904 100755 --- a/packages/PyTrilinos/test/testPliris.py.in +++ b/packages/PyTrilinos/test/testPliris.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testTeuchos.py.in b/packages/PyTrilinos/test/testTeuchos.py.in index b24701d107d1..cdb50cd14065 100755 --- a/packages/PyTrilinos/test/testTeuchos.py.in +++ b/packages/PyTrilinos/test/testTeuchos.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testTeuchos_Comm.py.in b/packages/PyTrilinos/test/testTeuchos_Comm.py.in index bee34ae07e7b..2d61efe2f356 100755 --- a/packages/PyTrilinos/test/testTeuchos_Comm.py.in +++ b/packages/PyTrilinos/test/testTeuchos_Comm.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testTeuchos_ParameterList.py.in b/packages/PyTrilinos/test/testTeuchos_ParameterList.py.in index cd4004361e3c..ce00e6cfbddd 100755 --- a/packages/PyTrilinos/test/testTeuchos_ParameterList.py.in +++ b/packages/PyTrilinos/test/testTeuchos_ParameterList.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testTeuchos_RCP.py.in b/packages/PyTrilinos/test/testTeuchos_RCP.py.in index c36340441955..1260c3338f45 100755 --- a/packages/PyTrilinos/test/testTeuchos_RCP.py.in +++ b/packages/PyTrilinos/test/testTeuchos_RCP.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testTeuchos_ScalarTraits.py.in b/packages/PyTrilinos/test/testTeuchos_ScalarTraits.py.in index 2386d947fa23..1f454b028ece 100755 --- a/packages/PyTrilinos/test/testTeuchos_ScalarTraits.py.in +++ b/packages/PyTrilinos/test/testTeuchos_ScalarTraits.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testThyra.py.in b/packages/PyTrilinos/test/testThyra.py.in index 59d25b36de1d..2c30b5cb0022 100755 --- a/packages/PyTrilinos/test/testThyra.py.in +++ b/packages/PyTrilinos/test/testThyra.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testTpetra_Map.py.in b/packages/PyTrilinos/test/testTpetra_Map.py.in index 6819b4d6c177..2655f44d3ec5 100755 --- a/packages/PyTrilinos/test/testTpetra_Map.py.in +++ b/packages/PyTrilinos/test/testTpetra_Map.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testTpetra_MultiVector.py.in b/packages/PyTrilinos/test/testTpetra_MultiVector.py.in index 4c30729b6c9a..2f709404533e 100755 --- a/packages/PyTrilinos/test/testTpetra_MultiVector.py.in +++ b/packages/PyTrilinos/test/testTpetra_MultiVector.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testTpetra_Vector.py.in b/packages/PyTrilinos/test/testTpetra_Vector.py.in index 34ab9d87e08a..e9e228089507 100755 --- a/packages/PyTrilinos/test/testTpetra_Vector.py.in +++ b/packages/PyTrilinos/test/testTpetra_Vector.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testTriUtils.py.in b/packages/PyTrilinos/test/testTriUtils.py.in index c9bdb16ae584..46e10421c8c4 100755 --- a/packages/PyTrilinos/test/testTriUtils.py.in +++ b/packages/PyTrilinos/test/testTriUtils.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/test/testutil.py.in b/packages/PyTrilinos/test/testutil.py.in index 86efd2f5e412..498a4ad18cbb 100644 --- a/packages/PyTrilinos/test/testutil.py.in +++ b/packages/PyTrilinos/test/testutil.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # -*- python -*- # @HEADER diff --git a/packages/PyTrilinos/util/CMakeCacheVariables.py.in b/packages/PyTrilinos/util/CMakeCacheVariables.py.in index 9b22d3ec29bd..738bce362240 100755 --- a/packages/PyTrilinos/util/CMakeCacheVariables.py.in +++ b/packages/PyTrilinos/util/CMakeCacheVariables.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # @HEADER # *********************************************************************** diff --git a/packages/PyTrilinos/util/MakefileVariables.py.in b/packages/PyTrilinos/util/MakefileVariables.py.in index 5df302598180..688379d7acd5 100755 --- a/packages/PyTrilinos/util/MakefileVariables.py.in +++ b/packages/PyTrilinos/util/MakefileVariables.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # @HEADER # *********************************************************************** diff --git a/packages/PyTrilinos/util/configFix.py.in b/packages/PyTrilinos/util/configFix.py.in index e9b476ffca33..6783ab3cc357 100755 --- a/packages/PyTrilinos/util/configFix.py.in +++ b/packages/PyTrilinos/util/configFix.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # @HEADER # *********************************************************************** diff --git a/packages/PyTrilinos/util/copyWithCMakeSubstitutions.py.in b/packages/PyTrilinos/util/copyWithCMakeSubstitutions.py.in index ee76cca284d8..6e7950e61515 100755 --- a/packages/PyTrilinos/util/copyWithCMakeSubstitutions.py.in +++ b/packages/PyTrilinos/util/copyWithCMakeSubstitutions.py.in @@ -1,4 +1,4 @@ -#! ${PYTHON_EXECUTABLE} +#! ${Python3_EXECUTABLE} # @HEADER # *********************************************************************** diff --git a/packages/PyTrilinos2/CMakeLists.txt b/packages/PyTrilinos2/CMakeLists.txt index 8f22df527dda..d912b7efe078 100644 --- a/packages/PyTrilinos2/CMakeLists.txt +++ b/packages/PyTrilinos2/CMakeLists.txt @@ -33,14 +33,14 @@ TRIBITS_ADD_OPTION_AND_DEFINE(PyTrilinos2_BINDER_VERBOSE SET(PyTrilinos2_BINDER_NUM_FILES "100" CACHE STRING "Maxinum number of generated files by binder.") -MESSAGE("-- PYTHON_EXECUTABLE:") -IF(NOT DEFINED ${PYTHON_EXECUTABLE}) - find_program(PYTHON_EXECUTABLE +MESSAGE("-- Python3_EXECUTABLE:") +IF(NOT DEFINED ${Python3_EXECUTABLE}) + find_program(Python3_EXECUTABLE NAMES python3 python ) - MESSAGE(" -- CMake has set: PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}") + MESSAGE(" -- CMake has set: Python3_EXECUTABLE = ${Python3_EXECUTABLE}") ELSE() - MESSAGE(" -- User has set: PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}") + MESSAGE(" -- User has set: Python3_EXECUTABLE = ${Python3_EXECUTABLE}") ENDIF() function(get_all_include_dirs LIBRARY_NAME all_include_dirs all_visited_libs) @@ -196,7 +196,7 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/PyTrilinos2_Tpetra_ETI.hpp ${CMAKE_CURRENT_BINARY_DIR}/python/getTpetraTypeName.py - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/gather_ETI.py ${CMAKE_CURRENT_BINARY_DIR} ${all_ETI_files_list} ${all_ETI_classes_list} "src/PyTrilinos2_Tpetra_ETI.hpp" + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/gather_ETI.py ${CMAKE_CURRENT_BINARY_DIR} ${all_ETI_files_list} ${all_ETI_classes_list} "src/PyTrilinos2_Tpetra_ETI.hpp" DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include_tmp ) add_custom_target(generate_ETI_name DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/src/PyTrilinos2_Tpetra_ETI.hpp ${CMAKE_CURRENT_BINARY_DIR}/include_tmp) @@ -206,7 +206,7 @@ list (APPEND PyTrilinos2PyFiles ${PyTrilinos2PyFiles2}) add_custom_command( OUTPUT ${binder_include_name} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/gather_includes.py ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${all_header_with_dir_list} ${all_header_without_dir_list} ${binder_include_name} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/gather_includes.py ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${all_header_with_dir_list} ${all_header_without_dir_list} ${binder_include_name} DEPENDS generate_ETI_name ${CMAKE_CURRENT_BINARY_DIR}/include_tmp ) add_custom_target(generate_include_name DEPENDS ${binder_include_name}) @@ -272,12 +272,12 @@ SET(PyTrilinos2_INSTALL_PREFIX ${PyTrilinos2_DEFAULT_INSTALL_PREFIX} CACHE PATH "The path prefix for where PyTrilinos2 will be installed, e.g. /usr/local") # Get the python version -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c +EXECUTE_PROCESS(COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.version_info.major)" OUTPUT_VARIABLE PYTHON_MAJOR_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c +EXECUTE_PROCESS(COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.version_info.minor)" OUTPUT_VARIABLE PYTHON_MINOR_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE @@ -300,7 +300,7 @@ INSTALL(FILES # Find the pybind11 CMake module EXECUTE_PROCESS(COMMAND - ${PYTHON_EXECUTABLE} -c "import pybind11; print(pybind11.get_cmake_dir())" + ${Python3_EXECUTABLE} -c "import pybind11; print(pybind11.get_cmake_dir())" OUTPUT_VARIABLE pybind11_DIR ERROR_VARIABLE pybind11_CMAKE_ERROR OUTPUT_STRIP_TRAILING_WHITESPACE @@ -310,7 +310,7 @@ MESSAGE(STATUS "pybind11 CMake path: ${pybind11_DIR}") find_package(pybind11 REQUIRED) EXECUTE_PROCESS(COMMAND - ${PYTHON_EXECUTABLE} -c "import mpi4py; print(mpi4py.get_include())" + ${Python3_EXECUTABLE} -c "import mpi4py; print(mpi4py.get_include())" OUTPUT_VARIABLE Mpi4Py_INCLUDE_DIR ERROR_VARIABLE Mpi4Py_INCLUDE_ERROR OUTPUT_STRIP_TRAILING_WHITESPACE @@ -323,7 +323,7 @@ ELSE() ENDIF() EXECUTE_PROCESS(COMMAND - ${PYTHON_EXECUTABLE} -c "import mpi4py; print(mpi4py.get_config()['mpicxx'])" + ${Python3_EXECUTABLE} -c "import mpi4py; print(mpi4py.get_config()['mpicxx'])" OUTPUT_VARIABLE Mpi4Py_MPICXX OUTPUT_STRIP_TRAILING_WHITESPACE ) diff --git a/packages/PyTrilinos2/README.md b/packages/PyTrilinos2/README.md index d5221b26e29b..f777f230041b 100644 --- a/packages/PyTrilinos2/README.md +++ b/packages/PyTrilinos2/README.md @@ -48,7 +48,7 @@ cmake -S ../llvm/llvm -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;clang-tools ``` -D Trilinos_ENABLE_PyTrilinos2:BOOL=ON \ --D PYTHON_EXECUTABLE=... \ +-D Python3_EXECUTABLE=... \ -D PyTrilinos2_ENABLE_TESTS=ON \ -D PyTrilinos2_BINDER_EXECUTABLE=... \ -D PyTrilinos2_BINDER_GCC_TOOLCHAIN=...\ diff --git a/packages/PyTrilinos2/cmake/PyTrilinos2MakeTest.cmake b/packages/PyTrilinos2/cmake/PyTrilinos2MakeTest.cmake index 4950a10a246e..52691290a084 100644 --- a/packages/PyTrilinos2/cmake/PyTrilinos2MakeTest.cmake +++ b/packages/PyTrilinos2/cmake/PyTrilinos2MakeTest.cmake @@ -4,7 +4,7 @@ MACRO(PyTrilinos2_MAKE_MPI_TEST TEST_NAME) FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) TRIBITS_ADD_TEST( - ${PYTHON_EXECUTABLE} + ${Python3_EXECUTABLE} NOEXEPREFIX NOEXESUFFIX NAME ${TEST_NAME} diff --git a/packages/compadre/examples/CMakeLists.tribits.cmake b/packages/compadre/examples/CMakeLists.tribits.cmake index 523f31cae25d..3542e6a08425 100644 --- a/packages/compadre/examples/CMakeLists.tribits.cmake +++ b/packages/compadre/examples/CMakeLists.tribits.cmake @@ -518,7 +518,7 @@ if (NOT(Compadre_DEBUG OR Compadre_EXTREME_DEBUG)) # This test is too slow in DEBUG (3x longer than all other tests # combined) - if (PYTHON_EXECUTABLE) + if (Python3_EXECUTABLE) # Python driven test of a C++ executable (Python changes command line # arguments given to executable) configure_file( @@ -529,7 +529,7 @@ if (NOT(Compadre_DEBUG OR Compadre_EXTREME_DEBUG)) set(testName GMLS_Manifold_Multiple_Evaluation_Sites) TRIBITS_ADD_ADVANCED_TEST( ${testName} - TEST_0 CMND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_BINARY_DIR}/GMLS_Manifold_Multiple_Evaluation_Sites.py --porder=3 --grids=3 --in-trilinos=True + TEST_0 CMND ${Python3_EXECUTABLE} ARGS ${CMAKE_CURRENT_BINARY_DIR}/GMLS_Manifold_Multiple_Evaluation_Sites.py --porder=3 --grids=3 --in-trilinos=True PASS_REGULAR_EXPRESSION "Passed." COMM mpi serial ADDED_TEST_NAME_OUT ${testName}_CREATED @@ -546,7 +546,7 @@ if (NOT(Compadre_DEBUG OR Compadre_EXTREME_DEBUG)) $ ) endif() # test created - endif() # PYTHON_EXECUTABLE + endif() # Python3_EXECUTABLE # Divergence-free basis test for GMLS on non-manifold # Note: QR is needed to be used here due to the null space introduced @@ -634,7 +634,7 @@ if (NOT(Compadre_DEBUG OR Compadre_EXTREME_DEBUG)) #endif() # test created endif() # not debug -if (PYTHON_EXECUTABLE) +if (Python3_EXECUTABLE) # Python driven test of a C++ executable (Python changes command line # arguments given to executable) - calling QR solver configure_file( @@ -645,7 +645,7 @@ if (PYTHON_EXECUTABLE) set(testName GMLS_Manifold_Refinement_Study_QR) TRIBITS_ADD_ADVANCED_TEST( ${testName} - TEST_0 CMND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_BINARY_DIR}/GMLS_Manifold.py --porder=3 --grids=4 --solver-type=QR --in-trilinos=True + TEST_0 CMND ${Python3_EXECUTABLE} ARGS ${CMAKE_CURRENT_BINARY_DIR}/GMLS_Manifold.py --porder=3 --grids=4 --solver-type=QR --in-trilinos=True PASS_REGULAR_EXPRESSION "Passed." COMM mpi serial ADDED_TEST_NAME_OUT ${testName}_CREATED @@ -668,7 +668,7 @@ if (PYTHON_EXECUTABLE) set(testName GMLS_Manifold_Refinement_Study_LU) TRIBITS_ADD_ADVANCED_TEST( ${testName} - TEST_0 CMND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_BINARY_DIR}/GMLS_Manifold.py --porder=3 --grids=4 --solver-type=LU --in-trilinos=True + TEST_0 CMND ${Python3_EXECUTABLE} ARGS ${CMAKE_CURRENT_BINARY_DIR}/GMLS_Manifold.py --porder=3 --grids=4 --solver-type=LU --in-trilinos=True PASS_REGULAR_EXPRESSION "Passed." COMM mpi serial ADDED_TEST_NAME_OUT ${testName}_CREATED @@ -698,7 +698,7 @@ if (PYTHON_EXECUTABLE) set(testName GMLS_Staggered_Manifold_Refinement_Study) TRIBITS_ADD_ADVANCED_TEST( ${testName} - TEST_0 CMND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_BINARY_DIR}/GMLS_Staggered_Manifold.py --porder=3 --grids=4 --in-trilinos=True + TEST_0 CMND ${Python3_EXECUTABLE} ARGS ${CMAKE_CURRENT_BINARY_DIR}/GMLS_Staggered_Manifold.py --porder=3 --grids=4 --in-trilinos=True PASS_REGULAR_EXPRESSION "Passed." COMM mpi serial ADDED_TEST_NAME_OUT ${testName}_CREATED @@ -715,7 +715,7 @@ if (PYTHON_EXECUTABLE) $ ) endif() # test created -endif() # PYTHON_EXECUTABLE +endif() # Python3_EXECUTABLE # Utility test - Filter By ID set(testName Test_Utilities) diff --git a/packages/epetraext/cmake/FindPythonInclude.cmake b/packages/epetraext/cmake/FindPythonInclude.cmake index ba795196cf76..8634919cae73 100644 --- a/packages/epetraext/cmake/FindPythonInclude.cmake +++ b/packages/epetraext/cmake/FindPythonInclude.cmake @@ -1,16 +1,16 @@ # - Find the python include path # This module determines where the python include file Python.h is, -# based on the current value of PYTHON_EXECUTABLE. This code sets the +# based on the current value of Python3_EXECUTABLE. This code sets the # following variable: # # PYTHON_INCLUDE_PATH = path to where Python.h is found # -IF(PYTHON_EXECUTABLE) +IF(Python3_EXECUTABLE) # Obtain the candidate path for python include EXECUTE_PROCESS(COMMAND - ${PYTHON_EXECUTABLE} -c + ${Python3_EXECUTABLE} -c "import sys; print(sys.prefix + '/include/python' + sys.version[:3])" OUTPUT_VARIABLE CANDIDATE OUTPUT_STRIP_TRAILING_WHITESPACE @@ -24,13 +24,13 @@ IF(PYTHON_EXECUTABLE) ENDIF(EXISTS "${CANDIDATE}") # Obtain the candidate path for python library EXECUTE_PROCESS(COMMAND - ${PYTHON_EXECUTABLE} -c + ${Python3_EXECUTABLE} -c "import sys; print('python' + sys.version[:3])" OUTPUT_VARIABLE PYVERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) EXECUTE_PROCESS(COMMAND - ${PYTHON_EXECUTABLE} -c + ${Python3_EXECUTABLE} -c "import sys; print(sys.prefix + '/lib/python' + sys.version[:3] + '/config')" OUTPUT_VARIABLE CANDIDATE OUTPUT_STRIP_TRAILING_WHITESPACE @@ -46,7 +46,7 @@ IF(PYTHON_EXECUTABLE) ENDIF(EXISTS ${LIB_CANDIDATE}) ENDFOREACH(SUFFIX) ENDIF(EXISTS "${CANDIDATE}") -ENDIF(PYTHON_EXECUTABLE) +ENDIF(Python3_EXECUTABLE) # Set any python variables that did not get set by the above logic IF(PYTHON_INCLUDE_FOUND AND PYTHON_LIB_FOUND) diff --git a/packages/ifpack/src/CMakeLists.txt b/packages/ifpack/src/CMakeLists.txt index 0d0f320f675b..b5d2da5d1347 100644 --- a/packages/ifpack/src/CMakeLists.txt +++ b/packages/ifpack/src/CMakeLists.txt @@ -16,9 +16,9 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) # Parse the Hypre headers IF (${PACKAGE_NAME}_ENABLE_HYPRE) - IF (PYTHON_EXECUTABLE) + IF (Python3_EXECUTABLE) EXECUTE_PROCESS( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../utils/parseHypre.py ${HYPRE_INCLUDE_DIRS} Ifpack_HypreParameterMap.h + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../utils/parseHypre.py ${HYPRE_INCLUDE_DIRS} Ifpack_HypreParameterMap.h WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" RESULT_VARIABLE RETURN_VALUE OUTPUT_STRIP_TRAILING_WHITESPACE diff --git a/packages/ifpack2/src/CMakeLists.txt b/packages/ifpack2/src/CMakeLists.txt index 283a027ca150..ef185ddce833 100644 --- a/packages/ifpack2/src/CMakeLists.txt +++ b/packages/ifpack2/src/CMakeLists.txt @@ -2,9 +2,9 @@ INCLUDE(TrilinosCreateClientTemplateHeaders) # Parse the Hypre headers IF (${PACKAGE_NAME}_ENABLE_HYPRE) - IF (PYTHON_EXECUTABLE) + IF (Python3_EXECUTABLE) EXECUTE_PROCESS( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../utils/parseHypre.py ${HYPRE_INCLUDE_DIRS} Ifpack2_HypreParameterMap.hpp + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../utils/parseHypre.py ${HYPRE_INCLUDE_DIRS} Ifpack2_HypreParameterMap.hpp WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" RESULT_VARIABLE RETURN_VALUE OUTPUT_STRIP_TRAILING_WHITESPACE diff --git a/packages/ml/test/ValidateParams/CMakeLists.txt b/packages/ml/test/ValidateParams/CMakeLists.txt index 41a2529966d4..2f451907e4b2 100644 --- a/packages/ml/test/ValidateParams/CMakeLists.txt +++ b/packages/ml/test/ValidateParams/CMakeLists.txt @@ -9,15 +9,15 @@ IF(ML_ENABLE_AztecOO AND ML_ENABLE_Amesos) COMM serial mpi ) - ASSERT_DEFINED(PYTHONINTERP_FOUND) - IF (PYTHONINTERP_FOUND) + ASSERT_DEFINED(Python3_EXECUTABLE) + IF (Python3_EXECUTABLE) TRIBITS_ADD_ADVANCED_TEST( ValidateParameters_compareTestOutput COMM serial mpi OVERALL_NUM_MPI_PROCS 1 # Should be 1,4,9 TEST_0 EXEC ml_Validate ARGS input1.xml OUTPUT_FILE ValidateParameters_compareTestOutput.out - TEST_1 CMND ${PYTHON_EXECUTABLE} + TEST_1 CMND ${Python3_EXECUTABLE} ARGS ${PROJECT_SOURCE_DIR}/commonTools/test/utilities/compareTestOutput evaluateCriteria baseline1.txt ValidateParameters_compareTestOutput.out PASS_REGULAR_EXPRESSION "Test passed." diff --git a/packages/muelu/research/regionMG/test/structured/CMakeLists.txt b/packages/muelu/research/regionMG/test/structured/CMakeLists.txt index 2c898f97272a..ca74dd9845a4 100644 --- a/packages/muelu/research/regionMG/test/structured/CMakeLists.txt +++ b/packages/muelu/research/regionMG/test/structured/CMakeLists.txt @@ -287,7 +287,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos2) ARGS --linAlgebra=Tpetra --xml=structured_1dof.xml --matrixType=Star2D --nx=10 --ny=10 --smootherIts=2 --convergence-log=Star2D_GS_4.log --smootherType=Gauss NUM_MPI_PROCS 4 TEST_1 - CMND ${PYTHON_EXECUTABLE} + CMND ${Python3_EXECUTABLE} ARGS compare_residual_history.py gold_files/Star2D_GS_4.log.gold Star2D_GS_4.log 1.0e-12 STANDARD_PASS_OUTPUT FAIL_FAST @@ -302,7 +302,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos2) ARGS --linAlgebra=Tpetra --xml=structured_linear_1dof.xml --matrixType=Brick3D --nx=10 --ny=10 --nz=10 --smootherIts=2 --convergence-log=Brick3D_linear_4.log NUM_MPI_PROCS 4 TEST_1 - CMND ${PYTHON_EXECUTABLE} + CMND ${Python3_EXECUTABLE} ARGS compare_residual_history.py gold_files/Brick3D_linear_4.log.gold Brick3D_linear_4.log 1.0e-12 STANDARD_PASS_OUTPUT FAIL_FAST @@ -317,7 +317,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos2) ARGS --linAlgebra=Tpetra --xml=structured_linear_3dof.xml --matrixType=Elasticity3D --nx=10 --ny=10 --nz=10 --smootherIts=2 --convergence-log=Elasticity3D_linear_4.log --solverType=region NUM_MPI_PROCS 4 TEST_1 - CMND ${PYTHON_EXECUTABLE} + CMND ${Python3_EXECUTABLE} ARGS compare_residual_history.py gold_files/Elasticity3D_linear_4.log.gold Elasticity3D_linear_4.log 1.0e-12 STANDARD_PASS_OUTPUT FAIL_FAST @@ -332,7 +332,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos2) ARGS --linAlgebra=Tpetra --xml=structured_linear_3dof.xml --matrixType=Elasticity3D --nx=10 --ny=10 --nz=10 --smootherIts=2 --convergence-log=Elasticity3D_CG_linear_4.log --solverType=CG NUM_MPI_PROCS 4 TEST_1 - CMND ${PYTHON_EXECUTABLE} + CMND ${Python3_EXECUTABLE} ARGS compare_residual_history.py gold_files/Elasticity3D_CG_linear_4.log.gold Elasticity3D_CG_linear_4.log 1.0e-12 STANDARD_PASS_OUTPUT FAIL_FAST @@ -347,7 +347,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos2) ARGS --linAlgebra=Tpetra --xml=structured_linear_3dof.xml --matrixType=Elasticity3D --nx=10 --ny=10 --nz=10 --smootherIts=2 --convergence-log=Elasticity3D_Richardson_linear_4.log --solverType=Richardson NUM_MPI_PROCS 4 TEST_1 - CMND ${PYTHON_EXECUTABLE} + CMND ${Python3_EXECUTABLE} ARGS compare_residual_history.py gold_files/Elasticity3D_Richardson_linear_4.log.gold Elasticity3D_Richardson_linear_4.log 1.0e-12 STANDARD_PASS_OUTPUT FAIL_FAST @@ -366,7 +366,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos2) ARGS --linAlgebra=Tpetra --xml=structured_linear_R_1dof.xml --matrixType=Brick3D --nx=19 --ny=19 --nz=10 --smootherIts=2 --convergence-log=Brick3D_linear_R_4_comp.log NUM_MPI_PROCS 4 TEST_2 - CMND ${PYTHON_EXECUTABLE} + CMND ${Python3_EXECUTABLE} ARGS compare_residual_history.py Brick3D_linear_4_comp.log Brick3D_linear_R_4_comp.log 1.0e-12 STANDARD_PASS_OUTPUT FAIL_FAST @@ -385,7 +385,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos2) ARGS --linAlgebra=Tpetra --xml=structured_linear_3dof.xml --matrixType=Elasticity3D --nx=10 --ny=10 --nz=10 --smootherIts=2 --convergence-log=Elasticity3D_Richardson_linear_4.log --solverType=Richardson NUM_MPI_PROCS 4 TEST_2 - CMND ${PYTHON_EXECUTABLE} + CMND ${Python3_EXECUTABLE} ARGS compare_residual_history.py Elasticity3D_Region_linear_4.log Elasticity3D_Richardson_linear_4.log 1.0e-12 STANDARD_PASS_OUTPUT FAIL_FAST @@ -401,7 +401,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos2) ARGS --linAlgebra=Tpetra --xml=structured_1dof.xml --matrixType=Star2D --nx=10 --ny=10 --smootherIts=2 --cycleType=W --convergence-log=Star2D_W.log NUM_MPI_PROCS 4 TEST_1 - CMND ${PYTHON_EXECUTABLE} + CMND ${Python3_EXECUTABLE} ARGS compare_residual_history.py gold_files/Star2D_W.log.gold Star2D_W.log 1.0e-12 STANDARD_PASS_OUTPUT FAIL_FAST diff --git a/packages/rol/cmake/PythonTest.cmake b/packages/rol/cmake/PythonTest.cmake index 2568fa4b6377..f5fbf4c94b22 100644 --- a/packages/rol/cmake/PythonTest.cmake +++ b/packages/rol/cmake/PythonTest.cmake @@ -1,7 +1,7 @@ MACRO(PYTHON_ADD_TEST TEST_NAME) TRIBITS_ADD_TEST( - ${PYTHON_EXECUTABLE} + ${Python3_EXECUTABLE} NOEXEPREFIX NOEXESUFFIX NAME PYTHON_${TEST_NAME} diff --git a/packages/rol/pyrol/CMakeLists.txt b/packages/rol/pyrol/CMakeLists.txt index 2fe54e059c57..9857e19eec0a 100644 --- a/packages/rol/pyrol/CMakeLists.txt +++ b/packages/rol/pyrol/CMakeLists.txt @@ -37,14 +37,14 @@ TRIBITS_ADD_OPTION_AND_DEFINE(PYROL_ENABLE_BINDER_UPDATE "Enable the update of the generated source files with Binder." OFF ) -MESSAGE("-- PYTHON_EXECUTABLE:") -IF(NOT DEFINED ${PYTHON_EXECUTABLE}) - find_program(PYTHON_EXECUTABLE +MESSAGE("-- Python3_EXECUTABLE:") +IF(NOT DEFINED ${Python3_EXECUTABLE}) + find_program(Python3_EXECUTABLE NAMES python3 python ) - MESSAGE(" -- CMake has set: PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}") + MESSAGE(" -- CMake has set: Python3_EXECUTABLE = ${Python3_EXECUTABLE}") ELSE() - MESSAGE(" -- User has set: PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}") + MESSAGE(" -- User has set: Python3_EXECUTABLE = ${Python3_EXECUTABLE}") ENDIF() @@ -257,7 +257,7 @@ IF (PYROL_GENERATE_SRC) list (APPEND PyROLPyFiles ${PyROLPyFiles2}) EXECUTE_PROCESS(COMMAND - ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/gather_includes.py ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${all_header_with_dir_list} ${all_header_without_dir_list} ${binder_include_name} + ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/gather_includes.py ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${all_header_with_dir_list} ${all_header_without_dir_list} ${binder_include_name} ) set(BINDER_OPTIONS "") @@ -322,12 +322,12 @@ ELSE() ENDIF() # Get the python version -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c +EXECUTE_PROCESS(COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.version_info.major)" OUTPUT_VARIABLE PYTHON_MAJOR_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c +EXECUTE_PROCESS(COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.version_info.minor)" OUTPUT_VARIABLE PYTHON_MINOR_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE @@ -385,7 +385,7 @@ ENDFOREACH() # Find the pybind11 CMake module EXECUTE_PROCESS(COMMAND - ${PYTHON_EXECUTABLE} -c "import pybind11; print(pybind11.get_cmake_dir())" + ${Python3_EXECUTABLE} -c "import pybind11; print(pybind11.get_cmake_dir())" OUTPUT_VARIABLE pybind11_DIR ERROR_VARIABLE pybind11_CMAKE_ERROR OUTPUT_STRIP_TRAILING_WHITESPACE @@ -395,7 +395,7 @@ MESSAGE(STATUS "pybind11 CMake path: ${pybind11_DIR}") find_package(pybind11 REQUIRED) EXECUTE_PROCESS(COMMAND - ${PYTHON_EXECUTABLE} -c "import mpi4py; print(mpi4py.get_include())" + ${Python3_EXECUTABLE} -c "import mpi4py; print(mpi4py.get_include())" OUTPUT_VARIABLE Mpi4Py_INCLUDE_DIR ERROR_VARIABLE Mpi4Py_INCLUDE_ERROR OUTPUT_STRIP_TRAILING_WHITESPACE diff --git a/packages/shylu/shylu_node/tacho/unit-test/googletest/cmake/internal_utils.cmake b/packages/shylu/shylu_node/tacho/unit-test/googletest/cmake/internal_utils.cmake index 5a34c07a1b99..1280e85acb11 100644 --- a/packages/shylu/shylu_node/tacho/unit-test/googletest/cmake/internal_utils.cmake +++ b/packages/shylu/shylu_node/tacho/unit-test/googletest/cmake/internal_utils.cmake @@ -242,13 +242,13 @@ function(cxx_executable name dir libs) ${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN}) endfunction() -# Sets PYTHONINTERP_FOUND and PYTHON_EXECUTABLE. +# Sets PYTHONINTERP_FOUND and Python3_EXECUTABLE. if ("${CMAKE_VERSION}" VERSION_LESS "3.12.0") find_package(PythonInterp) else() find_package(Python COMPONENTS Interpreter) set(PYTHONINTERP_FOUND ${Python_Interpreter_FOUND}) - set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) + set(Python3_EXECUTABLE ${Python_EXECUTABLE}) endif() # cxx_test_with_flags(name cxx_flags libs srcs...) @@ -282,13 +282,13 @@ function(py_test name) # output in a subdirectory of CMAKE_CURRENT_BINARY_DIR (Debug, # Release etc.), so we have to provide it here. add_test(NAME ${name} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py --build_dir=${CMAKE_CURRENT_BINARY_DIR}/$ ${ARGN}) else (CMAKE_CONFIGURATION_TYPES) # Single-configuration build generators like Makefile generators # don't have subdirs below CMAKE_CURRENT_BINARY_DIR. add_test(NAME ${name} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py --build_dir=${CMAKE_CURRENT_BINARY_DIR} ${ARGN}) endif (CMAKE_CONFIGURATION_TYPES) else() @@ -297,7 +297,7 @@ function(py_test name) # only at ctest runtime (by calling ctest -c ), so # we have to escape $ to delay variable substitution here. add_test(NAME ${name} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE} ${ARGN}) endif() # Make the Python import path consistent between Bazel and CMake.