1

I have been trying to build Clang 3.9.0 in the Open Build Service (the source files I use to do this can be found here). Now this is failing at the moment giving the error (full log is here):

[  187s] -- Found PythonInterp: /usr/bin/python2.7 (found version "1.4") 
[  187s] CMake Error at CMakeLists.txt:116 (message):
[  187s]   Python 2.7 or newer is required
[  187s] 
[  187s] 
[  187s] -- Configuring incomplete, errors occurred!
[  187s] See also "/home/abuild/rpmbuild/BUILD/cfe-3.9.0.src/_build/CMakeFiles/CMakeOutput.log".
[  187s] error: Bad exit status from /var/tmp/rpm-tmp.VodmZx (%build)

this error is being generated by this cmake command in my clang.spec file:

%cmake .. \
    -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DLLVM_CONFIG:FILEPATH=/usr/bin/llvm-config-%{__isa_bits} \
    \
    -DCLANG_ENABLE_ARCMT:BOOL=ON \
    -DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
    -DCLANG_INCLUDE_DOCS:BOOL=ON \
    -DCLANG_INCLUDE_TESTS:BOOL=ON \
    -DCLANG_PLUGIN_SUPPORT:BOOL=ON \
    \
    -DCLANG_BUILD_EXAMPLES:BOOL=OFF \
    -DPYTHON_EXECUTABLE=/usr/bin/python2.7 \
%if 0%{?__isa_bits} == 64
        -DLLVM_LIBDIR_SUFFIX=64 \
%else
        -DLLVM_LIBDIR_SUFFIX= \
%endif
    -DLIB_SUFFIX=

It is obvious that this error message is bogus. It's asking for Python 2.7 or newer, and the name of the Python interpreter I gave it is /usr/bin/python2.7 (so it should be providing it with exactly what's it's asking for, Python 2.7!). So this question is essentially is there an option I can pass cmake that will silence this error and cause cmake to continue running despite the error?

Josh Pinto
  • 1,453
  • 4
  • 20
  • 37
  • 1
    What does `/usr/bin/python2.7 --version` print? Where is it getting `1.4` from? – John Zwinck Dec 17 '16 at 02:08
  • OK my attempt to get that information failed... I tried adding a line `/usr/bin/python2.7 --version` to before that cmake command in my spec file see (https://build.opensuse.org/package/view_file/home:fusion809/clang/clang.spec) but it returned the error shown [here](http://paste2.org/AxyZXejy). – Josh Pinto Dec 17 '16 at 02:18
  • 1
    This answer includes hints for defining other python variables `PYTHON_INCLUDE_DIR` and `PYTHON_LIBRARY`. You'll need to change the python calls to /usr/bin/python2.7. http://stackoverflow.com/a/38121972/642070 – tdelaney Dec 17 '16 at 02:18
  • @tdelaney This is on a Fedora OBS build instance. On Fedora /usr/bin/python is symlinked to /usr/bin/python2.7. – Josh Pinto Dec 17 '16 at 02:20
  • @tdelaney tried your solution (https://build.opensuse.org/package/view_file/home:fusion809/clang/clang.spec?rev=5) gave the same cmake error though stating that /usr/bin/python2.7 is version 1.4. – Josh Pinto Dec 17 '16 at 02:27

0 Answers0