Skip to content

Commit 0a7a1de

Browse files
committed
prefer python3 for matchcompiler in build
1 parent 8a455c2 commit 0a7a1de

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

cmake/findDependencies.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ endif()
3434
set(CMAKE_INCLUDE_CURRENT_DIR ON)
3535

3636
if (NOT USE_MATCHCOMPILER_OPT MATCHES "Off")
37-
find_package(PythonInterp)
38-
if (NOT ${PYTHONINTERP_FOUND})
39-
message(WARNING "No python interpreter found. Therefore, the match compiler is switched off.")
40-
set(USE_MATCHCOMPILER_OPT "Off")
37+
find_package(PythonInterp 3 QUIET)
38+
if (NOT PYTHONINTERP_FOUND)
39+
set(PYTHONINTERP_FOUND "")
40+
find_package(PythonInterp 2.7 QUIET)
41+
if (NOT PYTHONINTERP_FOUND)
42+
message(WARNING "No python interpreter found. Therefore, the match compiler is switched off.")
43+
set(USE_MATCHCOMPILER_OPT "Off")
44+
endif()
4145
endif()
4246
endif()
4347

cmake/printInfo.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ if (HAVE_RULES)
4747
message( STATUS "PCRE_LIBRARY = ${PCRE_LIBRARY}" )
4848
endif()
4949
message( STATUS )
50+
if (NOT USE_MATCHCOMPILER_OPT MATCHES "Off")
51+
message( STATUS "PYTHON_VERSION_STRING = ${PYTHON_VERSION_STRING}" )
52+
message( STATUS "PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}" )
53+
endif()
54+
message( STATUS )
5055
message( STATUS "USE_Z3 = ${USE_Z3}" )
5156
if (USE_Z3)
5257
message( STATUS "Z3_LIBRARIES = ${Z3_LIBRARIES}" )

tools/dmake.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ int main(int argc, char **argv)
254254
<< "endif\n";
255255
fout << "ifeq ($(MATCHCOMPILER),yes)\n"
256256
<< " # Find available Python interpreter\n"
257-
<< " PYTHON_INTERPRETER := $(shell which python)\n"
257+
<< " PYTHON_INTERPRETER := $(shell which python3)\n"
258258
<< " ifndef PYTHON_INTERPRETER\n"
259-
<< " PYTHON_INTERPRETER := $(shell which python3)\n"
259+
<< " PYTHON_INTERPRETER := $(shell which python)\n"
260260
<< " endif\n"
261261
<< " ifndef PYTHON_INTERPRETER\n"
262262
<< " $(error Did not find a Python interpreter)\n"

0 commit comments

Comments
 (0)