InSANE  1.6
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines
Importing Fortran Subroutines

Instructions

Assuming there are not any common blocks the following instructions show how to compile and link a subroutine found in a .f file :

  • include in the header (note the underscore): extern"C" {void subroutineName_(double *arg1, double * arg2, etc...);}
  • In the LinkDef file:

    pragma link C++ function subroutineName_(double * ,double * ,etc... )+;

  • Add lib/subroutineFile.o to list of object files, FortranLibObjs, in build/General.mk
  • Make sure subroutineFile.f is in src directory

Examples