armjan Posted March 31, 2005 Report Share Posted March 31, 2005 hi, anyone has any resources on how to pass primitive data types from C to fortran and from fortran back to C, using JNI. I've got this statistical package that needs to have a user friendly interface before dissemenation. Quote Link to comment Share on other sites More sharing options...
Sip Posted March 31, 2005 Report Share Posted March 31, 2005 (edited) What? You've got C and want to mess it up with JNI and Fortran? Why are you even bothering with JNI in between the two? Why not just pass the data directly from C to Fortran? In other words, just call the fortran functions from C. Edit: Out of curiosity, I just did a quick search on google ... C-Fortran interface. Passing params from Java to Fortran Edited March 31, 2005 by Sip Quote Link to comment Share on other sites More sharing options...
armjan Posted March 31, 2005 Author Report Share Posted March 31, 2005 (edited) What? You've got C and want to mess it up with JNI and Fortran? Why are you even bothering with JNI in between the two? Why not just pass the data directly from C to Fortran? In other words, just call the fortran functions from C. Edit: Out of curiosity, I just did a quick search on google ... C-Fortran interface. Passing params from Java to Fortran style_images/master/snapback.png i've got fortran, and wanted to add a graphical user interface for I/O. i can't go from fortran->java, so i have to make a quick stop at c, fortran->c->java. c is the intermediary step needed to translate fortran types to java(JNI). I wish i had the code in c, but statistical packages are often done in fortran. thnx for links... u wouldn't happen to know how to create shared libraries(.dll or .so) for ibm pc and powerpc respectively. Edited March 31, 2005 by armjan Quote Link to comment Share on other sites More sharing options...
Sip Posted March 31, 2005 Report Share Posted March 31, 2005 u wouldn't happen to know how to create shared libraries(.dll or .so) for ibm pc and powerpc respectively. style_images/master/snapback.png PC and PowerPC run different native code ... so a compiled "DLL" cannot be shared unless there is some sort of virtual machine running on the MAC (same thing the other way around). If you compile something for a PC (aka a DLL), it's for the PC. If you compile for the PowerPC, then it's for the powerPC. The two have very different architectures (risc/cisc) and are definitely running VERY different operating systems. You can probably compile your code for either one separately if you use mostly standard C/fortran routines. But I am not aware of a "shared" DLL. Actually, that's where the entire concept of Java comes from. You write something in JAVA, and then can run it anywhere there is a JVM (java virtual machine) ... whether it's a PC, MAC, or anything else. Quote Link to comment Share on other sites More sharing options...
armjan Posted March 31, 2005 Author Report Share Posted March 31, 2005 PC and PowerPC run different native code ... so a compiled "DLL" cannot be shared unless there is some sort of virtual machine running on the MAC (same thing the other way around). If you compile something for a PC (aka a DLL), it's for the PC. If you compile for the PowerPC, then it's for the powerPC. The two have very different architectures (risc/cisc) and are definitely running VERY different operating systems. You can probably compile your code for either one separately if you use mostly standard C/fortran routines. But I am not aware of a "shared" DLL. Actually, that's where the entire concept of Java comes from. You write something in JAVA, and then can run it anywhere there is a JVM (java virtual machine) ... whether it's a PC, MAC, or anything else. style_images/master/snapback.png yes, i am hoping (.so) will take care of powerpc. it's a shared library in the sense that it integrates headers (.h) with fortran (.f). i just need to look further for compilation instructions... i am planning to have an installation package that will determine which binaries to install at host. thnx Quote Link to comment Share on other sites More sharing options...
Sip Posted March 31, 2005 Report Share Posted March 31, 2005 May I ask why you even care about powerPC? Is there anyone using these for statistical stuff? Quote Link to comment Share on other sites More sharing options...
armjan Posted March 31, 2005 Author Report Share Posted March 31, 2005 May I ask why you even care about powerPC? Is there anyone using these for statistical stuff? style_images/master/snapback.png software is to be sold... Intel-based Systems 98/2000/XP/Linux PowerPC MacOS/Linux Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.