SourceForge.net | 2 Apr 2010 13:48
Picon
Favicon

[ swig-Bugs-2583248 ] SWIG fails to find const& typemaps in %template expansion

Bugs item #2583248, was opened at 2009-02-10 00:25
Message generated for change (Comment added) made by wsfulton
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2583248&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: code generation (general)
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: David Piepgrass (qwertie)
Assigned to: Nobody/Anonymous (nobody)
Summary: SWIG fails to find const& typemaps in %template expansion

Initial Comment:
If SWIG is given the following code,

%typemap(ctype) SWIGTYPE*& "TESTING*&"
%typemap(ctype) const SWIGTYPE*& "const TESTING*&"
%typemap(cstype) SWIGTYPE *& "ref TESTING"
%typemap(cstype) const SWIGTYPE *& "TESTING"

class Foo{}; // optional
void Test1(const Foo*& x);

It works as it should: the const SWIGTYPE*& typemaps are used. However, if an equivalent function is
(Continue reading)

William S Fulton | 2 Apr 2010 19:29
Picon
Favicon
Gravatar

Re: SWIG and Matlab

Josef Pacula wrote:
> Hello everybody,
> I am very new to mailing lists so tell me of any customs or anything if needed.
> I am working on a very simple Matlab module for SWIG as my bachelors thesis.
> I am currently wondering how to solve Matlab MEX files need to have
> every wrapped function in a single file.
> Does any other supported language have similar API? Do you have any
> hints how to approach this?
> Or do you have any opinion on which module would be best to take derive from?
SWIG supports Octave and a Scilab module was started last year which you 
might want to look at as alternatives or for inspiration.

William

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
William S Fulton | 2 Apr 2010 19:32
Picon
Favicon
Gravatar

Re: [SPAM] How to access C Function pointers and Callback

AMIT JAIN wrote:
> Hello
> 
> I am unable to bind the C, Function pointers and callback to access in Lua.
> 
> Requirtement: I am trying to bind C [SDL] lib function pointers in Lua 
> with swig tool.
> 
> typedef int (*SDL_EventFilter)(const SDL_Event *event);
>  
> void SDL_SetEventFilter(SDL_EventFilter filter);
> 
>  
> 
> Now I want that  SDL_SetEventFilter() will take the Lua fuction as a 
> parameter and Set it as callback of type SDL_EventFilter.
> 
>  
> 
> Can anybody help me to do this??
> 
The Examples/lua/funcptr3 example might be some help.

William

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
(Continue reading)

SourceForge.net | 4 Apr 2010 22:54
Picon
Favicon

[ swig-Bugs-2981916 ] Crash: Template Name Same As Type

Bugs item #2981916, was opened at 2010-04-04 20:54
Message generated for change (Tracker Item Submitted) made by 
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2981916&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: lua
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: https://www.google.com/accounts ()
Assigned to: Mark Gossage (mgossage)
Summary: Crash: Template Name Same As Type

Initial Comment:
The following will crash swig.exe:

%template(fxGuiRect) fxHandle < fxGuiRect >;

This is because the name I selected for the template instance is the same as the type I put into the template.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2981916&group_id=1645

(Continue reading)

SourceForge.net | 6 Apr 2010 20:43
Picon
Favicon

[ swig-Bugs-2981916 ] Crash: Template Name Same As Type

Bugs item #2981916, was opened at 2010-04-04 20:54
Message generated for change (Comment added) made by wsfulton
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2981916&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: lua
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: https://www.google.com/accounts ()
Assigned to: Mark Gossage (mgossage)
Summary: Crash: Template Name Same As Type

Initial Comment:
The following will crash swig.exe:

%template(fxGuiRect) fxHandle < fxGuiRect >;

This is because the name I selected for the template instance is the same as the type I put into the template.

----------------------------------------------------------------------

>Comment By: William Fulton (wsfulton)
Date: 2010-04-06 18:43

(Continue reading)

SourceForge.net | 6 Apr 2010 21:09
Picon
Favicon

[ swig-Bugs-2975715 ] Building in separate directory fails all checks

Bugs item #2975715, was opened at 2010-03-24 06:40
Message generated for change (Comment added) made by wsfulton
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2975715&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: installation
Group: None
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: Fnordly ()
Assigned to: Nobody/Anonymous (nobody)
Summary: Building in separate directory fails all checks

Initial Comment:
I like to...

     tar xf swig-1.3.40.tar.bz2
     mkdir swig-1.3.40-build
     cd swig-1.3.40-build
     time { ../swig-1.3.40/configure &&
               make -k &&
               make -k install &&
               make -k check
               } >>../swig-1.3.40-1 2>>../swig-1.3.40-2 &
     tail -f ../swig-1.3.40-{1,2}
(Continue reading)

Nicholas Yue | 7 Apr 2010 00:59
Picon

Configuring Python3 support with swig-1.3.40

Hi,

    I have build and installed my own version of Python3 at a 
non-standard location

    /opt/python/v3.1.1

    $ls /opt/python/v3.1.1/bin
    2to3  idle3  pydoc3  python3  python3.1  python3.1-config  
python3-config

    When I tried to configure swig with the following

    $./configure --with-python3=/opt/python/v3.1.1/bin/python3

    It is still unable to find Python3 files

    --output from configure--
checking for /opt/python/v3.1.1/bin/python3-config... no
checking for python3-config... no
checking for python3.0-config... python3.0-config
checking for Python 3.x prefix... /usr
checking for Python 3.x exec-prefix... /usr
checking for Python 3.x version... python3.1
checking for Python 3.x lib dir... lib
checking for Python 3.x header files... -I/usr/include/python3.0 
-I/usr/include/python3.0
checking for Python 3.x library... Not found

    Any ideas/recommendations ?
(Continue reading)

SourceForge.net | 7 Apr 2010 07:44
Picon
Favicon

[ swig-Patches-2818499 ] [Python] Thread & Exceptions

Patches item #2818499, was opened at 2009-07-08 11:53
Message generated for change (Comment added) made by wsfulton
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=301645&aid=2818499&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Solal Jacob (vertrex)
Assigned to: Olly Betts (olly)
Summary: [Python] Thread & Exceptions

Initial Comment:
SWIG 1.3.38 

Segfault sometime happen in exceptions when I use swig with python c++ and
-threads.
I fix this enclosing %typemap(throws,noblock=1) SWIGTYPE with
SWIG_PYTHON_THREAD_BEGIN_BLOCK/END_BLOCK in typemaps/swigtype.swg exception
handling.

----------------------------------------------------------------------

>Comment By: William Fulton (wsfulton)
(Continue reading)

IGNATIUS EVANS | 9 Apr 2010 01:57

Problem converting int* in c struct to int[] in java wrapped object

I am working on a project where i am using a C library for my backend, and a java GUI for my frontend. In a header file i have the following C struct:

typedef struct
{

 PixelType type;

 int num_bands;

 int num_rows;

 int num_cols;

 int max_pix_val;

 int num_cc;

 union
 {

  byte *byte_data;

  int *int_data;

  double *double_data;

 } data_1d;

 union
 {
 
  byte *byte_data_1b;

  byte *byte_data_3b;

  int *int_data_1b;

  int *int_data_3b;

  double *double_data_1b;

  double *double_data_3b;

 } data_nd;

} Image;

The byte type has a typedef declaring it an unsigned char. All *byte, *int, and *double pointers are unbounded C arrays. I have the following in the interface file used for this header file:

%include typemaps.i
%include arrays_java.i

typedef unsigned char byte;

%apply byte[] {byte *};
%apply int[] {int *};
%apply double[] {double *};

In the data_1d file i get the following output:

public void setByte_data(short[] value) {
    zernike_momentsJNI.Image_data_1d_byte_data_set(swigCPtr, this, value);
  }

  public short[] getByte_data() {
    return zernike_momentsJNI.Image_data_1d_byte_data_get(swigCPtr, this);
  }

  public void setInt_data(int[] value) {
    zernike_momentsJNI.Image_data_1d_int_data_set(swigCPtr, this, value);
  }

  public int[] getInt_data() {
    return zernike_momentsJNI.Image_data_1d_int_data_get(swigCPtr, this);
  }

  public void setDouble_data(double[] value) {
    zernike_momentsJNI.Image_data_1d_double_data_set(swigCPtr, this, value);
  }

  public double[] getDouble_data() {
    return zernike_momentsJNI.Image_data_1d_double_data_get(swigCPtr, this);
  }

All this looks correct, but only works part of the time. Most of the time my app crashes giving me an error about a function in array_java.i:

 An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x6d24674d, pid=18669, tid=1822944176
#
# Java VM: Java HotSpot(TM) Server VM (1.5.0_06-b05 mixed mode)
# Problematic frame:
# C  [libfourier_project.so+0x2cb74d]  SWIG_JavaArrayOutUchar+0x82
#
# An error report file with more information is saved as hs_err_pid18669.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp

Can anyone point me in the right direction on how to wrap these arrays correctly using SWIG where my app doesn't crash. I have extensively tested my solution, and haven't noticed any patterns that make my app crash. It seems to randomly crash, and i have to present my work soon. Can anyone help me??????????????????????????????????




------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
SourceForge.net | 10 Apr 2010 00:00
Picon
Favicon

[ swig-Bugs-2887254 ] SWIG_Lua_typename uses the wrong stack index

Bugs item #2887254, was opened at 2009-10-27 15:41
Message generated for change (Comment added) made by wsfulton
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2887254&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: lua
Group: None
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: https://www.google.com/accounts ()
>Assigned to: William Fulton (wsfulton)
Summary: SWIG_Lua_typename uses the wrong stack index

Initial Comment:
The SWIG generated function "SWIG_Lua_typename" is using the wrong stack index when retrieving userdata
from the Lua runtime.  The following line (luarun.swg ~line 669) attempts to convert index 1 to a userdata.

    usr=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */

This will only work if the requested object is on top of the stack. Since you pass in the index, this should read:

    usr=(swig_lua_userdata*)lua_touserdata(L,tp);  /* get data */

----------------------------------------------------------------------

>Comment By: William Fulton (wsfulton)
Date: 2010-04-09 22:00

Message:
Duplicate to 2946032.
Applied fix for swig-2.0.0.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2887254&group_id=1645

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

Gmane