A collection of hints and facts for Octave running under Windows
Copyright (C) 2001-2003 by Philip Nienhuis
Last version 14 May 2003
How to install Octave under Windows. Management summary for the Impatient User: Have you got Cygwin installed?
If you know what you are doing - OK.
If you found out too late that you didn't, you can read around in this web page to search for answers.
If you feel that more subtle and optimal choices must be feasible (true), you can also read on.
Good luck!
Contents
1. Why this document and for who is it intended?
Why?
This document is intended as an aid for those souls having trouble setting up or running their Octave version under Windows and who cannot find any clue as to how they can solve their problems. This does not imply that all solutions to all problems can be found here; but at least I have described several ways to set up Octave from scratch, all of which demand a bit a bit of forethought, reading and work, but probably bear the least risk of problems. Of those methods, 2 (see below ) is IMHO currently the best and thus recommended.
Given the fact that installation of Octave under Windows has some tricky aspects, potential Octave-for-Windows users should realize the following:
I got Octave running under Windows using the (now unavailable) 2.0.13 Win32 binary and a gnuplot binary. I had to scrape the Internet to get additional stuff like a subset of the Cygwin utils, pipe-gnuplot, less (a Linux pager superior to the DOS-utility "more"), termcap libraries, and lots of other stuff. After considerable troubles, I got it all up and running. I had less troubles when I tried to get Octave running under OS/2. Linux proved the easiest challenge in this respect.
Later on, I installed the binary 2.1.31 Windows distribution by Tom Weichmann and found that contrary to his predictions, both versions (2.0.13 and 2.1.31) co-existed and ran peacefully together on one and the same PC (with different Cygwin systems installed in different subdirectories on the same hard disk). Next I tried the octave-windows-oct25d.exe binary from SourceForge but found that under my (Dutch) Windows-ME it did not install properly.
That was enough for a curious soul to delve into it with more rigor. The results are below, but they are at best incomplete.
Therefore, any suggestions, remarks,
criticism, hints and worked out solutions to all kinds of problems related
to Octave for Windows are welcome, of course as long as they are of reasonable
interest to the Octave-for-Windows community and not personal. Please e-mail
them to me and I'll try to incorporate them into this document. See the
end of this document for contact info.
Please note that I am not a native
English speaker (or writer). Therefore, I also do appreciate linguistic
suggestions.
If you try one of the installation
methods below, it may help to know the following:
I have installed Octave for the second
time more or less along the lines outlined in method #3 (see below), using
the original Octave-for-Windows distro by Tom C. Weichmann (octave-windows.exe).
More recent installations covered
Octave using cf. Method #1 on a (Dutch) Windows 2000; cf. Method 4a on
a (Dutch) Windows ME; and cf. Method 4b on a (US-English) Windows 98.
My latest installation is Octave 2.1.42
+ Octave-Forge + Atlas optimizations on a Windows 2000 / Windows 98 dual
boot configuration.
(This chapter is just meant to introduce the unwary MS-Windows user to a few important Unix/Linux like concepts.)
GPL (General Public Licence) is a licensing system which ensures that you, the user, can always obtain, change and redistribute the source code of any GPL-licensed program you want. This source code itself is free, however, that does not necessarily hold for the media on which this source code is delivered to you: you may not only think of costs of CD-ROM, but also phone pulses and subscription rates to your ISP. To quote the FSF/GPL-website: "Think of free speech, not free beer".
GNU is an acronym of "GNU's not Unix", i.e. a mission to develop an operating system based on the idea of free (in the sense of accessibility and freedom to change and redistribute it) software.
Cygwin is a Linux-like environment which runs under MS-Windows. It is so good that you can even run graphical user interfaces, e.g., like XFree86. Technically speaking, Cygwin is a Linux emulator, it needs MS-Windows for several low-level system services. You had best perceive Cygwin as a virtual Linux system running under a MS-Windows host
Mingw
is a project devoted to getting Linux programs to run natively under MS-Windows.
Linux source code is compiled directly and linked using some dedicated libraries
and then can run directly under Windows. Cygwin is not needed.
This seems an ideal way to get Octave (and for that matter, many other Linux/*nix
programs) running under Windows; but of course, it still remains an ideal. Linux/*nix
and Windows simply differ too much to make this work perfectly. Nevertheless, Mingw has come
a long way and indeed several Linux/*nix programs can be made to run natively under
Windows. Octave, however, is too complicated (yet). Every now and then in the Octave
Maintainers mailing list some messages containing the word "mingw" pop up, but there still is much work
to do to be able to avoid Cygwin as far as Octave under Windows is concerned.
Octave
is a mathematical toolbox / program / system developed under the GPL license.
The Octave version numbering scheme
complies to Linux conventions, where the second number refers to a stable
release if it is even, and a development release if it is odd. Thus, the
latest stable release (at the time that this document was updated, May
2003) is 2.0.17, the latest development release 2.1.48.
(That said, Octave development releases
are not "dangerous" in the sense that they are able to lock up or crash
your Windows (like badly written programs can do, even on NT/2K/XP systems).
It is more that minor features, e.g. mathematical-linguistic interpretations
or documentation is still not up-to-date and some new and/or probably seldomly
used mathematical procedures may not have been tested fully.)
Matlinks ("Toolbox Development for GNU Octave and Matlab/Simulink") is -as its name suggests- a collection of various toolboxes ("add-ins") for Octave and Matlab.
Distributions (or "distros")
are usually "monolithic (i.e., one big file) packages from which you can
install Octave or some other program in one or another way. At first sight
this does not differ much from ZIP-files or self-installing archives for
MS-Windows programs you download from CNET or so. But read on, things are
a bit different.
Below, several types of distributions
are treated. I included this info just to show you programs are generally
installed in Unix/Linux and thus Cygwin systems, and to avoid confusion
further down in this web page.
(I hope) you will realize that this fully automated way of installing a program from source offers a lot of flexibility. Well-written configure procedures may manage to get virtually any program to run on virtually any system, no matter what version the system components are and no matter how arcane your system setup might be. (I do not want to do "Windows-bashing", but just compare this with Windows programs which will run only on Win9x but not NT, or need NT with at least Service Pack nr. X or so, with nothing to do about it.)
octave-forge
is a collection of scripts and other stuff that make Octave more compatible
with that other program, Matlab.
(Be sure not to mix up octave-forge
with the "matcompat" stuff. If you ever encounter matcompat please ignore
it, it is obsolete and now succeeded by octave-forge.)
Windows is understood to be that family of operating systems developed by Microsoft that is supposedly 32-bit - i.e., Windows 95, Windows 98, Windows 98 SE (Second Edition), Windows ME (Millenium Edition), Windows NT (any version), Windows 2000 (several versions), Windows XP (the latter in two flavors, Home and Professional), and -upcoming- Windows 2003 Server. But not Windows 3.1 or 3.11, not even with win32s installed.
I wrote "supposedly", because not all parts of these operating systems are fully 32 bit. For example, Windows 9x & ME versions boot using 16-bit DOS operating systyem kernels, and furthermore, parts of their GDI's (Graphical Device Interface) actually still comprise 16 bit-routines. Windows NT, 2000 & XP also still contain some 16-bit function calls and API function arguments - although these seem to be there for backward compatibility only, they are translated internally to 32-bit versions.
Although all these Windows versions seem to function quite similar to the average user, under the hood they do differ considerably. A consequence is that many programs which run happily on one version are not guaranteed to run without problems on another. Octave shares this fate. Moreover, as Windows has been translated to many languages, many install programs which rely on certain (English) directory names will fail if they are started under non-English Windows versions.
Where I write "Windows" below, I mean all versions of the OS. Where applicable I'll mention the Windows version specifically.
gnuplot
is a stand-alone visualization program which - in contrast to what it's
name suggests- has nothing to do with GNU. Currently it is the most widely
used graphical back-end for Octave.
BTW It seems that gnuplot is the preferred
name rather than GNUplot or Gnuplot.
3. Implementation of Octave under Windows
Octave has been developed under Unix/Linux platforms (originally SunOS and Ultrix) and given this heritage it depends heavily upon a number of features specific to these platforms. Getting Octave to run under Windows is therefore not an easy job. Octave is built using a number of computer languages, i.e. C++, Fortran, plus a number of other tools which take care of parsing command lines, navigation through the built-in help and documentation systems, etc.
Therefore, Octave runs on Windows platforms under a Linux emulator called Cygwin, where all these utilities have been ported to. Similarly, for OS/2 systems Octave is run using the EMX-library, which in fact also emulates a number of Linux routines and interfaces. For yet other platforms other Linux emulators (may) have to be used.
Apart from a more easy port to other platforms, this has the indispensable advantage that the Octave source code is completely independent from the platform it is to run on, making maintenance of the sources a much more easy job.
A consequence of this is that Octave is and remains a Linux-like program, again no matter what platform it runs on. This implies that you, dear Windows user, better have some Linux knowledge, because otherwise some Linux peculiarities will sooner or later bite you in the leg.
In this respect a notable Linux heritage
is the (to the average Windows user) quite complex directory lay-out of
the usual Octave installation. E.g., script files are to be found seemingly
scattered around subdirectories in e.g., /usr/local/share/octave/2.0.16/m
(that is of course, for octave version 2.0.16); many of the intermediate
directories are just empty save for just one child directory.
In case you wonder, this is a consequence
of the Filesystem Hierarchy Standard,
a standard which suggests (rather than dictates) a very specific directory
structure for UNIX and Linux systems.
Unlike Windows systems, where many
carelessly written installers simply dump your programs in the root directory
of C: and where the average program dumps all your texts/models/spreadsheets
in C:\My Documents, in Linux considerable attention is given to where specific
files and programs have to go. It can help a lot if you read the FHS documents
on the link above, or read an introductory Linux textbook.
Just like on Linux systems, Octave
for Windows is merely a "terminal program", i.e. it looks like it runs
in a DOS-box or DOS-terminal. Under Cygwin this terminal is actually a
Linux program called "bash" - a shell program (Bourne Again Shell), which
is in many ways similar (but superior) to the DOS-command interpreter COMMAND.COM.
4. Overview of installation methods and other stuff
There are a number of ways to get Octave installed under Windows:
Although this methods implies some more work, it does have some advantages:
-You can install any Octave version you like, stable, development or bleeding edge;
-Maintenance of Octave and installation of octave-forge is much easier (but the latter somewhat "involved" due to Cygwin <-> Windows limitations);
-You can easily adapt Octave to your
own wishes at your own discretion.
As far as the Matlinks site
is concerned, be warned that the complete 2.1.31 binaries from there do not always
install properly and that the way Cygwin and Octave are installed has some
side effects. Moreover, currently only (development-) versions 2.1.31 and
2.1.33 can be installed this way. The octave-forge stuff can only be partly
installed as this requires a more complete Cygwin installation.
As of August 2002, another complete Windows distribution
for Octave 2.1.36 including Octave-Forge was released which overcomes
a lot of problems encountered with the first complete distributions.
The Windows binaries from the SourceForge
site are vey stable and much more complete.
Be warned that these complete distros
might wipe out, or at least render useless, an existing Cygwin installation.
The latest complete Windows distributions at least warn you if an existing Cygwin
installation is going to be overwritten; we still wait for a complete distribution
which, in case it finds an existing Cygwin installation, leaves it alone and then
just add Octave to it.
In a way, this looks like the best of
both worlds, but to be able to use this method you first must have successfully
installed Octave using method 2…..
This is a combination of methods 1 and 2, in the sense that you still have adequate freedom to choose which Octave version to install, but you do not need to spend time to compile Octave yourself - that has already been done by other people.
The "other stuff" department currently comprises:
5. Method
1: Building Octave yourself
<Note & warning: I haven't tried compiling Octave myself for over year now (lack of time, & the complete distros are so good....). The instructions below, especially those referring to cygwin setup itself, may not be fully up-to-date (although certainly not in gross error). If you want to compile octave yourself, you should keep in mind that some searching and experimenting may be needed with respect to cygwin itself>
This consists of the following steps:
Make sure your PC is in good condition with regard to:
Point your Internet browser to http://cygwin.com/, and start with reading a few things about Cygwin, notably what is mentioned in the left column under "Documentation".
** Please read at least the User's Guide and FAQ **,
only then download the program setup.exe (click on the black-and-green "C" symbol).
Next, stay connected to your ISP (if you dialed in, do not close your dial-in connection. However, you do not need your web browser from now on) and doubleclick on the just downloaded file setup.exe.
Choose "Download from Internet" and
at the next dialog box, choose a suitable download directory for all your
downloaded packages. It is best to keep the suggestion for Installation
directory to C:\cygwin.
NOTE: Be sure to install Cygwin
in a directory directly in the root of your C:-drive (e.g., C:\cygwin)
or in the root of any other hard disk partition. DO NOT USE SPACES in this
directory name, as a number of Cygwin utilities (notably mount) cannot
cope with names with embedded spaces!
Current Cygwin setup-versions ask for
the kind of line-feeds right away (Unix-style vs. DOS-style). For the moment,
just specify "Unix-style".
DOS/Windows eol-s are usually CR/LF
(CarriageReturn & LineFeed, while Unix/Linux eol-s are usually just
LF. I used to choose CR/LF (DOS/Windows style) and I have not encountered problems
yet. But certain problems with TexInfo may be related to this issue; the SourceForge
complete binaries install with Unix style line endings. Anybody
out there with a definitive answer?
In this dialog you can also choose
for which users you will set up Cygwin. In fact, this is just a choice
between the Start Menu for "All users" or just for your own Start Menu.
(BTW When I did this on my Windows
2000 system, I did not need administrator privileges at all for the entire
Cygwin/Octave installation; power-user was good enough.)
On the next dialog box, choose "Direct connection" (that is, if you are still connected to the Internet using your dial-up connection or LAN connection.
Then choose a suitable mirror for downloading the packages.
After a while, a list of packages appears. Sections can be folded out by clicking on the +-sign. Be sure to select (by repeated clicking on the leftmost symbol under the "New" column) the following packages which are indicated in Table 1 below in the "Full" column (and do NOT download the source code packages, deselect the relevant tick boxes):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(I may have added one or two packages too much here just to be safe, but that should not matter much.)
Some comments:
binutils: contains the assembler and
linker/loader. Without it executables can't be made
bzip2: a very efficient archiving
program. Many Linux-like archives are in .bz2 format
cygwin: contains the basic cygwin
package and dll's
gzip: needed to unpack tar.gz archives
less: pager, superior to the DOS pager
MORE
groff, m4: needed for man
man: on-line help system
mingw: a development environment for executables which
don't need Cygwin
ncurses: vital for various messages
perl: a very handy, much used scripting
tool
rxvt: a terminal program, needed for
better GUI under Win9x & Win-ME
texinfo: needed for Octave's interactive
help system
People having much development experience in Linux may want to install cvs, openssh and openssl too, as these allow to download the most recent snapshot of octave sources from cvs (I never tried, I just mention).
If your Internet connection consists of a slow dial-up connection, you can (like I did) divide these downloads over a number of cheap phone rate periods (weekends, nights) - or get a high speed Internet connection like ADSL (like I did too, in a later stage but for other reasons).
Step 2B. Actual installation of Cygwin
Once you have downloaded all these packages, disconnect from the Internet and again start up setup.exe.
This time, select "Install from local directory".
Cygwin then installs all the packages you downloaded, be sure to install them in the default suggested directory (probably C:\Cygwin\). It installs a convincingly Unix/Linux-like directory structure there, including /usr, /tmp, etc (where / stands for the root of the Cygwin file system, i.e. C:\Cygwin in Windows parlance). The install process ends with a number of alternating flashes of DOS-boxes (actually Cygwin terminals) and Cygwin setup screens. Don't worry, just let it go on.
There is a file named Cygwin.bat installed somewhere in the Cygwin directory. Make a copy of this batch file in e.g. your \Windows directory. Make a Windows-shortcut for it, in your Start menu and/or on your desktop, if the setup program did not already do that for you.
Just check the Cygwin environment. Doubleclick on the desktop icon. If all is well, you end up in a Cygwin terminal, probably in your Cygwin home directory (/home/< your_Windows_login_name>). End the terminal with <Ctrl>-D or by typing: exit
In order to be able to cut-and-paste into and from the Cygwin terminal, right-click on the desktop icon, select "Properties" and in the "Misc" (Win 9x/ME) or "Options" tab (Win2000) uncheck the Fast Pasting option. Additionally, check the "Quick Edit" option; I found that pasting from a Cygwin terminal was much easier then.
Step 3. Download the source code for your favorite Octave version
Point your Internet browser to ftp://ftp.octave.org/pub/octave/, select one of the source code packages from that site and download it into a subdirectory of your Cygwin directory (e.g., /src/octave). (Windows Explorer and thus all file dialog boxes derived from it can browse without any problem through the Cygwin directory structure.)
Step 4. Configure, compile and install Octave
Start up Cygwin using the batch file CYGWIN.BAT. You'll see a DOS-box like Linux terminal.
=> From now on remember that, unlike
Windows, Linux DOES distinguish between upper and lower case letters in
file names etc.! So take care when you type a Linux command!
(A somewhat deceptive issue is that
not all parts of Cygwin seem to be case sensitive - better be prudent in
this respect.)
=> Also remember that unlike Windows, programs have to be in a directory in your (Linux-) PATH in order to be able to start them. If you are sure you are in the same directory as where your program file resides but you still cannot start it, the directory is simply not in the PATH. You can start that program anyway then by prepending "./" (without the quotes) to the program file name.
O.K., Unpack the downloaded Octave source-code distribution:
cd /src/octave
tar -xvzf octave-<version-number>.tar.gz
cd octave-<version-number>
(where <version-number> can be e.g. 2.0.17, 2.1.36, 2.1.48 etc.)
All the next steps are described in detail in the files INSTALL and INSTALL.OCTAVE which are in the directory octave-<version number>. You can give it a try by going to the subdirectory octave-<version number> (cd octave-<version number>) and typing (literally):
./configure
make
make install
(Mind the period before the slash in ./configure!)
The first command (./configure) took about 15 (233 Mhz Pentium MMX with 64 MB memory) or 2 minutes (AMD AthlonXP 1600+ w. 512 MB) to prepare Octave for compilation. You can safely neglect the last messages about gperf, runtest/dejagnu and/or gnuplot not being found.
The second step (make) took two hours (233 P-MMX) or 13 minutes (AMD 1600+), respectively.
The last step, Octave installation proper, usually takes just a few minutes.
After the last step you can find octave
in the directory /usr/local/bin, as an executable named octave-<version
number> (e.g., octave-2.0.17).
(In addition, there is usually also
a file called octave.exe; this is just a symbolic link to octave-<version
number>.)
If everything up till this step was successfull, you now should already be able to run Octave.
Go (in the Cygwin terminal window) to /usr/local/bin and type:
./octave-<version-number>
After a while, you should see the welcome message of Octave. You can try by typing:
help -i eig
If all goes well, you'll see the TexInfo message about usage of basic matrix functions. Quit by typing:
q
followed by <Ctrl>-D to quit Octave.
Finally, if after some time your Octave runs satisfactorily, you can clean up by again going to the /src/octave/octave-<version-number> directory and typing:
make clean
or more rigorously, simply deleting the directory /src/octave
What if things go wrong?
I'm afraid I cannot help you much. The output of ./configure gives clues as to what is actually wrong. But it often happens that ./configure may report errors which are not the actual errors themselves but are consequences of errors not detected earlier in het configuration process. In the vast majority of cases, errors detected by ./configure result from missing Cygwin packages.
Once ./configure has finished successfully, it is unlikely that the next steps fail.
For an (admittedly incomplete) overview of a number of known problems, see below.
Point your web browser to www.gnuplot.info, select a mirror site and and download the file gp371cyg.zip or gp371w32.zip (or a later version indicated to be a Win32 binary for Cygwin).
As this is a regular Windows ZIP-archive, you can unpack it using Winzip or another archive program supporting ZIP format. After unpacking, follow the instructions for installation of gnuplot.
Note 1: Installation of gnuplot in the C:\Program Files directory (where most Windows programs are stored) is no problem for Octave, nor for many other Linux programs run from the Cygwin Linux emulator which might need gnuplot. As installation under C:\Program Files is a de facto convention for many a Windows package, just put gnuplot there to avoid cluttering up your hard drive's root directory.
Note 2: Depending on the actual gnuplot package, it will install also a subdirectory with a number of demo files. These are quite worthwile, as gnuplot is also just by itself a very powerful program. After Octave has made a plot by invoking gnuplot, you can use the gnuplot command window to further enhance the picture.
If you insist on doing it the hard way, you can also download the gnuplot source code and build gnuplot yourself. I have not done this, so you are on your own if you want to try it.
Step 6. Connect gnuplot to Octave, and other nitty-gritty
Some small things remain and need careful attention:
Some things to know in advance:
Take any text editor (Windows or Linux) and make sure that the following lines get into octaverc (adapted from Tom C. Weichmann's version):
## System-wide startup file for Octave.
##
## This file should contain any commands that should be executed each
## time Octave starts for every user at this site.
##############################################################
## Please Do Not Change These Settings
## They Are Needed For Proper Operation on The Win32 Platform
gnuplot_binary = 'pipe-gnuplot wgnuplot.exe';
putenv('TMPDIR','C:/Cygwin/tmp');
# gnuplot_has_multiplot = 1
##############################################################
(Make any necessary changes if your
directory structure is different - take care of upper- and lower case characters.
If wgnuplot is not (yet) in your Cygwin path but somewhere else in the
Windows subdir hierarchy, enclose the path to wgnuplot.exe in quotes or
just add the necessary subdir to your PATH. E.g., here's my PATH:
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/cygdrive/c/Program Files/gnuplot/gp371cyg:/cygdrive/c/WINNT/SYSTEM32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/SYSTEM32/WBEM:
N.B. As you can see I used the implicit Cygwin mounts /cygdrive/c to refer to Windows drive/partition C:\
(Also note that the last line is commented out. This line indicates that the gnuplot graph window must not be erased before redrawing, but that next plots must simply be added to it. However, you can also set this from the Octave terminal. I would prefer to have it commented out.)
In the directory /etc there should be a file called profile. This file should contain at least the following lines, or lines meaning the same as these lines:
export PATH=/bin:/usr/local/bin:/gnuplot3.7.1:$PATH
export HOME=/home/$USER
(again, change paths and/or file names if appropriate. If the path to gnuplot (here /gnuplot3.7.1, or in Windows parlance c:\cygwin\gnuplot3.7.1) contains spaces, enclose it in quotes). This file merely appends some directories to your implicit Cygwin-PATH (which is different than your Windows/DOS search PATH). The important item here is obviously the gnuplot subdirectory.
That should do - if you now (re-) start Octave, you should be able to use gnuplot. Try the following command from an Octave window:
gplot rand (100,1) with linespoints
After a while the title bar of your
bash shell should show "pipe-gnuplot", and after some time a graphics window
containing a 2D-plot should appear.
Don't close the gnuplot window yourself,
Octave will do that as soon as you quit Octave.
PaulSöderlind suggested to download gp371w32.zip rather than gp371cyg.zip, because the former has pipe-gnuplot built in and so avoids invoking pipe-gnuplot altogether. Instead of a separate pipe-gnuplot.exe, this package now contains a pgnuplot.exe which -additionally- may give a better pipe.
In the octaverc file (in /usr/local/share/octave/site/m/startup) the line
gnuplot_binary = 'pipe-gnuplot wgnuplot.exe'; can be replaced by:
gnuplot_binary = pgnuplot.exe;
(assuming pgnuplot.exe and wgnuplot.exe
are in a directory in the PATH).
However, in the help-octave mailing
list appeared some messages
that under Windows 2000 and Windows XP, the pgnuplot driver was not working
properly, probably due to a bug in the gp371w32.zip package. So, on this
web page I still feature the "classical" way of linking gnuplot to Octave
using pipe-gnuplot.
A somewhat newer version of gnuplot (3.8.i) -but still beta quality- including PM3D and mouse support, can be found on the Web. E.g., in May 2003, using a Google search, I found one here (use the ...winbin.zip version).
There are certainly alternatives in
case you don't like gnuplot or if you just want to try another visualization
program.
Currently, I know that at least epsTk
works OK with Octave within Cygwin.
KMatPlot (KDE is an X-windows
window manager for Linux, KMatPlot is a drawing program belonging to the
KDE suite), PgPlot and Grace may be viable alternatives too,
but I do not know if there is already an Octave interface for them which runs in Cygwin.
I know that there is an interface for Grace, but that needed so-called .oct files
(dynamically linked files) which is only recently possible under Cygwin.
Have a look at this message
for more info
Although they appear to exist or have
existed, I could not find reasonable up-to-date Windows or Cygwin binaries
for Plplot (presently
at 5.1.0), which is a pity as there is a link
between Octave and plplot. I tried compiling it from its sources under
Cygwin, but to no succes.
So, below is just a description for
epsTk.
epsTk
is a visualization program which outputs Postscript files. IMO, epsTk also
features better contour plots than gnuplot.
Apart from the epsTk package you also
need Ghostscript (a free Postscript interpreter) and GSview (a Postscript
viewer).
Point your browser to epsTk's
home, read a bit about epsTk and then download the "m & doc"
package (because then you'll also have some documentation).
Next, go to the Ghostscript
and Ghostview home site (the Ghostview
site on SourceForge is geared more towards Linux although there are w32 binaries there) and download a Ghostscript
package and a GSview package, both for Windows. Now there is some issue
about the versions. Current GSview versions pop up a window asking for
a registration fee for the GSview programmer. There certainly is some justification
to ask money for such a wonderful piece of software, nevertheless you may
be distracted by these pop-ups or you may find 40 Australian $ simply too
much for your wallet; in that case you might like to know that earlier
GSview versions do not feature pop-ups. The downside is that these earlier
versions cannot be used with Ghostscript 8.0 (the latest version as of
May, 2003). So it's your pick: pop-ups OK or prepared to pay for shareware?
get the latest versions; not OK? find older GSview & Ghostscript versions.
Don't worry, Octave / epsTK will work fine with such older versions.
First install Ghostscript and GSview.
As they are Windows programs (errr... windows versions of programs), put
them somewhere in the C:\Program Files directory. After you've installed
Ghostscript and GSview, simply unzip (using WinZip or PowerArchiver etc.)
the contents of epsTk<version_number>.zip to /usr/local/share/octave/site/m/
and make sure the contents are in the subdirectory epstk<version_number>/m/
(e.g., /usr/local/share/octave/site/m/epstk191/m/). Then, move the contents
of the .../doc subdirectory to /usr/doc/epstk and remove the .../epstk<version_number>/doc
subdirectory.
In the epstk m-file directory, you'll
find a file called einit.m. In the upper 10 lines or so, adapt the contents
of the variables %ePath, %eGhostview and %eGhostscript to your specific
setup.
For example, my einit.m reads:
ePath='./';%default directory of epstk-mfiles
%ePath='/usr/local/share/octave/site/m/epstk191/m/';%default
directory of epstk-mfiles
%eGhostview='ghostview -magstep -1';
%ghostview for linux
%eGhostview='gv -scale -2'; %ghostview
for linux
eGhostview='"c:/Program Files/Ghostview/gsview/gsview32.exe"';
%ghostview for windows
eGhostscript='gs'; %ghostscript for
linux
%eGhostscript='"C:/Program Files/Gs/gs7.04/bin/gswin32.exe"';
%ghostscript for windows
As you can see, I installed Ghostscript
in C:\Program Files\Gs and GSview in C:\Program Files\Ghostview. Installing
them in C:\Program Files is no problem, as the path names are enclosed
in quotes.
You can now start up Octave and run
edemo1.m. If all went well, you will see a nice picture. To run the other
demos, you must "cd" (from within the octave terminal window) all the way
to the epsTk m-file directory (again, in my case, /usr/local/share/octave/site/m/epstk191/m/)
and run the demos from there. If all demos work OK, you can be confident
that your epsTk installation is OK.
Once epsTk is installed, you will have
to find out yourself how to use epsTk in practice (using the documentation
in /usr/doc/epstk). This web page is just devoted to get Octave working
under Windows :-)
2. Revamping
the bash terminal
Instead of the classic white-letters-on-black-background,
you'll want black letters on a white background, and probably some neater
fonts. To do this, you'll need the rxvt program included in Cygwin.
Just make a file e.g. called start_octave-<version-number>
in /bin or /usr/local/bin and make sure it reads something like:
#!/bin/sh
rxvt --keysym.0xFF50 '^a' --keysym.0xFF57
'^e' --keysym.0xFFFF '^f^h' -fn "Lucida Console-14" -tn linux -title Octave
-sr -sl 10000 -e octave-<version-number>
(All stuff starting from "rxvt" on
one line!)
Next, make it executable (from a Cygwin
terminal): Go to the /bin or /usr/local/bin directory and type:
chmod ugo+x start_octave-<version-number>
(The chmod command is a UNIX/Linux command to set or change file attributes. Replace <version-number> with your desired octave version number, e.g. 2.0.17.)
Finally, make a DOS batch file called OCT<VersionNumber>.BAT (e.g., OCT2017.BAT), place it in /bin or /usr/local/bin, make sure it reads:
@echo off
chdir C:\Cygwin\bin
bash --login start_octave-<version-number>
(BTW By simple inspection of the file start_octave-<version-number>, it is easily seen how to change the font.)
3. Making a shortcut to the Start Menu and Windows desktop
This must be considered basic Windows proficiency. For completeness:
How to do this is described in message
# 1281 in the help-octave mailinglist of 2000. If you proceeded as
described above, you have already done this.
6. Method 2: Installation of available complete binaries (incl. Cygwin) from Matlinks / SourceForge
This is the easiest way of installing Octave. Yet a number of problems are reported with these binaries.
The biggest problem is that existing Cygwin installations are at risk if these complete
Windows binaries are installed.
Upon installation of Cygwin, some registry keys are written. These constitute the
so-called "mount table", where it is specified (amongst other stuff) at what point in the Windows file system
the root of the Cygwin file system is located. For example, is might say that "/" (the
Cygwin root) might be at the Windows subdirectory C:\cygwin.
Now a new Cygwin installation may lead to new registry keys which specify the root to be at
another place, say C:\GNU Octave. That implies that the new Cygwin cannot find the already
existing Cygwin components, and the existing components can't run because the information
about where to find the root of their file system has been wiped out.
Now you might say: "Hey, then I'll just specify the same directory for the new Cygwin as the
old one". Cleverly thought up, but then you still run the risk that existing Cygwin
components/programs/libraries/configurations are overwritten by new versions which are
incompatible with existing Cygwin programs.
If you have an existing Cygwin installation, use method 4 ("add Octave to
Cygwin") rather than install a complete Windows binaries.
MATLINKS SITE
Be aware that the binaries on the Matlinks site
are a bit outdated. I'd advise to use the complete Windows binaries from the SourceForge site (see below).
Nevertheless, the makers of the Matlinks binaries (notably Tom C. Weichmann, and J. de Marchi) deserve lots of credit for
these first comprehensive and easily installable Windows binaries!
SOURCEFORGE SITE
The SourceForge site contains a number of complete Windows
binaries which are based on the work of Agustin Barto and which have further been developed
by Andy Adler. One of Barto's versions still resides on the
Matlinks download site (it is called octave+forge.exe).
Point your browser to octave.sf.net, click
on "Files" (upper right) and search in the Octave-Forge-Windows section for the file
octave-2.1.42-windows-atlas.exe (about 10 MB).
Once you downloaded it, double-click on
the file. After a while some questions appear. The provided default answers
are often good enough, but for the type of CPU-optimization you must make
a proper choice yourself. If in doubt, select "noatlas". If you are sure
the CPU inside your PC is a Pentium II or a Pentium IV or an Athlon/AthlonXP
processor, select p2atlas, p4atlas or athlonatlas, resp. Even in case you
made the wrong selection, the only effect is that Octave might run very
much slower. I found that there is no shortcut to the help-files in html format. You can make one
yourself very easily by making a Start Menu or desktop shortcut to the file /html/octave_toc.html.
A similar option concerns the epstk help files: make a shortcut to the file /html/epstk/index.html
7. Method 3: Installation of additional Octave versions, based on method 2
Once you've successfully installed one of the binaries using method 2, it is easy to add other Octave versions.
All you need to do is:
One can also just download and install Cygwin without gcc-compilers etc. Just follow the instructions for Method 1 up to and including Step 2, but apart from the Cygwin base package just download bzip2, texinfo, less, cygutils, rxvt and zip/unzip (i.e., the packages in the column "Base" in Table 1).
The next step would be downloading
a binary Octave distribution (much like native Linux distributions). Octave including gnuplot works "out of the box" in this distribution (that is, from the Cygwin terminal).
You have a choice of several binary distributions (tarballs). Some of them feature ATLAS optimizations;
ATLAS implies much faster computations with large matrices, sometimes up to 10-15 faster than
non-optimized versions. However, ATLAS is heavily dependent on your CPU type.
Be sure to follow the brief but complete instructions on that web page. You must install gnuplot yourself.
These binaries are also installed using the tar and gunzip programs.
if you are curious you can also try the still older 2.1.3x versions here.
Download the package of your choice to some place in your Cygwin download directory,
start up Cygwin setup, browse to the place you've downloaded the package and select to
install it (you may have to expand the list of packages to see it). Click on Install,
and Cygwin does (most of) the rest.
The octave files (octave-2.1.35.exe etc.) and wgnuplot are put in the /bin directory rather than in /usr/local/bin
- this is because of some other (RedHat) Linux standards.
In case you as a Windows user would
want to know: The reason is typical for Linux. The FHS (File system Hierarchy
Standard) dictates that in /bin belong only general system programs. Other
programs which should be safe from a system upgrade should go in /usr/local.
However, RedHat Linux and Cygwin both use (each a different) package management
for upgrades, so there's no need for /usr/local as far as binary packages
are concerned (software installed from tarballs are a different matter).
As in this case Octave is installed/upgraded/uninstalled by Cygwin package
management rather than from .tar.gz + compiling, according to this philosophy
it should go into /bin, too.
You can:
9. Installation of the octave-forge package
Matlab compatibility (to Matlab version 4.2) can be increased by installation of the octave-forge package, assembled and maintained by the octave community.
However, in order to install this octave-forge package fully one must be able to make so-called .oct-files (dynamically linked procedures) under Cygwin, an there is unfortunately still no easy solution for that under Windows / Cygwin. You'd better use Andy Adlers complete octave-package from octave.sf.net as he has also installed Octave-Forge in it (statically linked rather than dynamically).
If you have installed Octave using just method 2, you lack the gcc compiler, the make program and other utilities. Then you can either add these and give it a try (see method 3, above) or be satisfied with an incomplete installation of the octave-forge package.
In the latter case, you can use WinZip or PowerArchiver to extract all the files under 'main" except for those in the directory into the /usr/local/share/octave/<version-number>/m directory (be sure to check the "Use folder names" check box to keep the directory structure in the archive). In the "FIXES" directory in the octave-forge archive, various enhancements to standard Octave functions are supplied, but these are not sorted into the various directories under /usr/local/share/octave/<version-number>/m.
In case you insist, here
is a message from Andy Adler where he describes how he got it together.
10. Some known problems and fixes
1. Octave installed from a complete binary, but it doesn't work
Usually this is due to a non-English Windows version or too little default environment space for DOS programs.
In the typical case there is usually a file OCTAVE.BAT which contains nonsense, and/or the Octave directory contains only 2 or 4 Mb of stuff, and/or doubleclicking on the Octave desktop item or in the Start Menu (if these "shortcuts" exist at all) leads to an error message like "no such file or directory".
Sorry to tell you that you are one
of those unlucky souls with a computer where the Win-Octave binary simply
doesn't install (or better: doesn't install in a simple way).
If you are no programmer, do not know
much about Windows and/or Linux, there's little to be done about it, sorry.
Only way out is to search the help-octave mailinglist for answers (I'm
also collecting them on this page, but I lack time to finish it).
You might try one of the other Win-Octave distro's. Whereas octave-windows-2000oct25d.exe (from the Matlinks site) did not install properly under my (Dutch) Win-ME, the original distro (octave-windows.exe; also from Matlinks) did. Probably it is a wise thing to delete the complete Cygwin & Octave directories first from your Windows partitions.
If you do insist on getting Octave under Windows rather than Linux, I would still advise you to use Method 2 and take the SourceForge complete Windows binaries, or if you got the time for it, Method 4 (above): install a basic Cygwin and then use one of the Octave binaries. Currently those are the most reliable and most complete ways to get Octave installed under Windows.
3. Mysteriously vanished Cygwin
Currently available complete windows binaries, which usually include a new Cygwin, simply overwrite the Windows registry keys which pertain to existing Cygwin installations. As a result, pre-existing Cygwin installations are disabled. If the Octave distro installation directory happens to be the same as the one where the original Cygwin installation lived, it can even be ruined for ever.
The cause is obviously that you installed a complete binary cf. Method 2 rather than a cygwin binary cf. Method 4.
It may be possible to repair your original Cygwin registry keys, but that comprises hacking around in the Windows registry. You then run risks like mistyping, sudden power drops and others, and as any registry editing is effected immediately, you run a very real risk of even ruining your complete Windows.
You'd better try to restore things by just re-installing the Cygwin base package - that will probably restore the registry keys; be sure to specify the proper Cygwin install directory in the Cygwin setup!
Luckily the newest complete windows binary distro checks for existing Cygwin installations.
3. Languages
Beware that translated Windows versions
(i.e., non-English Windows versions) may have other names for certain standard
directories than the English version. However, many setup programs blindly
assume English standard directory names.
Possible candidates are "\Program
Files", "My Documents", etc.
Ofcourse, these problems can
simply be tackled by just creating the relevant directories with the proper
English names on your C:\-drive :-). Octave will be installed there without
problems. IMHO no complex patches to the install binaries are needed.
AFAIK Cygwin does not rely on these names, but the available Octave-for-Windows binaries on SourceForge / Matlinks seem to do. Nevertheless, in this help-octave mailing list message some more info on this language problem is given.
4. Environment space
Many programs which are started from a DOS window, including Cygwin bash, need some storage space for so-called environment variables. Those are variables which have a "string value"; e.g. your PATH environment variable, which tells DOS programs where to search for a program, usually has the value "C:\WINDOWS;C:\WINDOWS\COMMAND;" or something like it.
A number of DOS programs need extra environment space, because they need to store an awful lot of environment variables and/or their environment variables have very long string values.
Therefore, the DOS-box they are run in should be started with the following setting in the Memory tab of the Properties dialog box (right-click on the DOS-box icon):
Initial environment = "Automatic" or (preferrably) 4096
If you encounter problems running Cygwin
or Octave, changing this setting may help.
11. Where to get more information
Other Internet sites with info on how to get Octave running under Windows:
Paul
Söderlind's (old) Software page
Paul
Söderlind's (new) Software page
Tom
Weichman's download site
Tom
Weichmann's Octave page (Couldn't find it as of July 2002)
Octave Compatibility (with Matlab of course) FAQ
Specific problems when using or trying to install or run Octave
It seems it cannot be stressed often enough that before you submit a request for help in the help-octave mailinglist, you should:
=> First search the help-octave mailing lists archive <=
to check that your problem has not been reported and/or solved earlier by someone else.
The very, very best option is to use the searchable archive of the entire Octave mailing lists.
Otherwise, you can e.g. simply load the annual index file (for example, ftp://ftp.che.wisc.edu/pub/octave/MAILING-LISTS/help-octave/2001/index.html) and then in your browser do a text search for "Windows".
Since 2002 there exists an
Octave wiki.
What is a wiki? Well, it is a sort of interactive web-page where anyone
can edit the information on that page (or pages).
I saw that it is intended to transfer
this entire Octave-Windows web page to the wiki. I certainly do not object
to that, but I lack time.
But if you, dear reader, want to spend
some time in doing this it would help the Octave community a lot. Please
feel free to do so and cannibalize this page (but mind the copyright info
at the top of this page).
If you have additional information,
hints, criticism, or other stuff that you think is useful to enter here,
please sent me an e-mail.
Q 1: How can I get Octave
for Windows?
Q 2: Why don't several
of my Matlab m-files run in Octave?
Q 3: Why does Octave-for-Windows
use so much Linux conventions?
Q 4: Are the Windows
binaries from Matlinks really as bad as the mailing list messages suggest?
Q 5: Is there no GUI?
Q 6: How fast is Octave,
e.g. compared to Matlab?
Q 7: Why do I get a
message "...broken pipe" when I attempt to make another graph?
Q 8: Why do contour
plots fail? The same script ran perfectly in Matlab....
Q 9: How can I cut-and-paste
to / from the Octave-window?
Q 10: How about verification
of Octave?
Q 11: How can I make
.oct-files (dynamically linked libraries)?
Q 12: How can I uninstall
Octave & Cygwin?
Q 13: How can I acces
all my hard disk partitions from Cygwin & Octave?
Q 14: Where can I
find pipe-gnuplot.c?
Q 15: How about network
installations for Octave?
Q 15: How can I upgrade
Octave from e.g., 2.1.31 to 2.1.42?
Q #?: E-mail me your
Q&A suggestion!
...(to be filled in)...
Q 1: How can I
get Octave for Windows?
A 1: See above.
Q 2: Why don't
several of my Matlab m-files run in Octave?
A 2: Because Octave is not
completely compatible with Matlab. A number of simple things to know:
Q 3: Why does Octave-for-Windows
use so much Linux conventions?
A 3: Because it is essentially
a set of Linux programs disguised as one big Windows program. Read the
start of this web page for more....
Q 4: Are the (complete)
Windows binaries from Matlinks really as bad as the mailing list messages suggest?
A 4: Well, first of all, they
are NOT such bad binaries, in fact, they are quite good.
FYI, I used one myself.
Also remember that people who succeed
with installing Octave under Windows probably won't report it in the help-octave
mailinglist! so the mailing list messages offer at least a biased view
of the rates of success or failure.
That said, there are a number of typical
problems:
Q 5: Is there no
GUI?
A 5: Have a look here
for Tcl/Tk front end building blocks. Tcl/Tk is a script language usable
for building GUIs. I doubt if it will ever get as slick as the Matlab GUI
or Windows or Apple GUIs but it looks very usable to me. Admittedly you
will have to learn at least some basic Tcl/Tk, but that is very simple
indeed.
In addition, at the Octave-Forge
site you have a link to the Octave-GUI
build project. Admittedly it is for GNOME
(a Linux X-Windows graphical environment), but who knows what spin-off
will come from it. Besides, you CAN run X-Windows and thus probably GNOME
from Cygwin.....
Q 6: How fast is
Octave, e.g. compared to Matlab?
A 6: From my experience I can
tell that under Windows, Octave runs about 30 % faster than my Matlab 5.1
student edition. But... nowadays Matlab has a faster numerical LAPACK engine
(more or less the same that Octave was using for a long time), so this
advantage may now have evaporated.
Comparing Linux vs. Windows installations
on the same PC (I got both, and also OS/2 Warp 3 with Octave 2.1.23, installed
on the same computer), the Linux Octave version is about 2 to 3 times faster
than the Window version; the OS/2 version also runs twice as fast as the
Windows one. Typically a case for Linux I'd say.... ;-)
Under Windows, a very notable delay
occurs when gnuplot is invoked. Because of the pipe mechanism, which is
not a native Windows interprocess communication design (it is more a Cygwin
revival of an old DOS heritage), it may take several seconds before your
graph emerges on the screen. Using other operating systems than Windows,
gnuplot graphs appear MUCH quicker.
Octave builds based upon ATLAS are
again much faster especially when computations on large matrices come into
play.
Q 7: Why do I get
a message "...broken pipe" when I attempt to make another graph?
A 7: You probably manually
closed not only the gnuplot graph window but also gnuplot's main
window. Octave-for-Windows launches ("spawns") gnuplot automatically during
its starting up sequence and does so only once. To be able to make a second
graph, simply stay away from gnuplot's command window once you have (re-)started
Octave.
Q 8: Why do contour
plots fail? The same script ran perfectly in Matlab....
A 8: The order of parameters
for the contour() call in the original Octave script files are different
than those of Matlab. This is fixed in the octave-forge package, as well
as more recent versions of Octave.
However, I have the impression that
gnuplot expects seperate full 2-D matrices with X and Y coordinates in
addition to the Z-values, while Matlab uses 1-D X and Y coordinate vectors
(or the situation is vice versa, I'm not sure).
A volunteer will have to sort this
out.... you?
By the way, you can also try epsTk's contouring options (see above).
Q 9: How can I
cut-and-paste to / from the Octave-window?
A 9: From Octave to any other
Windows program works with Ctrl-X/Ctlr-C (cut/copy), paste with Ctrl-V.
From Windows to Octave: Use Ctrl-Ins
rather than Ctrl-V.
Be sure that when you right-click
on the windows desktop icon, under "Properties" in the "Misc"or "Options"
tab the option "Quick Edit" is checked and "Fast paste" is unchecked.
(In my case this still doesn't work,
probably because I use a rxvt terminal. Any better suggestions out there?)
Look here for more
info on cut-and-paste in Cygwin terminals.
Q 10: How about
reliability or verification of the Octave code?
A 10: There you have some difficult
aspects, which actually do not belong in this FAQ as they refer to Octave
in general. But -understanding the motives for this question, I've worked
in ISO 9001 certified organizations myself- I'll just say this:
Q 12: How can
I uninstall Octave & Cygwin?
A 12: Described here is a way
to completely remove all traces of any Cygwin or Octave installation (copied
from the Cygwin FAQ):
mount
and then you'll see something which looks like:
$ mount
C:\cygwin\bin on /usr/bin type system
(textmode)
C:\cygwin\lib on /usr/lib type system
(textmode)
C:\cygwin on / type system (textmode)
c: on /cygdrive/c type user (textmode,noumount)
d: on /cygdrive/d type user (textmode,noumount)
e: on /cygdrive/e type user (textmode,noumount)
o: on /cygdrive/o type user (textmode,noumount)
$
from which you can learn the following:
Q 14: Where can
I find pipe-gnuplot.c?
A 14: Here's an
old version of pipe-gnuplot.c I found on my hard disk (it probably dates back from the
period I installed ancient Octave 2.0.13). BTW the indentation may be somewhat affected
due to conversion into HTML, but you'll get the idea: >P
/* pipe-gnuplot.c
This program was originally written by jl Hamel
comp.graphics.apps.gnuplot. I modified it to accept the name of
the real gnuplot binary on the command line, and to exit when EOF
is encountered. If you have any suggestions for improvements,
please send them to me at the address below.
Thanks,
John W. Eaton
jwe@bevo.che.wisc.edu
University of Wisconsin-Madison
Department of Chemical Engineering
Tue May 19 22:52:47 1998 */
#include < stdio.h >
#include < windows.h >
int
main (int argc, char **argv)
{
char *real_gnuplot = "C:\\gnuplot\\wgnuplot.exe";
/* XXX FIXME XXX */
if (argc > 1)
real_gnuplot = argv[1];
/* load gnuplot (minimized in order to show only the graphic window) */
if (WinExec (real_gnuplot, SW_MINIMIZE) <= 32)
fprintf (stderr, "can't load gnuplot\n");
else
{
HWND hwnd_parent;
/* wait for the gnuplot window */
Sleep (1000);
hwnd_parent = FindWindow ((LPSTR) NULL, (LPCTSTR) "gnuplot");
if (! hwnd_parent)
fprintf (stderr, "can't find the gnuplot window");
else
{
/* find the child text window */
HWND hwnd_text = FindWindowEx (hwnd_parent, (HWND) NULL,
(LPCTSTR)"wgnuplot_text",
(LPCTSTR) NULL);
if (! hwnd_text)
fprintf (stderr, "can't find wgnuplot_text");
else
{
/* wait for commands on stdin, and send them to the
gnuplot text window */
int c;
while ((c = getchar ()) != EOF)
PostMessage (hwnd_text, WM_CHAR, c, 1L);
/* XXX FIXME XXX -- can't we send a string? */
PostMessage (hwnd_text, WM_CHAR, 'q', 1L);
PostMessage (hwnd_text, WM_CHAR, 'u', 1L);
PostMessage (hwnd_text, WM_CHAR, 'i', 1L);
PostMessage (hwnd_text, WM_CHAR, 't', 1L);
PostMessage (hwnd_text, WM_CHAR, '\n', 1L);
return 0;
}
}
}
return 1;
}
Here's another version I found on Internet:
/* pg_noexit.c
cygwin-compile: gcc -O3 -o pg_noexit pg_noexit.c
This program was
originally pipe-gnuplot.c written by jl Hamel
and posted to the
Usenet newsgroup
comp.graphics.apps.gnuplot.
I modified it to accept the name of
the real gnuplot
binary on the command line, and to exit when EOF
is encountered.
If you have any suggestions for improvements,
please send them
to me at the address below.
Thanks,
John W. Eaton
jwe@bevo.che.wisc.edu
University of Wisconsin-Madison
Department of Chemical
Engineering
Tue May 19 22:52:47 1998 */
#include <stdio.h>
#include <windows.h>
int
main (int argc, char **argv)
{
HWND hwnd_parent;
char *real_gnuplot
= "C:\\Programme\\gp37mgw\\wgnuplot.exe";
/* XXX FIXME XXX
*/
if (argc > 1)
real_gnuplot = argv[1];
hwnd_parent = FindWindow ((LPSTR) NULL, (LPCTSTR) "gnuplot");
if (! hwnd_parent)
fprintf (stderr, "can't find the gnuplot window");
else
{
/* find the child text window */
HWND hwnd_text = FindWindowEx (hwnd_parent, (HWND) NULL,
(LPCTSTR)"wgnuplot_text",
(LPCTSTR) NULL);
if (! hwnd_text)
fprintf (stderr, "can't find wgnuplot_text");
else
{
/* wait for commands on stdin, and send them to the gnuplot text window
*/
int c;
while ((c = getchar ()) != EOF)
PostMessage (hwnd_text, WM_CHAR, c, 1L);
return 0;
}
}
return 1;
}
Q 15: How about
network installations for Octave?
A 15: In principle, for network
gurus this should be easy. But then again, in the Windows world you got
MS-Windows/NT networks, Netware, Banyan Vines, etc etc etc. To explain
how to set this up for even just the widely used network software brands
would constitute a HOWTO in its own right.
In addition, network setup in general
comprises a universe in its own right and specific network setup problems
may well interfere with specific Octave-Windows setup problems, and more
specific, with Cygwin setup problems.
Therefore, as long as nobody comes
up with short description for an easy solution, IMO this subject is not
amenable for inclusion here, sorry.
Q 16?: How can
I upgrade my Octave under Windows to a newer version?
A 16: It depends. If you have
used one of the latest complete Windows binaries from SourceForge, chances
are that the Cygwin installation is fairly basic and lacks essential tools
for making Octave upgrades easy. Other complete binaries may or may not
include these tools, I do not know as I did not test them all, and when
I tested some of them I did not care at the time.
Currently I use the latest 2.1.42-noatlas
binary from SourceForge which does not include the relevant tools.
Using this version as an example,
I'll show you the relevant steps. You can see for yourself which steps
to take and which to skip.
You will have to use some Cygwin tools
to upgrade Octave, which means using Cygwin's command line interface (which
looks a bit like good old DOS). First of all, the packages tar, bzip2/bunzip2
and/or gzup/gunzip plus relevant libraries are needed.
We'll start with showing how to start
up a bash shell (i.e., the DOS-like command line interface), then we'll
check if you got the needed packages, and if not, how to install them.
Ensuing steps comprise downloading and installing newer binary Octave distributions
(not complete distros, see chapter 2 (Terminology) if you forgot the differences).
Step 1: Starting up a bash shell, if
present
Browse you Start Menu of desktop for
a shortcut to Cygwin, or Cygwin Bash Shell, or something like that. If
present, fire it up.
If you can't find it, chances are that
it is present but not linked into the Start Menu.
Find out in which directory on you
hard disk Cygwin has been installed. The easiest trick is to use Windows
Find Files tool: Start Menu, Search, Find Files or Folders, and then search
for the file "bash.exe" (do not enter the quotes).
If bash is present, it will be in
the /bin directory of your Cygwin installation, or in Windows terms, in
the subdirectory .\bin of the directory Cygwin (or GNU Octave, or whatever
directory Cygwin has been installed in). If you found bash.exe, check if
you have a file called CYGWIN.BAT in the / directory (the Cygwin directory).
If there isn't and you have no bash.exe, you will have to download bash.
If bash is not present, just search for the file "rxvt.exe" rather than bash.exe. That will also show you where the .\bin (/bin) directory is located. Just write down the name of the Cygwin directory (in my case it is C:\Programs\GNU Octave, but it may be something like C:\Cygwin or so).
Step 2: Checking for the presence of
tar, gzip and bzip2 & libs
In the /bin directory, try to locate
the files tar.exe, bzip2.exe, bunzip2.exe, gzip.exe and gunzip.exe. If
they are present, you're OK. If not, you'll have to download them.
Step 3: Downloading and installing
tar, gzip, zlib, and bzip2, libbz2*
This proceeds largely along the steps
outlined in Step 2A above, about compiling Octave yourself. Point your
browser to http://cygwin.com and click on the "Install or update now!"
button (below the black "C" with green arrow inside). This will initiate
downloading of Setup.exe, the Cygwin installer; make sure you download
it to some temporary directory.
Next, close down your browser (but
retain your Internet connection) and doubleclick on the just downloaded
Setup.exe file.
It may ask you to temporarily disable
your virus scanner (answer Yes) and then to choose from "Install from Internet",
"Download from Internet", or "Install from local directory". Choose the
second option ("Download ...", especially in case you got a slow dial up
Internet connection and select a local package directory (usually the default
suggestion should be OK). If you have a fast flat-rate Internet connection,
you can as well select "Install from Internet" and skip the steps relating
to local download directories further down here.
On the next question select "Use IE
settings", usually that should do if Internet Explorer is your default
Internet browser. Next, select a suitable download mirror site from the
list, and wait until the complete package list has been downloaded.
Now, if needed expand all branches
(click on the "+" syb\mbols), and check all items in the "New" column.
Make sure that they are all set to either "Keep" or "Skip"; if needed click
on the version number until the word "Skip" is shown.
It is a long list; nevertehless make
sure that ALL packages are set to "Keep" or "Skip", EXCEPT for the ones
you found were lacking in steps 1 and 2 above: bash, tar, gzip, bzip2 and/or
the related libraries zlib and libzip2. In addition, select PostinstallLast
/ update_info_dir.
When you have selected them, once
more browse top-wown through the list to be sure that just these packages
are selected and not additional ones like ash, libintlxxxx, libiconxxxx
etc. The, click on "Next" and the selected packages will be downloaded
(or installed). In the end, Cygwin setup will show a pop-up box telling
that is has finished and then it terminates.
Then, browse through the directory
ftp%.......\release which was made and where the downloaded packages reside,
and simply delete all subdirectories containing packages you don't need
but which were downloaded anyway.
Then again doubleclick on Setup.exe
and select "Install from local directory". Let your virus scanner be temporarily
disabled, browse to or enter the name of your Cygwin directory (see Step
1), select "All Users" and "Unix" and press "Next" a few times. You can
ignore the warning about spaces in directory names. In the package window,
(try to) expand all sections and check that only the packages selected
by you will be installed. Then click "Next". After installation, you can
select to have icons / shortcuts added to your desktop and/or Start Menu;
I would at least select the latter.
Now, try to run bash: In the Start Menu, select Cygwin Bash shell. You should now see a DOS-like command line window. Typing the ëxit"command or pressing Ctrl-D ends it.
Step 4: Downloading a more recent Octave
binary Cygwin distribution
Choose a suitable binary distro, look under Method 4.
Step 5: Installation of the newer Octave
binary Cygwin distribution
Fire up Cygwin setup, select "Install from local directory"
and browse to the directory where you downloaded the new octave tarball. Next select it for installing
and press the Next button a number of times. This should do!
Step 6: Adding shortcuts and rounding up
It is wise to leave your "old" Octave intact until you
are sure the new version is equally good or better than the old one (remember, we almost
all use development versions). Two or more Octave versions can very happily live together;
they all use the same .m file hierarchy, including .octaverc in ./site/m/startup and the
gnuplot stuff.
How to test Octave from a cygwin terminal and how to make shortcuts in your Start Menu and/or
desktop is described under Step 2 of Method 1 ("Revamping the bash terminal") and further.
Only problem I foresee is that the new Octave version may grab the Cygwin shortcut: the latter,
octave or octave-sh, is usually linked to a file octave-<version>. The Windows link often refers to the
Cygwin link rather than the octave-<version> file itself.
Q #?: E-mail
me your Q&A suggestion!
A :
The information on this page is collected from web pages, e-mails and mailing list contributions by the following people and parties:
14 May 2003
14 May 03 Cleaned up a lot of old stuff
9 May 03 Updated section on complete binaries
(included SourceForge binary)
5 May 03 Added info on Octave wiki
1 May 03 Added note on % and # comment delimiters
(thanks, R.K.)
1 May 03 Added FAQ item on upgrading Octave
24 April 03 Checked URL's
<December 2002> <Never
had time to complete and upload it>
16 September 2002 6 August 2002
Checked URL's
Updated version numbers
Re-edited stanzas on A. Barto's new distro.
Added complete windows binary by Agustin Barto; Added / changed paragraph on .oct-files in
the FAQ
Refreshed some internal URLs and added an (old?) version of pipe-gnuplot.c I stumbled upon
in an old archive. Changed internal references of pipe-gnuplot.c to pg_noexit.c (don't
know what the latter program does).
29 July 2002
29 July Refreshed some URLs, info
on Andy Adlers distros and added pipe-gnuplot.c
16 May 2002
16 May 2002 Added Emacs & Octave
question.
7 May 2002 Updated link to Paul Söderlind's
distro (now 2.1.36).
6 May 2002
(A long-awaited update.)
Adapted to new Cygwin versions (PATHs,
etc).
Added comments on dynamic functions
(.oct).
Expanded section on install method
#4 (originally only Paul Söderlind's package).
Added link to, and described Andy
Adler's package and made it the recommended option.
Added uninstall, verification &
mount point sections to the FAQ.
Added gnuplot alternatives, epsTk
and alternative options.
Updated Octave versions (current stable
= 2.0.17, current development = 2.1.36).
Updated some links.
Added link to searchable Octave mailing
list archive.
Added sections about distribution
types and Cygwin under Definitions.
Added info about Octave versions under
Definitions.
10 December 2001
Added cut-and-paste to FAQ & preliminary
install method # 4.
07 December 2001
Replaced references to matcompat with
octave-forge. (PAK)
04 November 2001
Made some corrections to the text
as sugggested by J.W. Eaton.
Tried to clean up the HTML-code (presently
made by hand, but originally from MS-Word). I need someone with a very
strict browser to help me check the code, anybody out there?
1 November 2001
Page has been copied to Sourceforge.net
(Thanks, Paul Kienzle!), at this
URL
27 October 2001
Cleaned up here and there.
Made base font (Arial) a bit smaller
to improve legibility.
12 October 2001
Added more info on known problems
list.
Added comment on matcompat package
compilation.
03 October 2001
Fixed wrong octaverc file listing.
Replaced the name GNUplot by gnuplot,
in accordance with the gnuplot FAQ.
Mentioned gnuplot3.8.c (beta) w. PM3D
support.
Added listing of profile file in /etc.
Elaborated somewhat on chmod.
Cleaned up layout here and there.
Added a preliminary FAQ section.
24 August 2001
First version.