[CIG-SHORT] SWIG

Birendra jha bjha7333 at yahoo.com
Mon Apr 16 09:14:03 PDT 2012


Hi Brad,

Below you said "SWIG will only be used if you build from the svn repository." 

1. Is there any way I can modify few things in Makefile.am to enable SWIG if I used the pylith installer and not svn? For example pylith-1.6.3/modulesrc/problems/Makefile.am has:

if ENABLE_SWIG
$(srcdir)/problems_wrap.cxx $(srcdir)/problems.py: $(swig_sources)
	$(SWIG) -Wall -c++ -python $<
endif

which is the command I would like to run, I believe. 

And in build/pylith/Makefile.am enable-swig is commented out:

#am__append_2 = --enable-swig
...
#am__append_8 = --enable-swig

I ran the installer configure with --enable-swig but I guess that was just for installing it, not setting it up to run every time something changes in modulesrc folder.

2. Can I just run it manually? I tried:
user at ubuntu:~/build/pylith/pylith-1.6.3/modulesrc/problems$ swig -Wall -c++ -python problems.i
This generates problems.py and problems_wrap.cxx (although it says Version 2.0.2 on the top, not 2.0.4 which was on the SWIG version in the original problems.py and _wrap.cxx). Giving all *.i files above gave error. 

I am just reluctant to reinstall everything from svn which you say will setup swig to run automatically. I have already spent quite some time on the code that I installed using installer.

Thanks
Birendra

--- On Fri, 4/6/12, Brad Aagaard <baagaard at usgs.gov> wrote:

> From: Brad Aagaard <baagaard at usgs.gov>
> Subject: Re: Pylith install eror
> To: "Birendra jha" <bjha7333 at yahoo.com>
> Cc: cig-short at geodynamics.org
> Date: Friday, April 6, 2012, 12:36 AM
> On 04/05/2012 11:04 AM, Birendra jha
> wrote:
> > If we install pylith using the pylith installer, can we
> still count
> > on GNU autotools to run? I see that my changes in
> Makefile.am does
> > not get transferred to Makefile.in. Editing Makefile.in
> manually
> > works fine but is errorprone.
> 
> If I edit Makefile.am in the source tree for the tarball
> (pylith-1.6.3), then my Makefile in pylith-build is
> regenerated. Can you describe in more detail what you are
> doing and what doesn't work?
> 
> > Earlier when we installed without the installer, I
> think we ran
> > autoreconf which started the autotools? not sure.
> 
> This just generates the configure script from configure.ac.
> The PyLith source tarball already includes the configure
> script so running autoreconf is not needed. If you build
> from svn, then the pylith installer runs autoreconf to
> generate the configure script from configure.ac.
> 
> > Another question: What do we have to do for swig to run
> automatically
> > whenever a new module is being created with its py, i,
> cc, hh files?
> > Although I configured pylith install with enable-swig,
> I didn't get
> > swig to generate new problems_wrap.cxx and problems.py
> in
> > modulesrc/problems. Running swig manually does it but
> it is
> > errorprone. This thing also used to happen when we
> installed from the
> > svn. How can I enable this now?
> 
> The PyLith source tarball includes the swig .i and _wrap C++
> files, so SWIG is ignored. SWIG will only be used if you
> build from the svn repository. I verified that if I touch a
> .i file in the source directory, then this triggers SWIG to
> run and the module is rebuilt.
> 
> If you are creating custom Python modules in modulesrc, then
> you should use the SVN repository. The current stable
> version is in
> branches/v1.6-stable
> 
> Regards,
> Brad
> 


More information about the CIG-SHORT mailing list