help-octave
[Top][All Lists]
Advanced

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

Re: Running C++ program from octave ??


From: Henry F. Mollet
Subject: Re: Running C++ program from octave ??
Date: Thu, 21 Jul 2005 18:45:07 -0700
User-agent: Microsoft-Entourage/11.1.0.040913

[/usr/local/bin] -bash-2.05b 510$ ls -l
total 13864
lrwxr-xr-x   1 root  wheel       16 Jun 29 10:16 mkoctfile ->
mkoctfile-2.1.71
-rwxr-xr-x   1 root  wheel    10332 Jun 29 10:16 mkoctfile-2.1.71

As you can see from above, mkoctfile (only 16 kb) is an alias (=shortcut) to
the *utility* mkoctfile-2.1.71 (10332 kB). This utility is making (mk) an
.oct file from a .cc source file. To use it one has to supply the name of a
C or C++ source file (.cc).

You say that you're using GNU octave 2.1.50, therefore the mkoctfile utility
on you machine cannot be mkoctfile-2.1.71. I would expect it to be
mkoctfile-2.1.50. Using mkoctfile (the alias) should tell you machine to use
the utility that you actually have on you machine. I don't know what
mkoctfile.lnk and mkoctfile.link are, presumably links to the utility to
make an .oct file on your machine. You probably could use either one but
probably not mkoctfile. In any case you have to provide a source file (.cc)
so the utility can get to work.

Yes, at the DOS-prompt which is the same as the Terminal window on a Mac
with OS X. The good old days are gone on a Mac when I did not have to worry
about any prompts. It was the main reason I used a Mac. Now, if you want to
get real work done on a Mac with OS X, you have to use the Terminal Window.
For example, as per recent discussion, Spotlight is useless for finding
files in /usr. The Unix utility locate does the trick in a fraction of
second once the database has been created.
Henry.



on 7/21/05 3:43 PM, Robert A. Macy at address@hidden wrote:

> Henry,  
> 
> I have three files named mkoctfile...
> 
> mkoctfile.lnk . . . . this is a shortcut on the WinXP
>     or, mkoctfile.lin . . on the Win98
> mkoctfile.link . . . . text file?
> mkoctfile-2.1.71 . . . . this is a text file?
>  appears to have all the compile statements in it
> 
> Using command line prompt (not octave, but DOS)
> mkoctfile generates the standard error message
>   Bad command or file name
> no matter where typed.
>  GNU octave 2.1.50
>    ../bin
>    ../octave_files
> 
> Can't get passed that point.
> 
>              - Robert -
> 
> On Thu, 21 Jul 2005 11:59:29 -0700
>  "Henry F. Mollet" <address@hidden> wrote:
>> Required to be able to run dynamically linked functions.
>> 
>> It is a two step process. First the .cc source file needs
>> to be compiled
>> using 'mkoctfile filename' at the shell prompt (not the
>> octave prompt) so
>> this requires mkoctfile. Second the Octave version has to
>> be able to run the
>> .oct file which requires octave_config_info ("dld") = 1,
>> not 0.
>> 
>> After compilation one has the files filename.cc,
>> filename.o, and the
>> filename.oct. Using 'filename' at the octave prompt will
>> use the
>> filename.oct. 
>> 
>> Now assume you also have a corresponding filename.m. This
>> one was running
>> too slowly for you and you wanted to speed it up. You
>> therefore created a
>> .cc source using C or C++ language and then you compiled
>> it. Now in addition
>> to the .oct file you also have the .m file in the same
>> directory. I believe
>> octave will use the .oct file rather than the .m file if
>> you type 'filename'
>> at the octave prompt. One can test this by temporarily
>> renaming on of the
>> files, so that Octave can no longer find it when called
>> with the old name.
>> Henry
>> N.B On my new Octave 2.1.71 installation I could not find
>> the oregonator.cc
>> nor orgegonator.m examples, so I grabbed the ones on my
>> old computer and am
>> now testing what I said in previous paragraph.
>> [/usr/local/share/octave/examples] -bash-2.05b 518$ ls
>> oregonator.cc   oregonator.m
>> 
>> [/usr/local/share/octave/examples] -bash-2.05b 522$ sudo
>> mkoctfile
>> oregonator.cc
>> % sudo because all my directories are locked and I don't
>> know how to obtain
>> root privilages for all directories and files in one
>> sweep.
>> Cut
>> 
>> [/usr/local/share/octave/examples] -bash-2.05b 523$ ls
>> oregonator.cc   oregonator.m    oregonator.o
>>    oregonator.oct
>> 




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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