#1282 absolute path input file bug

None
closed
nobody
5
2013-02-22
2012-11-12
Michel Zou
No

Hi,

By switching to cmake I noticed that swig did not build succesfully one of a multiple module if the input file command line argument was absolute.
I tried to see what happens in the argument parsing in main.cxx, and I found that an internal command file is written which looks like this:

%include <swig.swg>

%include <python.swg>
%include(maininput="<absolute_filename>") "<absolute_filename>"

Then I saw the diff and changed the include command to be:
%include(maininput="<absolute_filename>") "<filename>"

And the build was successful.
See the attached patch.

Regards.

Discussion

  • William Fulton

    William Fulton - 2012-12-07

    Thanks for the report. This patch potentially breaks other areas and I can't replicate this problem. Could you please provide details to replicate the problem.... not CMake files, but the resulting SWIG commands and error messages. Please also say what your platform is.

    I tried to replicate this by using the following makefile in Examples/python/import, which is the classic multiple module example. Perhaps you could modify to demonstrate the problem?

    TOP = /home/william/swig/git/swig
    ABSPATH = $(TOP)/Examples/python/import

    everything:
    env SWIG_LIB=$(TOP)/Lib $(TOP)/swig -python -c++ $(ABSPATH)/base.i
    g++ -c -fpic $(ABSPATH)/base_wrap.cxx -I/usr/include/python2.6 -I/usr/lib/python2.6/config -o $(ABSPATH)/base_wrap.o
    g++ -shared $(ABSPATH)/base_wrap.o -o $(ABSPATH)/_base.so
    env SWIG_LIB=$(TOP)/Lib $(TOP)/swig -python -c++ $(ABSPATH)/foo.i
    g++ -c -fpic $(ABSPATH)/foo_wrap.cxx -I/usr/include/python2.6 -I/usr/lib/python2.6/config -o $(ABSPATH)/foo_wrap.o
    g++ -shared $(ABSPATH)/foo_wrap.o -o $(ABSPATH)/_foo.so
    env SWIG_LIB=$(TOP)/Lib $(TOP)/swig -python -c++ $(ABSPATH)/bar.i
    g++ -c -fpic $(ABSPATH)/bar_wrap.cxx -I/usr/include/python2.6 -I/usr/lib/python2.6/config -o $(ABSPATH)/bar_wrap.o
    g++ -shared $(ABSPATH)/bar_wrap.o -o $(ABSPATH)/_bar.so
    env SWIG_LIB=$(TOP)/Lib $(TOP)/swig -python -c++ $(ABSPATH)/spam.i
    g++ -c -fpic $(ABSPATH)/spam_wrap.cxx -I/usr/include/python2.6 -I/usr/lib/python2.6/config -o $(ABSPATH)/spam_wrap.o
    g++ -shared $(ABSPATH)/spam_wrap.o -o $(ABSPATH)/_spam.so
    python $(ABSPATH)/runme.py

     
  • Michel Zou

    Michel Zou - 2013-02-22

    Hi,

    Works for me since 2.0.9 too.
    You can close it.

     
  • William Fulton

    William Fulton - 2013-02-22
    • status: open --> closed
    • milestone: -->
     
  • William Fulton

    William Fulton - 2013-02-22

    No longer an issue as reported.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks