I have tackled this problem ever before. It's the python compilation problem 
that causes this error.
You can simply follow the steps listed below:


1) rebuild Python: 
$ ./configure --enable-shared --prefix=$HOME ;  (You MUST add the 
"--enable-shared" in this command line)
$ make ; 
$ make install
(make sure you have changed your "PATH" and "LD_LIBRARY_PATH" environment 
variables.)


2) rebuild gem5: and the command would be: 
$ scons build/ALPHA/gem5.opt


Now you could run your example 'hello world' program with no errors! Happy 
using!

----------------------------------------------------------
Lu Hang
Phd Candidate
State Key Laboratory of Computer Architecture,
Institute of Computing Technology,
Chinese Academy of Sciences, Beijing, China.
----------------------------------------------------------
----- Original Message ----- 
From: gem5-users-request 
To: gem5-users 
Date: 2013-03-01, 22:09:54
Subject: gem5-users Digest, Vol 80, Issue 2


Send gem5-users mailing list submissions to
  [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
  http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
or, via email, send a message with subject or body 'help' to
  [email protected]

You can reach the person managing the list at
  [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gem5-users digest..."


Today's Topics:

   1. Re: Builded gem5 just fine but run into trouble when
      executing simple helloworld program... (Maxime Ch?ramy)
   2. Re: Builded gem5 just fine but run into trouble when
      executing simple helloworld program... (Andreas Hansson)


----------------------------------------------------------------------

Message: 1
Date: Fri, 1 Mar 2013 15:10:35 +0100
From: Maxime Ch?ramy <[email protected]>
To: gem5 users mailing list <[email protected]>
Subject: Re: [gem5-users] Builded gem5 just fine but run into trouble
  when executing simple helloworld program...
Message-ID:
  <CAEdoOGwh+p1QZddZ=SkaSO68B5ziaj3K-PeW3+7Vf=cwmbz...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Problem apparently fixed using swig 2.0.7 (swig was updated on debian sid
this week...).

2013/3/1 Maxime Ch?ramy <[email protected]>

> Hello,
>
> I had the bad idea of updating and rebuilding this morning and now I am
> facing the exact same problem than you. Do you have any idea on how I could
> solve this problem?
>
> Debian Wheezy:
>
> gcc 4.7.2
> python 2.7.3
> scons 2.1.0
> swig 2.0.9
>
> Thank you,
>
> Maxime.
>
>
> 2013/2/28 mehmet basaran <[email protected]>
>
>> I do not know the cause of this problem as well. I was just speculating
>> from the link I provided. If you don't have much time, I recommend using
>> apt-get. At least, it leaves you something to work with.
>>
>>
>> 2013/2/28 ef <[email protected]>
>>
>>> Any ideas on how to fix this without using apt-get? The email you sent
>>> didn't really solve the problem.
>>>
>>> Thanks in advance!
>>>
>>> I have gcc 4.7.1
>>> python 2.7.3
>>> Scons 2.2.0
>>> Swig 2.0.9
>>>
>>> And the output I get;
>>>
>>> Traceback (most recent call last):
>>> File "<string>", line 1, in <module>
>>> File "/home/matara/gem5/src/python/importer.py", line 73, in
>>> load_module
>>> exec code in mod.__dict__
>>> File "/home/matara/gem5/src/python/m5/__init__.py", line 35, in
>>> <module>
>>> import internal
>>> File "/home/matara/gem5/src/python/importer.py", line 73, in
>>> load_module
>>> exec code in mod.__dict__
>>> File "/home/matara/gem5/src/python/m5/internal/__init__.py", line 31,
>>> in <module>
>>> import event
>>> File "/home/matara/gem5/src/python/importer.py", line 73, in
>>> load_module
>>> exec code in mod.__dict__
>>> File "/home/matara/gem5/build/X86/python/swig/event.py", line 107, in
>>> <module>
>>> class Event(m5.internal.serialize.Serializable):
>>> AttributeError: 'module' object has no attribute 'internal'
>>>
>>>
>>> On Tue, Feb 26, 2013 at 7:35 AM, mehmet basaran <
>>> [email protected]> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I have found the problem. I was trying to install all dependencies from
>>>> the source code. Unfortunately I had either one or more of the following
>>>> cases;
>>>>
>>>> 1. my python was not compatible with libc
>>>> 2. my gcc was incompatible with swig
>>>> 3. or any combination of those 4...
>>>>
>>>> source: http://www.mail-archive.com/[email protected]/msg06380.html
>>>>
>>>> So, I have reinstalled using sudo apt-get install ... with the help of
>>>> another gem5 struggler and it worked.
>>>>
>>>> Thanks for the... oh wait a minute...
>>>>
>>>> take care
>>>>
>>>>
>>>> 2013/2/25 mehmet basaran <[email protected]>
>>>>
>>>>> Hi all,
>>>>>
>>>>> My computer messed up and I had to re-install gem5. I have been
>>>>> performing the same steps. I could build the system but for some reason I
>>>>> cannot run the simplest example. I am using ubuntu. Here is my command 
>>>>> line;
>>>>>
>>>>> build/X86/gem5.opt configs/example/se.py
>>>>> --cmd="tests/test-progs/hello/bin/x86/linux/hello"
>>>>>
>>>>> And the output I get;
>>>>>
>>>>> Traceback (most recent call last):
>>>>> File "<string>", line 1, in <module>
>>>>> File "/home/matara/gem5/src/python/importer.py", line 73, in
>>>>> load_module
>>>>> exec code in mod.__dict__
>>>>> File "/home/matara/gem5/src/python/m5/__init__.py", line 35, in
>>>>> <module>
>>>>> import internal
>>>>> File "/home/matara/gem5/src/python/importer.py", line 73, in
>>>>> load_module
>>>>> exec code in mod.__dict__
>>>>> File "/home/matara/gem5/src/python/m5/internal/__init__.py", line
>>>>> 31, in <module>
>>>>> import event
>>>>> File "/home/matara/gem5/src/python/importer.py", line 73, in
>>>>> load_module
>>>>> exec code in mod.__dict__
>>>>> File "/home/matara/gem5/build/X86/python/swig/event.py", line 107,
>>>>> in <module>
>>>>> class Event(m5.internal.serialize.Serializable):
>>>>> AttributeError: 'module' object has no attribute 'internal'
>>>>>
>>>>> I added new environment variables in .bashrc file as follows;
>>>>>
>>>>> export JAVA_HOME="/home/matara/Tools/jdk1.7.0"
>>>>> export PYTHONPATH="/home/matara/Tools/Python-2.7.3"
>>>>> export SWIG="/home/matara/Tools/swig-2.0.9"
>>>>> export BZ2="/home/matara/Tools/bzip2-1.0.6"
>>>>> export MYSCONS="/home/matara/Tools/scons-src-2.2.0"
>>>>> export LD_LIBRARY_PATH=$BZ2:$PYTHONPATH
>>>>> export LIBRARY_PATH=$BZ2:$PYTHONPATH
>>>>> export
>>>>> PATH="$PATH:$PYTHONPATH:$PYTHONPATH/scripts:SWIG:$BZ2:$JAVA_HOME/jre/bin"
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>
>>>>> My first reaction was to install modules that come as missing in
>>>>> normal python. But that didn't work.
>>>>> I tried to run scons-local, in case it is using a built-in python.
>>>>> Didn't work either.
>>>>> I have tried re-installing stable and dev versions but still no
>>>>> progress.
>>>>> Other than that I have tried reinstalling countless times on both
>>>>> 32bit and 64bit machines, but got the same result.
>>>>>
>>>>> And so passed 1 week. Don't know what is the problem but I
>>>>> successfully installed gem5 once without this much effort. I have also 
>>>>> seen
>>>>> a ticket on gem5-dev maillist about python2.7 compatibility. But have no
>>>>> idea if this is it.
>>>>>
>>>>> Any help, pointers, questions are welcome as usual. Thanks in advance.
>>>>> Mehmet
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> gem5-users mailing list
>>>> [email protected]
>>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>>
>>>
>>>
>>> _______________________________________________
>>> gem5-users mailing list
>>> [email protected]
>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>
>>
>>
>> _______________________________________________
>> gem5-users mailing list
>> [email protected]
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://m5sim.org/cgi-bin/mailman/private/gem5-users/attachments/20130301/860036fe/attachment-0001.html>

------------------------------

Message: 2
Date: Fri, 1 Mar 2013 14:14:53 +0000
From: Andreas Hansson <[email protected]>
To: gem5 users mailing list <[email protected]>
Subject: Re: [gem5-users] Builded gem5 just fine but run into trouble
  when executing simple helloworld program...
Message-ID: <cd565edd.845a%[email protected]>
Content-Type: text/plain; charset="windows-1252"

I just did a clean build on OpenSuse 12.3 with:

Gcc 4.7.2
Python 2.7.3
Scons 2.2.0
Swig 2.0.9

Works without any issues.

Have a look at http://www.mail-archive.com/[email protected]/msg06475.html as 
well.

Andreas

From: Maxime Ch?ramy <[email protected]<mailto:[email protected]>>
Reply-To: gem5 users mailing list 
<[email protected]<mailto:[email protected]>>
Date: Friday, 1 March 2013 12:46
To: gem5 users mailing list <[email protected]<mailto:[email protected]>>
Subject: Re: [gem5-users] Builded gem5 just fine but run into trouble when 
executing simple helloworld program...

Hello,

I had the bad idea of updating and rebuilding this morning and now I am facing 
the exact same problem than you. Do you have any idea on how I could solve this 
problem?

Debian Wheezy:

gcc 4.7.2
python 2.7.3
scons 2.1.0
swig 2.0.9

Thank you,

Maxime.

2013/2/28 mehmet basaran 
<[email protected]<mailto:[email protected]>>
I do not know the cause of this problem as well. I was just speculating from 
the link I provided. If you don't have much time, I recommend using apt-get. At 
least, it leaves you something to work with.


2013/2/28 ef <[email protected]<mailto:[email protected]>>
Any ideas on how to fix this without using apt-get? The email you sent didn't 
really solve the problem.

Thanks in advance!

I have gcc 4.7.1
python 2.7.3
Scons 2.2.0
Swig 2.0.9

And the output I get;

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/matara/gem5/src/python/importer.py", line 73, in load_module
    exec code in mod.__dict__
  File "/home/matara/gem5/src/python/m5/__init__.py", line 35, in <module>
    import internal
  File "/home/matara/gem5/src/python/importer.py", line 73, in load_module
    exec code in mod.__dict__
  File "/home/matara/gem5/src/python/m5/internal/__init__.py", line 31, in 
<module>
    import event
  File "/home/matara/gem5/src/python/importer.py", line 73, in load_module
    exec code in mod.__dict__
  File "/home/matara/gem5/build/X86/python/swig/event.py", line 107, in <module>
    class Event(m5.internal.serialize.Serializable):
AttributeError: 'module' object has no attribute 'internal'


On Tue, Feb 26, 2013 at 7:35 AM, mehmet basaran 
<[email protected]<mailto:[email protected]>> wrote:
Hi all,

I have found the problem. I was trying to install all dependencies from the 
source code. Unfortunately I had either one or more of the following cases;

1. my python was not compatible with libc
2. my gcc was incompatible with swig
3. or any combination of those 4...

source: http://www.mail-archive.com/[email protected]/msg06380.html

So, I have reinstalled using sudo apt-get install ... with the help of another 
gem5 struggler and it worked.

Thanks for the... oh wait a minute...

take care


2013/2/25 mehmet basaran 
<[email protected]<mailto:[email protected]>>
Hi all,

My computer messed up and I had to re-install gem5. I have been performing the 
same steps. I could build the system but for some reason I cannot run the 
simplest example. I am using ubuntu. Here is my command line;

build/X86/gem5.opt configs/example/se.py 
--cmd="tests/test-progs/hello/bin/x86/linux/hello"

And the output I get;

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/matara/gem5/src/python/importer.py", line 73, in load_module
    exec code in mod.__dict__
  File "/home/matara/gem5/src/python/m5/__init__.py", line 35, in <module>
    import internal
  File "/home/matara/gem5/src/python/importer.py", line 73, in load_module
    exec code in mod.__dict__
  File "/home/matara/gem5/src/python/m5/internal/__init__.py", line 31, in 
<module>
    import event
  File "/home/matara/gem5/src/python/importer.py", line 73, in load_module
    exec code in mod.__dict__
  File "/home/matara/gem5/build/X86/python/swig/event.py", line 107, in <module>
    class Event(m5.internal.serialize.Serializable):
AttributeError: 'module' object has no attribute 'internal'

I added new environment variables in .bashrc file as follows;

export JAVA_HOME="/home/matara/Tools/jdk1.7.0"
export PYTHONPATH="/home/matara/Tools/Python-2.7.3"
export SWIG="/home/matara/Tools/swig-2.0.9"
export BZ2="/home/matara/Tools/bzip2-1.0.6"
export MYSCONS="/home/matara/Tools/scons-src-2.2.0"
export LD_LIBRARY_PATH=$BZ2:$PYTHONPATH
export LIBRARY_PATH=$BZ2:$PYTHONPATH
export PATH="$PATH:$PYTHONPATH:$PYTHONPATH/scripts:SWIG:$BZ2:$JAVA_HOME/jre/bin"

------------------------------------------------------------------------------------------------------------------------------------------------

My first reaction was to install modules that come as missing in normal python. 
But that didn't work.
I tried to run scons-local, in case it is using a built-in python. Didn't work 
either.
I have tried re-installing stable and dev versions but still no progress.
Other than that I have tried reinstalling countless times on both 32bit and 
64bit machines, but got the same result.

And so passed 1 week. Don't know what is the problem but I successfully 
installed gem5 once without this much effort. I have also seen a ticket on 
gem5-dev maillist about python2.7 compatibility. But have no idea if this is it.

Any help, pointers, questions are welcome as usual. Thanks in advance.
Mehmet


_______________________________________________
gem5-users mailing list
[email protected]<mailto:[email protected]>
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users


_______________________________________________
gem5-users mailing list
[email protected]<mailto:[email protected]>
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users


_______________________________________________
gem5-users mailing list
[email protected]<mailto:[email protected]>
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users


-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://m5sim.org/cgi-bin/mailman/private/gem5-users/attachments/20130301/46284f8d/attachment.html>

------------------------------

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

End of gem5-users Digest, Vol 80, Issue 2
*****************************************
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to