In some distros, python is linked to python3 not
python2, and GBE can't be built on such distros
without modification.
CMake provides a variable PYTHON_EXECUTABLE.
By default, this variable is the same as
`/usr/bin/env python`, and if another python2
interpreter is needed, just add this defination in
`cmake` command.
-DPYTHON_EXECUTABLE:FILEPATH=/path/to/python2
And this will change PYTHON_EXECUTABLE to
/path/to/python2
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
add_custom_command(
OUTPUT ${ocl_vector_file}
- COMMAND ${ocl_gen_vector_cmd} ${ocl_vector_spec_file} ${ocl_vector_file}
+ COMMAND ${PYTHON_EXECUTABLE} ${ocl_gen_vector_cmd} ${ocl_vector_spec_file} ${ocl_vector_file}
DEPENDS ${ocl_gen_vector_cmd} ${ocl_vector_spec_file})
add_custom_command(
OUTPUT ${ocl_blob_file}
- COMMAND ${ocl_gen_blob_cmd} ${ocl_stdlib_tmpl_file} ${ocl_blob_file}
+ COMMAND ${PYTHON_EXECUTABLE} ${ocl_gen_blob_cmd} ${ocl_stdlib_tmpl_file} ${ocl_blob_file}
DEPENDS ${ocl_gen_blob_cmd} ${ocl_stdlib_tmpl_file} ${ocl_vector_file} ${ocl_as_file} ${ocl_convert_file})