Changes between Version 13 and Version 14 of FortranApps
- Timestamp:
- May 20, 2015, 11:09:09 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FortranApps
v13 v14 1 [[PageOutline]] 1 2 = FORTRAN applications = 2 3 3 4 4 == F2X == 5 One option is to use f2c to convert your FORTRAN program to C. M.F. Somers has created a [http://boinc.gorlaeus.net/F2c.php BOINC-enabled f2c library] that simplifies this process. 5 One option is to use f2c to convert your FORTRAN program to C. 6 M.F. Somers has created a [http://boinc.gorlaeus.net/F2c.php BOINC-enabled f2c library] that simplifies this process. 6 7 7 8 == Windows: cygwin == … … 13 14 == Windows: Visual Studio == 14 15 16 === Wrapping FORTRAN in C++ main program === 17 18 One approach is to have a C++ main program do all the interaction with BOINC, 19 and call FORTRAN functions to do the work. 20 An example of this from Paul Calvert is 21 [http://boinc.berkeley.edu/for_win_build.zip here] and 22 [http://boinc.berkeley.edu/fortran_app.zip here]. 23 24 === Calling BOINC API from FORTRAN === 25 15 26 Note: there is [/TestLibs.zip a working example] similar to the following (based on outdated BOINC code); see also its [/taufer.txt README]. 16 27 17 Start by creating a new FORTRAN project. Add all the FORTRAN specific files, then add all the files needed for the BOINC library (e.g. `boinc_api.C`). Make sure that BOINC and the FORTRAN files are compiled using the same type of standard libraries. i.e. if the BOINC is compiled with the debug multithreaded DLL libraries, make sure the FORTRAN files are compiled with the DLL setting. 28 Start by creating a new FORTRAN project. 29 Add all the FORTRAN specific files, then add all the files needed for the BOINC library (e.g. `boinc_api.C`). 30 Make sure that BOINC and the FORTRAN files are compiled using the same type of standard libraries. 31 i.e. if the BOINC is compiled with the debug multithreaded DLL libraries, 32 make sure the FORTRAN files are compiled with the DLL setting. 18 33 19 34 For every BOINC function you want to call from Fortran you must add an interface and subroutine: