Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

(Question) JNI and Fortran

  • 10-07-2010 02:01PM
    #1
    Registered Users, Registered Users 2 Posts: 162 ✭✭


    Hey

    Not sure if this is the right forum, but I've a question about the Java Native Interface.

    I'm trying to put a java interface on top of a fortran program. Doing some research, I've read that people can do by using the JNI and c code (as the intermediate).

    I've compiled the java code.. fortran code.. and c code.. but when I try to link them all together (on OS X), I get the following:

    gcc -dynamiclib -o libmycodeinc.jnilib CCode.o FortranCode.o
    Undefined symbols:
    "__gfortran_st_write", referenced from:
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    "__gfortran_transfer_integer", referenced from:
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    "__gfortran_st_write_done", referenced from:
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    _sumsquaredf_ in FortranCode.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status

    If anyone has done this before, I can forward on the code to see if its something small I'm doing wrong.

    The above worked with a different example program, just Java to C. I'm a bit lost here :confused: So any help would be appreciated!

    Thanks


Advertisement