[gem5-dev] Change in gem5/gem5[master]: scons: added support of default Python installation on MacOS

2019-01-11 Thread Andrea Mondelli (Gerrit)
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 
Reviewed-by: Jason Lowe-Power 
Maintainer: Jason Lowe-Power 
---
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 
Gerrit-Reviewer: Andrea Mondelli 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Matteo Andreozzi 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-CC: Andreas Sandberg 
Gerrit-MessageType: merged
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: scons: added support of default Python installation on MacOS

2019-01-11 Thread Andrea Mondelli (Gerrit)
Hello Gabe Black, Andrea Mondelli, Jason Lowe-Power, Nikos Nikoleris,  
Matteo Andreozzi,


I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/15475

to look at the new patch set (#4).

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
---
M SConstruct
1 file changed, 4 insertions(+), 1 deletion(-)


--
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: 4
Gerrit-Owner: Andrea Mondelli 
Gerrit-Reviewer: Andrea Mondelli 
Gerrit-Reviewer: Andrea Mondelli 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Matteo Andreozzi 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-CC: Andreas Sandberg 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: scons: added support of default Python installation on MacOS

2019-01-11 Thread Andrea Mondelli (Gerrit)
Hello Gabe Black, Andrea Mondelli, Jason Lowe-Power, Nikos Nikoleris,  
Matteo Andreozzi,


I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/15475

to look at the new patch set (#3).

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
---
M SConstruct
1 file changed, 6 insertions(+), 1 deletion(-)


--
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: 3
Gerrit-Owner: Andrea Mondelli 
Gerrit-Reviewer: Andrea Mondelli 
Gerrit-Reviewer: Andrea Mondelli 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Matteo Andreozzi 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-CC: Andreas Sandberg 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: scons: added support of default Python installation on MacOS

2019-01-10 Thread Andrea Mondelli (Gerrit)

Hello Gabe Black, Andrea Mondelli, Jason Lowe-Power,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/15475

to look at the new patch set (#2).

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
---
M SConstruct
1 file changed, 5 insertions(+), 1 deletion(-)


--
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: 2
Gerrit-Owner: Andrea Mondelli 
Gerrit-Reviewer: Andrea Mondelli 
Gerrit-Reviewer: Andrea Mondelli 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-CC: Andreas Sandberg 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: scons: added support of default Python installation on MacOS

2019-01-10 Thread Andrea Mondelli (Gerrit)

Hello Andrea Mondelli,

I'd like you to do a code review. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/15475

to review the following change.


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
---
M SConstruct
1 file changed, 5 insertions(+), 1 deletion(-)



diff --git a/SConstruct b/SConstruct
index 0a8cd0e..279823e 100755
--- a/SConstruct
+++ b/SConstruct
@@ -712,7 +712,11 @@
   exception='').split()
 # Strip the -I from the include folders before adding them to the
 # CPPPATH
-main.Append(CPPPATH=map(lambda inc: inc[2:], py_includes))
+if len(filter(lambda x: x == '-iwithsysroot', py_includes)) > 0:
+# Default MacOS Python
+main.Append(CPPPATH=py_includes)
+else:
+main.Append(CPPPATH=map(lambda inc: inc[2:], 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: 1
Gerrit-Owner: Andrea Mondelli 
Gerrit-Reviewer: Andrea Mondelli 
Gerrit-MessageType: newchange
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: scons: added support of default Python installation on MacOS

2019-01-08 Thread Andrea Mondelli (Gerrit)

Hello Andrea Mondelli,

I'd like you to do a code review. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/15375

to review the following change.


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: I9533c0f7858b5b3cab0ef101be1ee5cd718105b0
---
M SConstruct
M ext/mcpat/regression/regression.py
M ext/mcpat/regression/verify_output.py
M ext/ply/example/classcalc/calc.py
M ext/ply/example/newclasscalc/calc.py
M src/systemc/tests/verify.py
M src/unittest/genini.py
M tests/main.py
M tests/testing/__init__.py
M tests/testing/helpers.py
M tests/testing/results.py
M tests/testing/tests.py
M tests/testing/units.py
M tests/tests.py
M util/batch/job.py
M util/batch/send.py
M util/checkpoint-tester.py
M util/compile
M util/cpt_upgrader.py
M util/decode_inst_dep_trace.py
M util/decode_inst_trace.py
M util/decode_packet_trace.py
M util/encode_inst_dep_trace.py
M util/encode_packet_trace.py
M util/find_copyrights.py
M util/gen_arm_fs_files.py
M util/git-pre-commit.py
M util/hgstyle.py
M util/maint/list_changes.py
M util/maint/show_changes_by_file.py
M util/memtest-soak.py
M util/minorview.py
M util/o3-pipeview.py
M util/oprofile-top.py
M util/pbs/job.py
M util/pbs/send.py
M util/plot_dram/dram_lat_mem_rd_plot.py
M util/plot_dram/dram_sweep_plot.py
M util/protolib.py
M util/qdo
M util/regress
M util/slicc
M util/stats/stats.py
M util/streamline/m5stats2streamline.py
M util/style.py
M util/style/__init__.py
M util/style/repo.py
M util/style/sort_includes.py
M util/style/style.py
M util/style/verifiers.py
50 files changed, 57 insertions(+), 50 deletions(-)



diff --git a/SConstruct b/SConstruct
index 0a8cd0e..f15caa5 100755
--- a/SConstruct
+++ b/SConstruct
@@ -712,7 +712,14 @@
   exception='').split()
 # Strip the -I from the include folders before adding them to the
 # CPPPATH
-main.Append(CPPPATH=map(lambda inc: inc[2:], py_includes))
+if (
+sys.platform == "darwin" and
+len(filter (lambda x : x == '-iwithsysroot', py_includes)) > 0
+) :
+# Default MacOS Python
+main.Append(CPPPATH=py_includes)
+else:
+main.Append(CPPPATH=map(lambda inc: inc[2:], 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.
diff --git a/ext/mcpat/regression/regression.py  
b/ext/mcpat/regression/regression.py

index 0115a56..ddfa81b 100755
--- a/ext/mcpat/regression/regression.py
+++ b/ext/mcpat/regression/regression.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7

 # Copyright (c) 2010-2013 Advanced Micro Devices, Inc.
 # All rights reserved.
diff --git a/ext/mcpat/regression/verify_output.py  
b/ext/mcpat/regression/verify_output.py

index aaa7592..83e3e89 100644
--- a/ext/mcpat/regression/verify_output.py
+++ b/ext/mcpat/regression/verify_output.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7

 # Copyright (c) 2010-2013 Advanced Micro Devices, Inc.
 # All rights reserved.
diff --git a/ext/ply/example/classcalc/calc.py  
b/ext/ply/example/classcalc/calc.py

index f359197..b0712fc 100755
--- a/ext/ply/example/classcalc/calc.py
+++ b/ext/ply/example/classcalc/calc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7

 #  
-

 # calc.py
diff --git a/ext/ply/example/newclasscalc/calc.py  
b/ext/ply/example/newclasscalc/calc.py

index 3461f24..5a8db84 100755
--- a/ext/ply/example/newclasscalc/calc.py
+++ b/ext/ply/example/newclasscalc/calc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7

 #  
-

 # calc.py
diff --git a/src/systemc/tests/verify.py b/src/systemc/tests/verify.py
index def0fdc..503c11d 100755
--- a/src/systemc/tests/verify.py
+++ b/src/systemc/tests/verify.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
 #
 # Copyright 2018 Google, Inc.
 #
diff --git a/src/unittest/genini.py b/src/unittest/genini.py
index 5a4f345..f10ad68 100755
--- a/src/unittest/genini.py
+++ b/src/unittest/genini.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
 # Copyright (c) 2005 The Regents of The