This is an archive of the discontinued LLVM Phabricator instance.

Add support for building with Python 3
ClosedPublic

Authored by cbiesinger on Jul 9 2019, 1:05 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

cbiesinger created this revision.Jul 9 2019, 1:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2019, 1:05 PM
mgorny added inline comments.Jul 9 2019, 1:13 PM
llvm/CMakeLists.txt
645 ↗(On Diff #208790)

Wouldn't the correct thing to do be removing the list altogether?

cbiesinger marked an inline comment as done.Jul 9 2019, 1:32 PM
cbiesinger added inline comments.
llvm/CMakeLists.txt
645 ↗(On Diff #208790)

Apparently not; if I do that CMake still finds Python 2.7.

  • Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found version "2.7.16")
mgorny added inline comments.Jul 9 2019, 1:39 PM
llvm/CMakeLists.txt
645 ↗(On Diff #208790)

In that case, you should specify at least 3.7 as well. Maybe 3.5 if it works.

cbiesinger updated this revision to Diff 208799.Jul 9 2019, 1:44 PM

Add 3.7 and 3.5

cbiesinger marked an inline comment as done.Jul 9 2019, 1:45 PM
cbiesinger added inline comments.
llvm/CMakeLists.txt
645 ↗(On Diff #208790)

OK, done. (I don't have 3.5 to test but have no reason to assume it won't work)

thakis accepted this revision.Jul 10 2019, 12:28 PM
thakis added a subscriber: thakis.

lgtm

This revision is now accepted and ready to land.Jul 10 2019, 12:28 PM
This revision was automatically updated to reflect the committed changes.
pree-jackie added a subscriber: pree-jackie.EditedJul 17 2019, 5:32 AM

Hey guys, I get cmake error at configuration time " Found incompatible python interpreter version and python libraries version". I have both python 2.7 and python 3.6, cmake now finds python interpreter version 3.6 and python libs 2.7, hence the incompatibility. How I can rectify this?

I reverse the list as 2.7 3.5 3.6 3.7 it fixes the issue, but I don't know whether it is correct or not.

pree-jackie: My guess is that you have python2.7-dev installed but not python3.6-dev -- does it work if you install that one?