f2py: "could not crack entity declaration"

I decided to give wrapping this code a try:
http://morrislab.med.utoronto.ca/~dwf/GLMnet.f90
I'm afraid my Fortran skills are fairly limited, but I do know that gfortran compiles it fine. f2py run on this file produces lots of errors of the form,
Reading fortran codes... Reading file 'GLMnet.f90' (format:fix) Line #263 in GLMnet.f90:" real x(no,ni),y(no),w(no),vp(ni),ca(nx,nlam) 353" updatevars: could not crack entity declaration "ca(nx,nlam)353". Ignoring. Line #264 in GLMnet.f90:" real ulam(nlam),a0(nlam),rsq(nlam),alm(nlam) 354" updatevars: could not crack entity declaration "alm(nlam)354". Ignoring. Line #265 in GLMnet.f90:" integer jd(*),ia(nx),nin(nlam) 355" updatevars: could not crack entity declaration "nin(nlam)355". Ignoring. Line #289 in GLMnet.f90:" real x(no,ni),y(no),w(no),vp(ni),ulam(nlam) 378" updatevars: could not crack entity declaration "ulam(nlam)378". Ignoring. Line #290 in GLMnet.f90:" real ca(nx,nlam),a0(nlam),rsq(nlam),alm(nlam) 379" updatevars: could not crack entity declaration "alm(nlam)379". Ignoring. Line #291 in GLMnet.f90:" integer jd(*),ia(nx),nin(nlam) 380" updatevars: could not crack entity declaration "nin(nlam)380". Ignoring. Line #306 in GLMnet.f90:" call chkvars(no,ni,x,ju) 392" analyzeline: No name/args pattern found for li
Is it the numbers that it is objecting to (I'm assuming these are some sort of punchcard thing)? Do I need to modify the code in some way to make it f2py-friendly?
Thanks,
David

Try renaming GLMnet.f90 to GLMnet.f. HTH, Pearu
David Warde-Farley wrote:
I decided to give wrapping this code a try:
http://morrislab.med.utoronto.ca/~dwf/GLMnet.f90
I'm afraid my Fortran skills are fairly limited, but I do know that gfortran compiles it fine. f2py run on this file produces lots of errors of the form,
Reading fortran codes... Reading file 'GLMnet.f90' (format:fix) Line #263 in GLMnet.f90:" real x(no,ni),y(no),w(no),vp(ni),ca(nx,nlam) 353" updatevars: could not crack entity declaration "ca(nx,nlam)353". Ignoring. Line #264 in GLMnet.f90:" real ulam(nlam),a0(nlam),rsq(nlam),alm(nlam) 354" updatevars: could not crack entity declaration "alm(nlam)354". Ignoring. Line #265 in GLMnet.f90:" integer jd(*),ia(nx),nin(nlam) 355" updatevars: could not crack entity declaration "nin(nlam)355". Ignoring. Line #289 in GLMnet.f90:" real x(no,ni),y(no),w(no),vp(ni),ulam(nlam) 378" updatevars: could not crack entity declaration "ulam(nlam)378". Ignoring. Line #290 in GLMnet.f90:" real ca(nx,nlam),a0(nlam),rsq(nlam),alm(nlam) 379" updatevars: could not crack entity declaration "alm(nlam)379". Ignoring. Line #291 in GLMnet.f90:" integer jd(*),ia(nx),nin(nlam) 380" updatevars: could not crack entity declaration "nin(nlam)380". Ignoring. Line #306 in GLMnet.f90:" call chkvars(no,ni,x,ju) 392" analyzeline: No name/args pattern found for li
Is it the numbers that it is objecting to (I'm assuming these are some sort of punchcard thing)? Do I need to modify the code in some way to make it f2py-friendly?
Thanks,
David _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

On Thu, Mar 25, 2010 at 6:25 PM, David Warde-Farley dwf@cs.toronto.eduwrote:
I decided to give wrapping this code a try:
http://morrislab.med.utoronto.ca/~dwf/GLMnet.f90
I have a working f2py wrapper located at:
http://code.google.com/p/glu-genetics/source/browse/trunk/glu/lib/glm/glmnet...
I've only used some of the basic functionality, so there may be a few rough edges.
-Kevin

On 26-Mar-10, at 8:08 AM, Kevin Jacobs wrote:
On Thu, Mar 25, 2010 at 6:25 PM, David Warde-Farley <dwf@cs.toronto.edu
wrote:
I decided to give wrapping this code a try:
http://morrislab.med.utoronto.ca/~dwf/GLMnet.f90
I have a working f2py wrapper located at:
http://code.google.com/p/glu-genetics/source/browse/trunk/glu/lib/glm/glmnet...
Thanks Kevin. Part of it was as an exercise to arse myself to learn how to use f2py, but it's good to have some reference :) That said, I gave that wrapper a whirl and it crashed on me...
I noticed you added an 'njd' argument to the wrapper for elnet, did you modify the elnet Fortran function at all? Is it fine to have arguments in the wrapped version that don't directly correspond to the raw fortran version?
Thanks,
David

On 26-Mar-10, at 4:25 PM, David Warde-Farley wrote:
That said, I gave that wrapper a whirl and it crashed on me...
I noticed you added an 'njd' argument to the wrapper for elnet, did you modify the elnet Fortran function at all? Is it fine to have arguments in the wrapped version that don't directly correspond to the raw fortran version?
D'oh, nevermind. I looked in your repository and it's a different version of glmnet.f than the one I have.
David

On Fri, Mar 26, 2010 at 7:07 PM, David Warde-Farley dwf@cs.toronto.eduwrote:
On 26-Mar-10, at 4:25 PM, David Warde-Farley wrote:
That said, I gave that wrapper a whirl and it crashed on me...
I noticed you added an 'njd' argument to the wrapper for elnet, did you modify the elnet Fortran function at all? Is it fine to have arguments in the wrapped version that don't directly correspond to the raw fortran version?
D'oh, nevermind. I looked in your repository and it's a different version of glmnet.f than the one I have.
My apologies-- I'd forgotten that I had modified the Fortran code to simplify the wrappers. Hopefully it was still of use to you.
-Kevin
participants (3)
-
David Warde-Farley
-
Kevin Jacobs <jacobs@bioinformed.com>
-
Pearu Peterson