Hello to you all,

I have trouble compiling pythonOCC on my 64 bits Fedora 9 laptop. The
default SWIG interface does not compile so I decided to start from
scratch and see if I can generate the SWIG interface and than compile
the generated code. Since more people might be interested, I started
this thread. Hopefully within a few hours/days, I have a cleanly
compiled version of pythonOCC. Stay tuned!

Some configuration information:
    Laptop IBM Thinkpad T61p (4Gb memory)
    Linux mercury 2.6.27.15-78.2.23.fc9.x86_64 #1 SMP Wed Feb 11
23:11:11 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
    Fedora 9

    gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC)
    GCC-XML version 0.9.0
    SWIG Version 1.3.33
    Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:56)
    [GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2

    OpenCascade 6.3.0
    pythonOCC svn revision 53

I managed (with some effort) to compile the OpenCascade itself from
source. The effort was mainly in properly configuring header files and
library locations. On my 64 bit system some libraries are 32 bit (in
/usr/lib) and some are 64 bit (in /usr/lib64). Default locations of
libraries are often /usr/lib, so this needed some tweaking, but it
works fine now (I might try to package it as a binary distribution if
anybody is interested).

So next is pythonOCC. The relevant part of the environment.py script
looks like this:

elif sys.platform=='linux2':
    SWIG_FILES_PATH_MODULAR =
os.path.join(os.getcwd(),'SWIG_src_modular_linux_darwin')
    os.environ['CC'] = 'g++'
    os.environ['CPP'] = 'g++'
    OCC_INC = '/opt/occ/inc'
    OCC_LIB = '/opt/occ/lib'
    GCC_XML_PATH = '/usr/local/bin'
    PYGCCXML_DEFINES =
['HAVE_CONFIG_H','HAVE_LIMITS_H','CSFDB','OCC_CONVERT_SIGNALS','LIN','LININTEL','_GNU_SOURCE=1']
    DEFINE_MACROS =
[('HAVE_CONFIG_H',None),('HAVE_LIMITS_H',None),('CSFDB',None),('OCC_CONVERT_SIGNALS',None),('LIN',None),('LININTEL',None),('_GNU_SOURCE','1')]
    SWIG_OPTS =
['-modern','-fcompact','-c++','-DHAVE_LIMITS_H','-DHAVE_CONFIG_H','-DCSFDB',\

'-DOCC_CONVERT_SIGNALS','-DLIN','-DLININTEL','-D_GNU_SOURCE=1',\
                 '-outdir','%s'%os.path.join(os.getcwd(),'OCC')]
    ECA = ['-O0']
    ELA = ['-Wl,--no-undefined']

Essentially, I only changed the locations of the OCC include/library
files. As mentioned in the beginning of this post, I try to do a
complete compile including SWIG generation so here we go:

 >>  python setup.py build -generate_swig

OK. This goes fine for a long way. At some point however, I get this
poetic error message:

INFO gccxml cmd: /usr/local/bin/gccxml  -I"." -I"/opt/occ/inc"
-D"HAVE_CONFIG_H" -D"HAVE_LIMITS_H" -D"CSFDB" -D"OCC_CONVERT_SIGNALS"
-D"LIN" -D"LININTEL" -D"_GNU_SOURCE=1"
"/home/nawijn/scratch/pythonocc/pythonOCC/src/SWIG_src_modular_linux_darwin/AdvApp2Var_Wrapper.hxx"
-fxml="/tmp/tmpoeuFG4.xml"
Traceback (most recent call last):
  File "setup.py", line 507, in <module>
    builder = SWIG_generator.ModularBuilder(module, GENERATE_DOC)
  File "/home/nawijn/scratch/pythonocc/pythonOCC/src/SWIG_generator.py",
line 202, in __init__
    self.GenerateSWIGSourceFile()
  File "/home/nawijn/scratch/pythonocc/pythonOCC/src/SWIG_generator.py",
line 260, in GenerateSWIGSourceFile
    self.BuildModule()
  File "/home/nawijn/scratch/pythonocc/pythonOCC/src/SWIG_generator.py",
line 769, in BuildModule
    include_paths=[environment.OCC_INC])
  File "/usr/lib/python2.5/site-packages/pyplusplus/module_builder/builder.py",
line 92, in __init__
    , indexing_suite_version)
  File "/usr/lib/python2.5/site-packages/pyplusplus/module_builder/builder.py",
line 146, in __parse_declarations
    decls = reader.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/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../include/c++/4.3.0/sstream:572,
                 from /opt/occ/inc/Standard_SStream.hxx:17,
                 from /opt/occ/inc/Standard_OutOfRange.hxx:33,
                 from /opt/occ/inc/TCollection_Array1.lxx:1,
                 from /opt/occ/inc/TColGeom_Array1OfSurface.hxx:158,
                 from /opt/occ/inc/TColGeom_HArray1OfSurface.hxx:34,
                 from /opt/occ/inc/AdvApp2Var_ApproxAFunc2Var.lxx:2,
                 from /opt/occ/inc/AdvApp2Var_ApproxAFunc2Var.hxx:323,
                 from
/home/nawijn/scratch/pythonocc/pythonOCC/src/SWIG_src_modular_linux_darwin/AdvApp2Var_Wrapper.hxx:16:
/usr/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../include/c++/4.3.0/bits/sstream.tcc:
In member function 'virtual typename std::basic_stringbuf<_CharT,
_Traits, _Alloc>::int_type std::basic_stringbuf<_CharT, _Traits,
_Alloc>::overflow(typename _Traits::int_type)':
/usr/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../include/c++/4.3.0/bits/sstream.tcc:115:
error: expected unqualified-id before '(' token
/usr/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../include/c++/4.3.0/bits/sstream.tcc:117:
error: expected unqualified-id before '(' token

One thing is for sure. The error is not in "sstream" itself. Outside
pythonOCC context, there is no problem.

Does anybody have a suggestion?

I will investigate this and keep you posted.

Marco

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to