简体   繁体   中英

Scons Throwing Syntax Errors when Building gem5 Simulator on Manjaro (Arch) Linux

I need to setup a gem5 simulator for a computer architecture class. After downloading all the dependencies for Scons and running the build command for the ALPHA simulator, python throws a syntax error (shown below) flagging the use of a comma during the creation of a SystemExit exception.

To remedy this I tried running scons with python2 and python3. I even tried running my assignment in a virtual machine to no avail. Can someone familiar with Scons explain where this error is coming from and how to remedy it. It would be greatly appreciated.

Command Ran:

scons build/ALPHA/gem5.opt -j4

Error Message:

*** Error loading site_init file './site_scons/site_init.py':
  File "./site_scons/site_init.py", line 52

    except SystemExit, e:

                     ^

SyntaxError: invalid syntax

OS: Manjaro Linux x86_64

Kernel: 4.19.66-1-MANJARO

Python3 Version: Python 3.7.4

Python2 Version: Python 2.7.16

Latest Version of Scons

Edit

Here's a link to an archived conversation about the problem. It comes frustratingly close to providing a solution, but it's all I've found on the issue thus far. The search continues.

The problem you are seeing looks like it should only happen with Python 3.5+ and SCons 3.0.0+

*** Error loading site_init file './site_scons/site_init.py':
  File "./site_scons/site_init.py", line 52

    except SystemExit, e:

                     ^

SyntaxError: invalid syntax

site_scons/site_init.py is a file in the package you downloaded to build and is using a form of python's except statement not allowed by python 3+.

Change it to:

except SystemExit as e:

See: https://docs.python.org/3/tutorial/errors.html for more info on python 3 and exceptions.

Note you should probably make a pull request or send a patch to the gem project once you resolve that and any other issues you run into.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM