[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: oct files

From: Victor Hanby
Subject: Re: oct files
Date: Wed, 13 Apr 2011 11:00:02 +0100

Each component model is modular, so compiling with multiple files will be fine. I could add in the file containing the thermodynamic functions into each model (cooling tower, fan, w.h.y.) but it would be more elegant if I could do it as per your last paragraph.

I'm a bit out of my depth here, thanks for the help.


On 12 Apr 2011, at 17:30, John W. Eaton wrote:

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 sub1.c sub2.f objectfile.o -lmylib

or you can use it like a compiler linker:

 mkoctfile -c
 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?


Professor Vic Hanby
Institute of Energy and Sustainable Development
De Montfort University
Leicester LE1 9BH  UK

reply via email to

[Prev in Thread] Current Thread [Next in Thread]