I get the same error on OS X 10.8.2 with SWIG 2.0.9 for both Python 2.7.3
and 2.7.2.

Anthony Gutierrez
http://web.eecs.umich.edu/~atgutier


On Wed, Mar 13, 2013 at 4:12 PM, Andreas Sandberg <[email protected]>wrote:

> It's probably some weird interaction with the version of Python we are
> running in that case. We're on Python 2.6.6 on that cluster. Which versions
> have you tried with SWIG 2.0.9?
>
> Since the bug has been reported by others on the SWIG bug tracker, it's
> definitely affecting other projects. We should probably at least add a
> warning in case of that SWIG version, I've already wasted the better part
> of a day trying to track it down.
>
> //Andreas
>
>
> On 03/13/2013 06:10 PM, Andreas Hansson wrote:
>
>> It works fine on OSX and FC Rawhide using swig 2.0.9 (and yes they do have
>> the fully qualified package names).
>>
>> Andreas
>>
>> On 13/03/2013 16:34, "Andreas Sandberg" <[email protected]> wrote:
>>
>>  Hi Everyone,
>>>
>>> I just tried to compile gem5 on our cluster and got a really the
>>> following error when starting gem5:
>>>
>>> Traceback (most recent call last):
>>>    File "<string>", line 1, in <module>
>>>    File "/bubo/home/h24/ansan501/**workspace/gem5/src/python/**
>>> importer.py",
>>> line 75, in load_module
>>>      exec code in mod.__dict__
>>>    File
>>> "/bubo/home/h24/ansan501/**workspace/gem5/src/python/m5/_**_init__.py",
>>> line
>>> 35, in <module>
>>>      import internal
>>>    File "/bubo/home/h24/ansan501/**workspace/gem5/src/python/**
>>> importer.py",
>>> line 75, in load_module
>>>      exec code in mod.__dict__
>>>    File
>>> "/bubo/home/h24/ansan501/**workspace/gem5/src/python/m5/**
>>> internal/__init__.py
>>> ",
>>> line 32, in <module>
>>>      import event
>>>    File "/bubo/home/h24/ansan501/**workspace/gem5/src/python/**
>>> importer.py",
>>> line 75, in load_module
>>>      exec code in mod.__dict__
>>>    File
>>> "/bubo/home/h24/ansan501/**workspace/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 believe this is because of a bug [1] introduced in SWIG 2.0.9. The
>>> problem is that the Python code generated by SWIG contains in this
>>> version uses fully qualified package names, which causes problems when
>>> there are dependencies between modules in the same package.
>>> Specifically, when __init__ in m5.internal imports event, event tries to
>>> load m5.internal.serialize. What seems to happen at this point is that
>>> serialize isn't added to m5.internal's dictionary, which means that
>>> m5.serialize.Serializable can't be resolved. However, 'import serialize'
>>> or 'import Serializable from m5.internal.serialize' works as expected
>>> (SWIG prior to version 2.0.9 did the former).
>>>
>>> Unless there are any objections, I'd like to add a check in the scons
>>> configuration and produce an error if someone tries to build gem5 with
>>> this version. Is everyone OK with this?
>>>
>>> //Andreas
>>>
>>> [1] 
>>> http://sourceforge.net/p/swig/**bugs/1297/<http://sourceforge.net/p/swig/bugs/1297/>
>>> ______________________________**_________________
>>> gem5-dev mailing list
>>> [email protected]
>>> http://m5sim.org/mailman/**listinfo/gem5-dev<http://m5sim.org/mailman/listinfo/gem5-dev>
>>>
>>>
>>
>> -- 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.
>>
>> ______________________________**_________________
>> gem5-dev mailing list
>> [email protected]
>> http://m5sim.org/mailman/**listinfo/gem5-dev<http://m5sim.org/mailman/listinfo/gem5-dev>
>>
>>
> ______________________________**_________________
> gem5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/**listinfo/gem5-dev<http://m5sim.org/mailman/listinfo/gem5-dev>
>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to