Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Calling Fortran From Java (without a middle man)

Thread view: 
hswerdfe - 02 May 2007 17:50 GMT
I am trying to call some fortran routines from Java as of now the native
platform I am using is Win32.

All the tutorials I find Either focus on Calling C/C++ from Java or
Fortran from C/C++ or Fortran -> C -> Java

examples:
http://www.aei.mpg.de/~jthorn/c2f.html
http://www.caip.rutgers.edu/~vincentm/JNI/jni2f.html
http://www.math.ucla.edu/~anderson/JAVAclass/JavaInterface/JavaInterface.html
http://www.inonit.com/cygwin/jni/helloWorld/load.html

Is there a way to cut out the middle man?
and just call The fortran directly?

Thanks in Advance.

howie
a24900@googlemail.com - 02 May 2007 19:03 GMT
> Is there a way to cut out the middle man?
> and just call The fortran directly?

That would require to have a fortran compiler with a compatible
calling convention and certain extensions allowing to make us of the
dynamic memory management used by the JNI C API.  Your chances to find
something like this are slim. Your best bet would be g77 in
combination with gcj, and changing to the GNU's non-standard CNI
calling interface.

Alternatively, try another middleman. E.g. JNative, JNA, Nlink, jawin,
j-interop, JNIEasy, J/Direct, NoodleGlue, JNIWrapper, SWIG or whatever
is currently on the market (talk about re-inventing the wheel ...).
Some of these tools might be dead these days.

These are tools made to avoid having to write C/C++ JNI wrapper code
when calling existing functions. Either by generating the code for
you, or by providing a dynamic invocation interface. You could try to
build your fortran code into a DLL and then try to invoke fortran
functions in the DLL by using one of these tools.

Be warned, however. JNI is not very fast, an dynamically invoking
function via some tool and JNI is even slower.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.