Calling Fortran From Java (without a middle man)

Discussion in 'Java' started by hswerdfe, May 2, 2007.

  1. hswerdfe

    hswerdfe Guest

    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
     
    hswerdfe, May 2, 2007
    #1
    1. Advertising

  2. hswerdfe

    Guest

    On May 2, 6:50 pm, hswerdfe <> wrote:
    > 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.
     
    , May 2, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luna Moon
    Replies:
    9
    Views:
    624
    Guest
    Sep 4, 2007
  2. deadpickle
    Replies:
    1
    Views:
    1,032
    Jens Thoms Toerring
    Nov 7, 2010
  3. John K
    Replies:
    14
    Views:
    272
    Steven Cheng[MSFT]
    Oct 24, 2006
  4. Jaap Karssenberg

    conflict between man perlipc and man perlfunc !?

    Jaap Karssenberg, Jan 9, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    164
    Jaap Karssenberg
    Jan 9, 2004
  5. A. Farber
    Replies:
    3
    Views:
    274
    Ben Morrow
    Mar 3, 2004
Loading...

Share This Page