This list is for asking questions, so there's nothing wrong with you asking questions :-).

The instructions below are a good starting point, but I suspect you might not have something installed correctly (or at least not in a way we've tried before). The code that's failing is this:


extra_python_paths = [
    Dir('src/python').srcnode().abspath, # M5 includes
    Dir('ext/ply').srcnode().abspath, # ply is used by several files
    ]

sys.path[1:1] = extra_python_paths

from m5.util import compareVersions, readCommand

What that's supposed to be doing is adding src/python and ext/ply in the M5 source tree to your python path. Then it imports m5.util which it should find in src/python. The src/python/m5 directory and the src/python/m5/util directory both have __init__.py files in them which makes them act like python packages and is why you should be able to import from them.

When you run scons, it reads in that SConstruct file which is run as a python script more or less. Very early in that file the code above is executed, and that's not working for some reason. I would expect the problem to be in how scons or python are installed (or their versions), the way they're being started on the command line, or something about the actual files or paths of the M5 source tree.

You could try printing out the sys.path list to see if anything looks wrong. For me the first few entries in that list are the following:

['/home/gblack/m5/repos/public', '/home/gblack/m5/repos/public/src/python', '/home/gblack/m5/repos/public/ext/ply',

You can see where src/python and ext/ply have been added in.

Even though I think the problem might be from the way your system is set up, it would still be a good idea to follow Victor's instructions and see if that works for you.

Gabe

Quoting [email protected]:



hg clone http://repo.m5sim.org/m5

cd m5

scons build/ALPHA_SE/m5.opt

That should be enough to get you started.

On Thu, 17 Feb 2011 09:56:52 +0800, ?? ?  wrote:  Dear All

 I am terribly sorry about sending email here again, since I just found out
that this email address is the one that I should ask question, not
[email protected] [1]

 Please disregard my previous email sent to [email protected] [2]

 I am a newbie to m5 simulator and I really do not know where to look for
answer, sorry about ask the question here.
 I tried to install M5 on my ubuntu10.10. And I followed the instructions
given in the following website

 http://www.m5sim.org/wiki/index.php/Compiling_M5 [3]

 but it always gives such error message

 scons: Reading SConscript files ...
 ImportError: No module named m5.util:
 File "/home/victorlxy/src/m5-stable/SConstruct", line 121:
 from m5.util import compareVersions, readCommand

 And I am so frustrated because I do not know where the
problem is from,
such as scons or m5 itself, since I dowloaded scons from www.scons.org [4]
and installed it.

 Any help will be greatly appreciated

Best Regards
Victor



Links:
------
[1] mailto:[email protected]
[2] mailto:[email protected]
[3] http://www.m5sim.org/wiki/index.php/Compiling_M5
[4] http://www.scons.org/



_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users

Reply via email to