From 266c2eba8e4ed4c8726be4881a9a332d2ff7eee2 Mon Sep 17 00:00:00 2001 From: Attila Krasznahorkay Date: Tue, 23 Oct 2018 14:57:31 +0200 Subject: [PATCH] Tried to remove all hardcoded python paths from the code. This is to make it possible to build/use VDT with Python *not* installed under /usr/bin. --- src/CMakeLists.txt | 7 +++++-- src/numpy_wrapper_generator.py | 2 +- src/vc_wrapper_generator.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ccf82b5..ed39622 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,15 +1,18 @@ # Auto generate the code for the vector signatures and if needed preload +# We need Python for the following. +find_package (PythonInterp REQUIRED) + # Generate the code for the lib if (PRELOAD) set (SIGGENOPTS " -p") else() set (SIGGENOPTS " ") endif() -EXEC_PROGRAM ("cd src;python ${CMAKE_SOURCE_DIR}/src/signatures_generator.py ${SIGGENOPTS} -o ${CMAKE_SOURCE_DIR}/src;cd -") +EXEC_PROGRAM ("cd src;${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/signatures_generator.py ${SIGGENOPTS} -o ${CMAKE_SOURCE_DIR}/src;cd -") #generare Vc wrapper and config file if(USE_VC) - EXEC_PROGRAM ("cd src;python vc_wrapper_generator.py;cd -") + EXEC_PROGRAM ("cd src;${PYTHON_EXECUTABLE} vc_wrapper_generator.py;cd -") endif(USE_VC) configure_file( ${INC_DIR}/externalLibcfg.h.cmake ${INC_DIR}/externalLibcfg.h) diff --git a/src/numpy_wrapper_generator.py b/src/numpy_wrapper_generator.py index c55b148..2bf8c6e 100644 --- a/src/numpy_wrapper_generator.py +++ b/src/numpy_wrapper_generator.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python """ Generates numpy wrapper - both header and .cc file diff --git a/src/vc_wrapper_generator.py b/src/vc_wrapper_generator.py index 3943446..057e6dc 100644 --- a/src/vc_wrapper_generator.py +++ b/src/vc_wrapper_generator.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python """ Generates vc wrapper - both header and .cc file