Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Java code calling a Fortran DLL

OP1
New Contributor III
822 Views
I have a Fortran DLL which is used by a Fortran code; but this DLL will also be used by a Java application.

My question relates to passing character strings. Assume I have the following subroutine in my DLL:

[bash]SUBROUTINE MY_SUB(R,S,I)
!DEC$ ATTRIBUTES DLLEXPORT :: MY_SUB
REAL(8),INTENT(IN) :: R(100)
CHARACTER(24),INTENT(IN) :: S
INTEGER,INTENT(OUT) :: I
!... do some work here...
END SUBROUTINE MY_SUB
[/bash]

I do not want to change the calling convention from within the DLL, so it's just a matter of having the right interface to MY_SUB on the Java side.
Does anybody know how to handle this?

Thanks,

Olivier
0 Kudos
3 Replies
Steven_L_Intel1
Employee
822 Views
You might start with this article, written by our own Lorri Menard, back in the CVF days. The other article she links to still exists.
0 Kudos
OP1
New Contributor III
822 Views
Thanks Steve. That's a good introduction indeed.

Olivier
0 Kudos
Reply