[SciPy-user] f2py: Adding F_WRAPPEDFUNC to*module.c without actually wrapping a function

Berthold "Höllmann" berthold.hoellmann@gl-group....
Mon Nov 17 03:18:33 CST 2008

I am wrapping some LAPACK routines currently not handled in
scipy.linalg. some of them require workspace. In order to provide the
optimal workspace i wrote some helper routines taking the FORTRAN code
for calculating the optimal workspace and translating them C, e.g.::

static int dsytrf_lwork(int n, char uplo) {
  int one = 1;
  int name_len = 6;
  int opts_len = 1;
  int none = -1;
  int nb;
  (*F_WRAPPEDFUNC(ilaenv,ILAENV))(&nb, &one, "DSYTRF", &uplo, &n, &none, &none, &none, name_len, opts_len);
  return (n*nb);

and then in the wraper code for dsytrf::

     integer intent(hide), depend(n, uplo) :: lwork = dsytrf_lwork(n, *uplo)

This requires the function wrapper for the FORTRAN ilaenv function::

extern void F_WRAPPEDFUNC(ilaenv,ILAENV)(int*,int*,string,string,int*,int*,int*,int*,size_t,size_t);

Now my code only works when I also wrap the ilanev function (or, I
guess, any other function), otherwise the F_WRAPPEDFUNC is missing in
the generated code. Is there a way to get the F_WRAPPEDFUNC macro to the
wrapper code without wrapping a function? the ilanev function should not
become part of the interface, nor is there any other function that should.

Kind regards

Berthold Höllmann
Germanischer Lloyd AG
CAE Development
Vorsetzen 35
20459 Hamburg
Phone: +49(0)40 36149-7374
Fax: +49(0)40 36149-7320
e-mail: berthold.hoellmann@gl-group.com
Internet: http://www.gl-group.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20081117/18dfc91f/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: disclaimer.txt
Type: application/octet-stream
Size: 2196 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20081117/18dfc91f/attachment.obj 

More information about the SciPy-user mailing list