Thanks William. I'll give it a try with -small option. I included only the files i needed since these files has go to many class definitions it turning out to be a huge file.
I tried generating source code using multiple interface files but swig is generating perl module for every interface file. This results in creating a separate shared library for every perl module as these defintions are found based on the name used in DynaLoader of the perl module. I am expermenting different way to generate multiple perl modules but i want one shared library at the end.
I'll keep you posted.
--- On Wed, 7/23/08, William S Fulton <wsf@...> wrote:
From: William S Fulton <wsf@...>
Subject: Re: [Swig-user] SWIG generated file C++ is huge and compiler fails to compile
Date: Wednesday, July 23, 2008, 3:54 AM
sunil kumar wrote:
> I am generating SWIG C++ file using interface file and the
> auto-generated C++ file size is greater than 18MB and source lines in
> the files is 529374. When compiler tries to compile this huge file, it
> throws the following error
> SMILSWIG.cpp: In function `(static initializers for SMILSWIG.cpp)':
> SMILSWIG.cpp:529374: internal compiler error: in final_scan_insn, at
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See < URL:http://bugzilla.redhat.com/bugzilla
> <url:http:%2F%2Fbugzilla.redhat.com%2Fbugzilla>> for
> I can't split my SWIG interface file into two and generate two
> c++ files because I am going to have one shared library with two perl
> So, i need a way to generate one SWIG perl module and multiple SWIG C++
> files (which will be lesser in file size and source code lines) using
> one interface file. This way I can use multiple generated SWIG C++ files
> to build the shared library.
> Please do let me know how to go about resovling this issue. I really
> appreciate your help.
You could try reduce the amount of generated code using -small. If the
code is still too big, consider removing wrapper methods/classes that
you don't really need, eg through use of %ignore or just %include the
files you absolutely need. Otherwise you'll need to invoke SWIG multiple
times on different interface files and use %import, then compile the
resulting wrapper files into either one or more shared objects, although
I'm not entirely sure if you can compile multiple wrapper files into one
shared object for Perl.
This SF.Net email is sponsored by the Moblin Your Move Developer's
Build the coolest Linux based applications with Moblin SDK & win great
Grand prize is a trip for two to an Open Source event anywhere in the world
Swig-user mailing list