Discussion:
standalone program under windows 7
Valmor de Almeida
2011-02-07 23:56:51 UTC
Permalink
Hello,

I am trying to create a standalone program example from the octave user
manual under windows 7.
When I do

C:\Octave\3.2.4_gcc-4.4.0\bin\mkoctfile --link-stand-alone test.cc -o test

in a DOS window I get

'mingw32-g++-4.4.0-dw2' is not recognized as an internal or external
command, operable program or batch file.

I installed octave in this windows 7 machine using the installer in

http://octave.sourceforge.net/

Do I also need to install cygwin in order to use mkoctfile and create an
executable program?

Thanks,

--
Valmor
Tatsuro MATSUOKA
2011-02-08 00:39:46 UTC
Permalink
Hwllo

It requires path and environmental variables setting if you use mkoctfile.exe externally.
The easier way to do this, you execute mkoctfile inside octave

octave> cd (path where your source is placed)
octave> mkoctfile --link-stand-alone test.cc -o test

Regards

Tatsuro
Post by Valmor de Almeida
Hello,
I am trying to create a standalone program example from the octave user
manual under windows 7.
When I do
C:\Octave\3.2.4_gcc-4.4.0\bin\mkoctfile --link-stand-alone test.cc -o test
in a DOS window I get
'mingw32-g++-4.4.0-dw2' is not recognized as an internal or external
command, operable program or batch file.
I installed octave in this windows 7 machine using the installer in
http://octave.sourceforge.net/
Do I also need to install cygwin in order to use mkoctfile and create an
executable program?
Thanks,
--
Valmor
_______________________________________________
Help-octave mailing list
https://mailman.cae.wisc.edu/listinfo/help-octave
--------------------------------------
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/
Valmor de Almeida
2011-02-08 01:33:12 UTC
Permalink
Post by Tatsuro MATSUOKA
Hwllo
It requires path and environmental variables setting if you use mkoctfile.exe externally.
The easier way to do this, you execute mkoctfile inside octave
octave> cd (path where your source is placed)
octave> mkoctfile --link-stand-alone test.cc -o test
Hello,

I was able to compile and generate the executable as you suggested. Now
running in a DOS window or just double clicking on the file, I get


The program can't start because liboctave.dll is missing from your
compouter. Try reinstalling the program to fix this problem.


I edited the PATH variable under Windows 7 to include:

C:\Octave\3.2.4_gcc-4.4.0\bin\

Now I am able to run the test and I get the following error:

GCD of [10,15] is error: feval: function `gcd' no found
invalid

This test case is just what is at


http://www.gnu.org/software/octave//doc/interpreter/Standalone-Programs.html#Standalone-Programs


Is there another library that needs to be linked? If I fire-up octave in
Windows 7 and ask help on gcd, it shows the help and I can also use the
function inside octave. I don't know what is missing then. Another PATH?

Thanks,

--
Valmor
Post by Tatsuro MATSUOKA
Regards
Tatsuro
Post by Valmor de Almeida
Hello,
I am trying to create a standalone program example from the octave user
manual under windows 7.
When I do
C:\Octave\3.2.4_gcc-4.4.0\bin\mkoctfile --link-stand-alone test.cc -o test
in a DOS window I get
'mingw32-g++-4.4.0-dw2' is not recognized as an internal or external
command, operable program or batch file.
I installed octave in this windows 7 machine using the installer in
http://octave.sourceforge.net/
Do I also need to install cygwin in order to use mkoctfile and create an
executable program?
Thanks,
--
Valmor
_______________________________________________
Help-octave mailing list
https://mailman.cae.wisc.edu/listinfo/help-octave
--------------------------------------
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/
Benjamin Lindner
2011-02-08 06:44:46 UTC
Permalink
Post by Valmor de Almeida
GCD of [10,15] is error: feval: function `gcd' no found
invalid
Is there another library that needs to be linked? If I fire-up octave in
Windows 7 and ask help on gcd, it shows the help and I can also use the
function inside octave. I don't know what is missing then. Another PATH?
GCD is a dynamically-linked function, implemented as .dll but named
gcd.oct (.oct is the extension octave uses for dynamically loaded
octave functions) - so you'll require it if you call gcd().
I can't off-hand cite what octave's search algorithm for such
functions from a standalone executable is.
Try making gcd.oct available in the same path as you executable. Does
it work then?

benjamin
Valmor de Almeida
2011-02-08 14:12:29 UTC
Permalink
Post by Benjamin Lindner
Post by Valmor de Almeida
GCD of [10,15] is error: feval: function `gcd' no found
invalid
Is there another library that needs to be linked? If I fire-up octave in
Windows 7 and ask help on gcd, it shows the help and I can also use the
function inside octave. I don't know what is missing then. Another PATH?
GCD is a dynamically-linked function, implemented as .dll but named
gcd.oct (.oct is the extension octave uses for dynamically loaded
octave functions) - so you'll require it if you call gcd().
I can't off-hand cite what octave's search algorithm for such
functions from a standalone executable is.
Try making gcd.oct available in the same path as you executable. Does
it work then?
benjamin
I tried these places:


C:\Octave\3.2.4_gcc-4.4.0\lib\octave-3.2.4\;C:\Octave\3.2.4_gcc-4.4.0\bin\;C:\Octave\3.2.4_gcc-4.4.0\libexec\octave\3.2.4\oct\i686-pc-mingw32\

still the same problem. I know the executable works because I can run in
cygwin. However I would like to know whether it can run outside cygwin
in the DOS environment.

Help appreciated.

Thanks,

--
Valmor
Alexander Barth
2011-02-08 14:23:07 UTC
Permalink
Just a tought: maybe the octave's search path (for .oct and .m files)
is not initialized properly (or not "re-based" to the actual location
where you installed octave). You can test this if you run the buil-in
command 'path' instead of 'gcd' and compare the results to the output
from the octave shell. In both cases, it should return a directory
containing gcd.oct.
I belive you can set the octave's search path by adding --path in argv
before calling octave_main.

However, I never used the stand alone mode.

Good luck,
Alex
Post by Valmor de Almeida
Post by Benjamin Lindner
Post by Valmor de Almeida
GCD of [10,15] is error: feval: function `gcd' no found
invalid
Is there another library that needs to be linked? If I fire-up octave in
Windows 7 and ask help on gcd, it shows the help and I can also use the
function inside octave. I don't know what is missing then. Another PATH?
GCD is a dynamically-linked function, implemented as .dll but named
gcd.oct (.oct is the extension octave uses for dynamically loaded
octave functions) - so you'll require it if you call gcd().
I can't off-hand cite what octave's search algorithm for such
functions from a standalone executable is.
Try making gcd.oct available in the same path as you executable. Does
it work then?
benjamin
C:\Octave\3.2.4_gcc-4.4.0\lib\octave-3.2.4\;C:\Octave\3.2.4_gcc-4.4.0\bin\;C:\Octave\3.2.4_gcc-4.4.0\libexec\octave\3.2.4\oct\i686-pc-mingw32\
still the same problem. I know the executable works because I can run in
cygwin. However I would like to know whether it can run outside cygwin
in the DOS environment.
Help appreciated.
Thanks,
--
Valmor
_______________________________________________
Help-octave mailing list
https://mailman.cae.wisc.edu/listinfo/help-octave
Valmor de Almeida
2011-02-08 15:15:06 UTC
Permalink
Post by Alexander Barth
Just a tought: maybe the octave's search path (for .oct and .m files)
is not initialized properly (or not "re-based" to the actual location
where you installed octave). You can test this if you run the buil-in
command 'path' instead of 'gcd' and compare the results to the output
from the octave shell. In both cases, it should return a directory
containing gcd.oct.
I belive you can set the octave's search path by adding --path in argv
before calling octave_main.
However, I never used the stand alone mode.
Good luck,
Alex
The path as issued by recompiling the test program to output the results
from running "path" (as opposed to gcd) is:

.

that is the current directory in Windows DOS. The path result from
executing "path" inside the octave> shell is what it should be a bunch
of directories in c:\Octave\....

When running under cygwin everything works and the output "path" in the
standalone executable prints out the right path under cygwin. Note that
the cygwin executable will not run under DOS because it misses the
cygwill.dll among all other things since the path when running the
stand-alone created with mkoctfile in the octave> shell seems not to add
the path. Maybe this is the issue. I should not use mkoctfile in the
octave> shell to create the stand-alone program... Still trying...

--
Valmor
Post by Alexander Barth
Post by Valmor de Almeida
Post by Benjamin Lindner
Post by Valmor de Almeida
GCD of [10,15] is error: feval: function `gcd' no found
invalid
Is there another library that needs to be linked? If I fire-up octave in
Windows 7 and ask help on gcd, it shows the help and I can also use the
function inside octave. I don't know what is missing then. Another PATH?
GCD is a dynamically-linked function, implemented as .dll but named
gcd.oct (.oct is the extension octave uses for dynamically loaded
octave functions) - so you'll require it if you call gcd().
I can't off-hand cite what octave's search algorithm for such
functions from a standalone executable is.
Try making gcd.oct available in the same path as you executable. Does
it work then?
benjamin
C:\Octave\3.2.4_gcc-4.4.0\lib\octave-3.2.4\;C:\Octave\3.2.4_gcc-4.4.0\bin\;C:\Octave\3.2.4_gcc-4.4.0\libexec\octave\3.2.4\oct\i686-pc-mingw32\
still the same problem. I know the executable works because I can run in
cygwin. However I would like to know whether it can run outside cygwin
in the DOS environment.
Help appreciated.
Thanks,
--
Valmor
_______________________________________________
Help-octave mailing list
https://mailman.cae.wisc.edu/listinfo/help-octave
Benjamin Lindner
2011-02-08 16:15:14 UTC
Permalink
Post by Valmor de Almeida
The path as issued by recompiling the test program to output the results
 .
So if you copy gcd.oct into the same directory as your executable,
does it still not find it?
Don't mix up the system's PATH with octave's search path for DLD
functions, it's not the same.
Post by Valmor de Almeida
When running under cygwin everything works and the output "path" in the
standalone executable prints out the right path under cygwin.
Does this mean, the mkcotfile executable, when created under cygwin
shows the same search path as octave under cygwin, but the mkoctfile
executable created for plain windows only shows "." ?
That's possibly a different problem, then.

benjamin
Valmor de Almeida
2011-02-08 18:52:56 UTC
Permalink
Post by Benjamin Lindner
Post by Valmor de Almeida
The path as issued by recompiling the test program to output the results
.
So if you copy gcd.oct into the same directory as your executable,
does it still not find it?
Don't mix up the system's PATH with octave's search path for DLD
functions, it's not the same.
If I copy gcd.oct into the windows directory of the standalone program
and run the standalone program which was created under the octave>
shell, it works.
Post by Benjamin Lindner
Post by Valmor de Almeida
When running under cygwin everything works and the output "path" in the
standalone executable prints out the right path under cygwin.
Does this mean, the mkcotfile executable, when created under cygwin
shows the same search path as octave under cygwin, but the mkoctfile
executable created for plain windows only shows "." ?
That's possibly a different problem, then.
benjamin
Yes. Under cygwin, the path obtained under the octave shell issuing
"path" is the same as when running the standalone program created under
cygwin, either created inside the cygwin octave shell or using mkoctfile
under the cygwin shell.

The problem is on the plain windows octave. To install octave in windows
7 all I did was to use the windows installer for octave. I don't
remember other configuration steps needed. I can certainly try to
install again.

Thanks,

--
Valmor

Continue reading on narkive:
Loading...