Hey guys,
  FYI: I haven't been able to fix this issue, but I've worked around it by
reverting my Python version to 2.6.6.

  The only thing I can find that might be causing this is the recent change
to using python-config (http://repo.gem5.org/gem5/rev/9265bcff11b7).  It
returns slightly different LDFLAG settings with the different versions,
though I'm not sure why the differences should matter.  I also ensured
correct environment variable settings for PATH, LD_LIBRARY_PATH,
LIBRARY_PATH and PYTHON_PATH.  python-config output:

[hestness@clover-01] (30)$ python --version
Python 2.6.6
[hestness@clover-01] (31)$ python-config --ldflags
-lpthread -ldl -lutil -lm -lpython2.6
[hestness@clover-01] (32)$ /s/python-2.7.3/bin/python --version
Python 2.7.3
[hestness@clover-01] (33)$ /s/python-2.7.3/bin/python-config --ldflags
-lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic

  For completeness, I've tried this with Python 2.7.2, 2.7.3, gcc/g++
4.4.7, swig 2.0.4, scons 2.0.1.

  I don't have time right now to dig more deeply to figure out what was
wrong, but I figured it should be recorded in case someone else runs across
the issue.

  Joel


On Mon, Sep 23, 2013 at 10:57 AM, Joel Hestness <[email protected]>wrote:

> Hey guys,
>   I'm running into a strange issue trying to run the current gem5 mainline
> repo on our cluster machines. After building with a few different revisions
> of Python 2.7, I get the following Python error from gem5:
>
> ---------------------------
> [joel@vein] (30)$ ../../../build/MOESI_hammer/gem5.opt
> Traceback (most recent call last):
>   File "/home/joel/research/gem5/gem5-gpu/gem5/src/python/importer.py",
> line 93, in <module>
>     sys.meta_path.append(importer)
> TypeError: 'dict' object is not callable
> Segmentation fault (core dumped)
> ---------------------------
>
>   The code just before this in importer.py simply imports sys as in many
> other parts of the codebase:
>
> ---------------------------
> # Create an importer and add it to the meta_path so future imports can
> # use it.  There's currently nothing in the importer, but calls to
> # add_module can be used to add code.
> import sys
> importer = CodeImporter()
> add_module = importer.add_module
> sys.meta_path.append(importer)
> ---------------------------
>
>   From what I can tell, the sys library is failing to import: after the
> import line, sys is a bool with value = False.  I think Python then assumes
> sys.meta_path is a dict instead of a list, which is triggering this error.
>
>   I've tried the following with the different revisions of Python 2.7, but
> the interpreter isn't having problems with this import, which suggests my
> Python installations are okay:
>
> ---------------------------
> [joel@vein] (31)$ python
> Python 2.7.3 (default, Jun 20 2012, 15:33:51)
> [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import sys
> >>> print sys.meta_path
> []
> ---------------------------
>
>   I'm also unable to get gem5 to run in the Python interpreter mode, since
> this happens during finalizing of Python setup.  I don't see anything
> suspicious when running gem5 in gdb, but then, I'm not really sure what I
> should be looking for.
>
>   Any ideas for what I should do/try?
>
>   Thanks!
>   Joel
>
>
> --
>   Joel Hestness
>   PhD Student, Computer Architecture
>   Dept. of Computer Science, University of Wisconsin - Madison
>   http://pages.cs.wisc.edu/~hestness/
>



-- 
  Joel Hestness
  PhD Student, Computer Architecture
  Dept. of Computer Science, University of Wisconsin - Madison
  http://pages.cs.wisc.edu/~hestness/
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to