The julia code:
!f90tojl.f90
module m
contains
integer function five()
five = 5
end function five
end module m
The corresponding julia code:
#test.jl
println(ccall( (:__m_MOD_five, "f90tojl"), Int, () ))
The test command and the result: (test is the directory, not a command)
➜ test gfortran -shared -fpic f90tojl.f90 -o f90tojl.so
➜ test julia test.jl
5
➜ test ifort -shared -fpic f90tojl.f90 -o f90tojl.so
➜ test julia test.jl
ERROR: LoadError: ccall: could not find function __m_MOD_five in library
f90tojl
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 /home/chen/test/test.jl, in expression starting on line 1