Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

(Question) JNI and Fortran

Options
  • 10-07-2010 3:01pm
    #1
    Registered Users 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