Bug 878

Summary: ./waf --python-scan fails
Product: ns-3 Reporter: Mathieu Lacage <mathieu.lacage>
Component: python bindingsAssignee: ns-bugs <ns-bugs>
Status: RESOLVED INVALID    
Severity: normal CC: gjcarneiro, jpelkey
Priority: P5    
Version: pre-release   
Hardware: All   
OS: All   

Description Mathieu Lacage 2010-04-16 02:02:36 UTC
I have re-installed everything as outlined in http://www.nsnam.org/wiki/index.php/NS-3_Python_Bindings

but I still get this --python-scan error:

INFO gccxml cmd: /usr/bin/gccxml  --gccxml-cxxflags '-m32'   -I"." -I"/home/mlacage/code/ns-3-dev/build/debug/"   "/home/mlacage/code/ns-3-dev/build/debug/bindings/python/everything.h" -fxml="/tmp/tmpOVjYZr.xml"
Traceback (most recent call last):
  File "/home/mlacage/code/ns-3-dev/bindings/python/ns3modulescan.py", line 320, in <module>
    ns3_module_scan(sys.argv[1], sys.argv[3], sys.argv[2], sys.argv[4])
  File "/home/mlacage/code/ns-3-dev/bindings/python/ns3modulescan.py", line 302, in ns3_module_scan
    gccxml_options=gccxml_options)
  File "/home/mlacage/code/pybindgen/pybindgen/gccxmlparser.py", line 683, in parse_init
    self.declarations = parser.parse(header_files, self.gccxml_config)
  File "/usr/lib/python2.5/site-packages/pygccxml/parser/__init__.py", line 50, in parse
    answer = parser.read_files(files, compilation_mode)
  File "/usr/lib/python2.5/site-packages/pygccxml/parser/project_reader.py", line 225, in read_files
    return self.__parse_file_by_file(files)
  File "/usr/lib/python2.5/site-packages/pygccxml/parser/project_reader.py", line 250, in __parse_file_by_file
    decls = reader.read_file( header )
  File "/usr/lib/python2.5/site-packages/pygccxml/parser/source_reader.py", line 197, in read_file
    return self.read_gccxml_file( source_file )
  File "/usr/lib/python2.5/site-packages/pygccxml/parser/source_reader.py", line 224, in read_gccxml_file
    raise error
pygccxml.parser.source_reader.gccxml_runtime_error_t: Error occured while running GCC-XML: In file included from /usr/include/features.h:359,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/x86_64-redhat-linux/32/bits/os_defines.h:44,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/x86_64-redhat-linux/32/bits/c++config.h:40,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/stl_algobase.h:65,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/vector:66,
                 from /home/mlacage/code/ns-3-dev/build/debug/ns3/wifi-remote-station-manager.h:23,
                 from /home/mlacage/code/ns-3-dev/build/debug/ns3/arf-wifi-manager.h:23,
                 from /home/mlacage/code/ns-3-dev/build/debug/ns3/aarf-wifi-manager.h:23,
                 from /home/mlacage/code/ns-3-dev/build/debug/bindings/python/everything.h:9:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
Comment 1 Gustavo J. A. M. Carneiro 2010-04-16 06:30:35 UTC
Sounds like a system installation problem?  Your system headers do not appear to support compilation with -m32 very well. -m32 is used as a flag to make a 64-bit system scan headers pretending to be a 32-bit system.
Comment 2 Mathieu Lacage 2010-04-17 02:05:35 UTC
I get supposedly the same errors on a stock fc12 box.
Comment 3 Gustavo J. A. M. Carneiro 2010-04-17 13:03:59 UTC
Let's check if plain g++ has the same problem.  First try to parse the header normally:

   g++ -I build/debug/ -I /usr/include/python2.6  build/debug/bindings/python/everything.h 

If it works, add -m32 and try again:

   g++ -m32 -I build/debug/ -I /usr/include/python2.6  build/debug/bindings/python/everything.h

Do you reproduce the compiler error that GCC-XML reports?
Comment 4 Josh Pelkey 2010-04-18 14:55:24 UTC
python scan worked for me on my 64-bit machine, most recent ns-3-dev: a597d6d2da85
Comment 5 Josh Pelkey 2010-04-21 12:52:48 UTC
I am closing this invalid now.  I haven't gotten it to fail yet.