[Beignet] [PATCH] GBE: define python interpreter by cmake variable

Boqun Feng boqun.feng at gmail.com
Tue Sep 17 02:13:50 PDT 2013


Thx!

Boqun


On Tue, Sep 17, 2013 at 3:00 PM, Zhigang Gong
<zhigang.gong at linux.intel.com>wrote:

> Boqun,
>
> LGTM, thanks for your contribution, pushed.
>
> On Tue, Sep 17, 2013 at 11:41:50AM +0800, Boqun Feng wrote:
> > 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 at gmail.com>
> > ---
> >  backend/src/CMakeLists.txt | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/backend/src/CMakeLists.txt b/backend/src/CMakeLists.txt
> > index dd91ca5..5ef1234 100644
> > --- a/backend/src/CMakeLists.txt
> > +++ b/backend/src/CMakeLists.txt
> > @@ -26,12 +26,12 @@ set_property(DIRECTORY APPEND PROPERTY
> ADDITIONAL_MAKE_CLEAN_FILES "ocl_vector.h
> >
> >  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})
> >
> >
> > --
> > 1.8.4
> >
> > _______________________________________________
> > Beignet mailing list
> > Beignet at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/beignet
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/beignet/attachments/20130917/d09dc5a5/attachment-0001.html>


More information about the Beignet mailing list