I would use `Cint` as type, not `Int64`, as in `Ptr{Cint}`. Are you sure
that your Fortran code uses 64-bit integers? Technically, this violates the
Fortran standard. A Fortran integer is the same as a C int, except if you
use special flags while building the Fortran library (which you might be
doing).You can use `Ref` instead of one-element arrays. Your error message has nothing to do with arrays vs. pointer, but rather the mismatch between `Float64` and `Int64`. -erik On Mon, Jun 6, 2016 at 6:07 AM, Páll Haraldsson <[email protected]> wrote: > On Monday, June 6, 2016 at 3:22:47 AM UTC, Charles Ll wrote: >> >> Dear all, >> >> I am trying to call some Fortran code in Julia, but I have a hard time >> doing so... I have read the docs, looked at the wrapping of ARPACK and >> other libraries... But I did not find any way to make it work. >> >> I am trying to wrap a spline function library (gcvspl.f, >> https://github.com/charlesll/Spectra.jl/tree/master/Dependencies), which >> I want to use in my project, Spectra.jl. >> >> I already have a wrapper in Python, but this was easier to wrap with >> using f2py. In Julia, I understand that I have to do it properly. The >> function I am trying to call is: >> > > I think, you may already have gotten the correct answer. At first I was > expecting fcall, not just ccall keyword in Julia, to call Fortran.. It's > not strictly needed, but in fact, there is an issue somewhere still open > about fcall (keyword, or was if for a function?), and it may have been for > your situation.. > > > [It might not be too helpful to know, you can call Python with PyCall.jl, > so if you've already wrapped in Python..] > > -- > Palli. > > > -- Erik Schnetter <[email protected]> http://www.perimeterinstitute.ca/personal/eschnetter/
