Andrea Mondelli has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/15475 )

Change subject: scons: added support of default Python installation on MacOS
......................................................................

scons: added support of default Python installation on MacOS

Recent MacOS versions are distributed with python 2.7.
This version of python is sufficient to compile and run gem5.

This patch allows to use the default python instead of the version provided
by third-party tools (e.g., brew)

The default MacOS LLDB debugger is linked against the default python
installation, which conflicts with Python framework provided by third-party
package systems.

This patch removes the need of gem5 to have multiple python installations
on MacOS, if not explicitly installed.

Change-Id: I98f24804149cb2e04ca432c66d2f57e0296af7b2
Reviewed-on: https://gem5-review.googlesource.com/c/15475
Reviewed-by: Nikos Nikoleris <nikos.nikole...@arm.com>
Reviewed-by: Jason Lowe-Power <ja...@lowepower.com>
Maintainer: Jason Lowe-Power <ja...@lowepower.com>
---
M SConstruct
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Nikos Nikoleris: Looks good to me, approved



diff --git a/SConstruct b/SConstruct
index 0a8cd0e..659023b 100755
--- a/SConstruct
+++ b/SConstruct
@@ -92,6 +92,7 @@
 from os.path import abspath, basename, dirname, expanduser, normpath
 from os.path import exists,  isdir, isfile
 from os.path import join as joinpath, split as splitpath
+from re import match

 # SCons includes
 import SCons
@@ -710,9 +711,11 @@
                                     exception='').strip()
     py_includes = readCommand([python_config, '--includes'],
                               exception='').split()
+ py_includes = filter(lambda s: match(r'.*\/include\/.*',s), py_includes)
     # Strip the -I from the include folders before adding them to the
     # CPPPATH
-    main.Append(CPPPATH=map(lambda inc: inc[2:], py_includes))
+ py_includes = map(lambda s: s[2:] if s.startswith('-I') else s, py_includes)
+    main.Append(CPPPATH=py_includes)

     # Read the linker flags and split them into libraries and other link
     # flags. The libraries are added later through the call the CheckLib.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/15475
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I98f24804149cb2e04ca432c66d2f57e0296af7b2
Gerrit-Change-Number: 15475
Gerrit-PatchSet: 6
Gerrit-Owner: Andrea Mondelli <andrea.monde...@ucf.edu>
Gerrit-Reviewer: Andrea Mondelli <andrea.monde...@ucf.edu>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Matteo Andreozzi <matteo.andreo...@arm.com>
Gerrit-Reviewer: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-CC: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to