swiginac

Mark Brethen mark.brethen at gmail.com
Sat Nov 14 07:57:34 PST 2015


> On Nov 14, 2015, at 1:38 AM, Joshua Root <jmr at macports.org> wrote:
> 
> On 2015-11-14 17:54 , Mark Brethen wrote:
>> 
>> :debug:build Assembled command: 'cd "/opt/local/var/macports/build/_Users_marbre_ports_python_py-swiginac/py27-swiginac/work/swiginac-1.5.1.1" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build'
>> :debug:build Executing command line:  cd "/opt/local/var/macports/build/_Users_marbre_ports_python_py-swiginac/py27-swiginac/work/swiginac-1.5.1.1" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build 
>> :info:build running build
>> :info:build running build_py
>> :info:build file swiginac.py (for module swiginac) not found
>> :info:build file swiginac.py (for module swiginac) not found
>> :info:build running build_ext
>> :info:build building '_swiginac' extension
>> :info:build swigging swiginac.i to swiginac_wrap.c
>> :info:build swig -python -o swiginac_wrap.c swiginac.i
>> :info:build /opt/local/share/swig/3.0.7/python/std_common.i:73: Error: Syntax error in input(1).
>> :info:build error: command 'swig' failed with exit status 1
>> :info:build Command failed:  cd "/opt/local/var/macports/build/_Users_marbre_ports_python_py-swiginac/py27-swiginac/work/swiginac-1.5.1.1" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build 
> 
> Looks like the setup.py is working fine, but the interface files
> themselves are not compatible with the current versions of swig. There
> may be some command line options that can be added to make swig behave
> like older versions in whatever respect is needed, or the interfaces may
> just need to be updated (which is the correct long-term solution).
> 
> - Josh

This works:

$ swig -v -python -c++ -o swiginac_wrap.c swiginac.i
Language subdirectory: python
Search paths:
   ./
   ./swig_lib/python/
   /opt/local/share/swig/3.0.7/python/
   ./swig_lib/
   /opt/local/share/swig/3.0.7/
Preprocessing...
Starting language-specific parse...
Processing types...
C++ analysis...
Processing nested classes...
Generating wrappers...


In setup.py I found these lines:


# The command line argument for running swig in c++ mode has changed from
# Python 2.3 to 2.4. We support both.
swig_opt = '--swig-cpp'
if distutils.__version__ >= '2.4': swig_opt = '--swig-opts=-c++'

if argv[1] == 'build':
    argv[1] = 'build_ext'
if argv[1] == 'build_ext':
    argv.insert(2, swig_opt)

    
It should be adding ‘-c++’ to the swig command, but for some reason it is not:


:debug:build Assembled command: 'cd "/opt/local/var/macports/build/_Users_marbre_ports_python_py-swiginac/py27-swiginac/work/swiginac-1.5.1.1" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build'
:debug:build Executing command line:  cd "/opt/local/var/macports/build/_Users_marbre_ports_python_py-swiginac/py27-swiginac/work/swiginac-1.5.1.1" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build 
:info:build running build
:info:build running build_py
:info:build file swiginac.py (for module swiginac) not found
:info:build file swiginac.py (for module swiginac) not found
:info:build running build_ext
:info:build building '_swiginac' extension
:info:build swigging swiginac.i to swiginac_wrap.c
:info:build swig -python -o swiginac_wrap.c swiginac.i



Mark






More information about the macports-dev mailing list