Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

During runtime the C# wrapper could only reference one Fortran shared library. All Fortran sources were compiled to one shared library with the following compiler options:
Compilation: {panel:

Panel
bgColor#F7D6C1
borderStyledashed

ifort -c -fPIC -convert big_endian -fpp *.f90
-c : compile to object (.o) only, do not link
-fPIC : generate position independent code (for shared libs)
-convert big_endian: the order in which a sequence of bytes is stored in a computer's memory,
here: most significant bytes first;
used, e.g. on mainframes and supercomputers.
-fpp : run Fortran preprocessor on source files prior to compilation

Linking the compiled objects:

Panel
bgColor#F7D6C1
borderStyledashed

ifort -shared *.o -o <sharedLibrary.so>

During runtime some fortran libraries must be accessible via LD_LIBRARY_PATH. In the following examples they are provided by the ifort compiler:

Panel
bgColor#F7D6C1
borderStyledashed

export LD_LIBRARY_PATH=/opt/intel/fce/9.1.051/lib:. // on 64bit systems
export LD_LIBRARY_PATH=/opt/intel/fc/9.1.051/lib:. // on 32bit systems

2.2. Ifort parameter bug

The ifort compiler v. 9.1.051 has a bug with public character parameters in modules.
Example:

Panel
bgColor#F7D6C1
borderStyledashed

ifort -shared *.o -o <sharedLibrary.so>
CHARACTER (LEN=40), PUBLIC, PARAMETER :: c_att_name(2)= &
/ 'title ', &
'history '/

The parameter c_att_name can not be accessed from outside the module. The solution is a function that exports the parameter as a return value. Now the values can be accessed from outside.

Panel
bgColor#F7D6C1
borderStyledashed

PUBLIC FUNCTION get_c_att_name ( idx ) &
RESULT(res)
...
CHARACTER (LEN=40) :: res
res = c_att_name(idx)
END FUNCTION get_c_att_name

4. OpenMI on Mono in five steps
4.1. Download from SourceForge

...