The arguments don't get written in a tuple. This should work:
ccall(("__a1_MOD_teste","./a1.o"), Void, (Int64,), b)
On Wednesday, August 10, 2016 at 11:09:32 AM UTC-4, Abimael Jr wrote:
>
>
> Hello Julia's fans
>
> I am starting studing Julia. As I have some code in Fortran, I really
> interested in the ccall function to call some specialized code in Fortran.
>
> I wrote a simple function inside a module to do some tests passing a
> parameter to receive a value from a Fortran value.
>
> The Fortran Code is on the file a1.f90 attached
>
> I compile using gfortran :
>
> gfortran a1.f90 -o a1.o -fPIC -shared
>
> For the tests, I created a very simple Julia file test.jl, attached.
> the module a1.o is on the same directory of test.jl.
>
> I invoke using julia test.jl and got error message :
>
> julia test.jl
> +---------------------+
>
> Teste 2: chamando subrotina teste recebendo o resultado no parĂ¢metro b :
> ERROR: LoadError: MethodError: `convert` has no method matching
> convert(::Type{Int64}, ::Tuple{Int64})
> This may have arisen from a call to the constructor Int64(...),
> since type constructors fall back to convert methods.
> Closest candidates are:
> call{T}(::Type{T}, ::Any)
> convert(::Type{Int64}, !Matched::Int8)
> convert(::Type{Int64}, !Matched::UInt8)
> ...
> in anonymous at no file
> in include at ./boot.jl:261
> in include_from_node1 at ./loading.jl:320
> in process_options at ./client.jl:280
> in _start at ./client.jl:378
> while loading
> /discolocal/abimael/simulacoes/testes/julia/workspace/fortran/test.jl, in
> expression starting on line 6
>
>
> I write this post asking you for help because I did several changes,
> trying to figure out what is wrong, but unfortunely I am not able to find a
> solution.
> I had changed the type of the parameter in the fortran code, but it does
> not work.
>
> It seems that I am passing parameter wrongly, but by the information of
> ccall, I should pass using tuples.
>
> So,please where am I wrong or doing wrong ?
> Thanks in advance
>
>
>
>
>
>
>