On 12-Apr-2011, Victor Hanby wrote:
| I'm looking at including some legacy code (f77 and C) component
models
| into an Octave simulation. The compilation into .oct files seems
| pretty straightforward but nearly all my models call other
functions/
| subroutines which return values such as thermodynamic properties.
|
| I can't figure out how to accommodate this, any advice would be much
| appreciated.
You can compile multiple files with mkoctfile:
mkoctfile mainfunction.cc sub1.c sub2.f objectfile.o -lmylib
or you can use it like a compiler linker:
mkoctfile -c mainfunction.cc
mkoctfile -c sub1.c
mkoctfile -c sub2.f
...
mkoctfile mainfunction.o sub1.o sub2.o objectfile.o -lmylib
Or are you asking how to call Fortran and C functions from the
function you define with DEFUN in the main C++ file that you use to
define the function that Octave can call?
jwe