Right, that should certainly work, but having a and b as scalars and using the & syntax should also.
On Wed, Feb 11, 2015 at 6:50 PM, Dominique Orban <[email protected]> wrote: > This works for me: > > > a = Cdouble[100.0] > b = Cdouble[10.0] > c = Cdouble[1.0] > ppmm = ccall((:multiply_, "fsbrtn"), Void, > (Ptr{Float64},Ptr{Float64},Ptr{Float64}),a,b,c) > println(c[1]) > > > > > On Wednesday, February 11, 2015 at 12:45:57 PM UTC-5, DP wrote: >> >> Trying to work with subroutines (I am a MATLAB person without fortran and >> julia knowledge) >> >> File Name : fsbrtn.f90 >> >> SUBROUTINE MULTIPLY(A,B,C) >> DOUBLE PRECISION A,B,C >> C = A*B >> RETURN >> END >> >> gfortran -shared -O2 fsbrtn.f90 -fPIC -o fsbrtn.so >> >> a = 100.0 >> b = 10.0 >> c = 1.0 >> ppmm = ccall((:multiply_, "/home/juser/ManUTD/fortran_try/fsbrtn"), >> Void,(Ptr{Float64},Ptr{Float64},Ptr{Float64}),&a,&b,c) >> println(c) >> >> Output >> 1.0 >> >> Where am I going wrong? >> >> >> ergerg >> >
