scons: Use python-config instead of distutils
Review Request #1933 - Created June 26, 2013 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 9798:320114314d30 --------------------------- scons: Use python-config instead of distutils This patch changes how we determine the Python-related compiler and linker flags. The previous approach used the internal LINKFORSHARED which is not intended as part of the external API (http://bugs.python.org/issue3588) and causes failures on recent OSX installations. Instead of using distutils we now rely on python-config and scons ParseConfig. For backwards compatibility we also parse out the includes and libs although this could safely be dropped. The drawback of this patch is that Python 2.5 is now required, but hopefully that is an acceptable compromise as any system with gcc 4.4 most likely will have Python >= 2.5.
Compiled on OSX 10.8, RHE5, Ubuntu 10/12.04, OpenSUSE 12.3, Fedora19
Posted (June 26, 2013, 4:26 p.m.)
-
SConstruct (Diff revision 1) -
would be nice to mention here that python-config is why we need 2.5
-
SConstruct (Diff revision 1) -
I found this whole comment a bit confusing, as it refers to things that aren't in the code below; I think it relies on context from the old code that won't be there anymore. Can you rewrite it to be more context-free?
Review request changed
Updated (June 27, 2013, 7:11 a.m.)
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+41 -50) |
Ship It!
Posted (June 27, 2013, 10:27 p.m.)
Andreas, I was testing this patch on my machine and I got the following error. Is the problem at my end or is something wrong with the patch? [nilay@ribera] (26)$ scons -j 15 --no-lto PROTOCOL=MESI_CMP_directory build/X86_MESI_CMP_directory/gem5.debug scons: Reading SConscript files ... Checking for leading underscore in global variables...(cached) no Checking for C header file Python.h... (cached) yes Checking for C library pthread... yes Checking for C library dl... yes Checking for C library util... yes Checking for C library m... yes Checking for C library python2.7... no Error: can't find library python2.7 required by python
