| GNU Octave Manual by John W. Eaton Paperback (6"x9"), 324 pages, 4 figures ISBN 0954161726 RRP £19.99 ($29.99) |
C Installing Octave
Here is the procedure for installing Octave from scratch on a Unix system. For instructions on how to install the binary distributions of Octave, see section C.3 Binary Distributions.
-
Run the shell script ‘configure’. This will determine the features
your system has (or doesn't have) and create a file named
‘Makefile’ from each of the files named ‘Makefile.in’.
Here is a summary of the configure options that are most frequently used
when building Octave:
--prefix=prefix- Install Octave in subdirectories below prefix. The default value of prefix is ‘/usr/local’.
--srcdir=dir- Look for Octave sources in the directory dir.
--with-f2c-
Use
f2ceven if a Fortran compiler is available. --with-g77-
Use
g77to compile Fortran code. --enable-shared-
Create shared libraries. If you are planning to use
--enable-lite-kernelelor the dynamic loading features, you will probably want to use this option. It will make your ‘.oct’ files much smaller and on some systems it may be necessary to build shared libraries in order to use dynamically linked functions. You may also want to build a shared version oflibstdc++, if your system doesn't already have one. Note that a patch is needed to build shared versions of version 2.7.2 oflibstdc++on the HP-PA architecture. You can find the patch at ftp://ftp.cygnus.com/pub/g++/libg++-2.7.2-hppa-gcc-fix. --enable-dl-
Use
dlopenand friends to make Octave capable of dynamically linking externally compiled functions. This only works on systems that actually have these functions. If you plan on using this feature, you should probably also use--enable-sharedto reduce the size of your ‘.oct’ files. --enable-shl-
Use
shl_loadand friends to make Octave capable of dynamically linking externally compiled functions. This only works on systems that actually have these functions (only HP-UX systems). If you plan on using this feature, you should probably also use--enable-sharedto reduce the size of your ‘.oct’ files. --enable-lite-kernel-
Compile smaller kernel. This currently requires the dynamic linking
functions
dlopenorshl_loadand friends so that Octave can load functions at run time that are not loaded at compile time. --help- Print a summary of the options recognized by the configure script.
-
Run make.
You will need a recent version of GNU Make. Modifying Octave's
makefiles to work with other make programs is probably not worth
your time. We recommend you get and compile GNU Make instead.
For plotting, you will need to have gnuplot installed on your system.
Gnuplot is a command-driven interactive function plotting program.
Gnuplot is copyrighted, but freely distributable. The `gnu' in gnuplot
is a coincidence--it is not related to the GNU project or the FSF in
any but the most peripheral sense.
To compile Octave, you will need a recent version of GNU Make. You
will also need
g++2.7.2 or later. Version 2.8.0 oregcs1.0.x should work. Later versions may work, but C++ is still evolving, so don't be too surprised if you run into some trouble. It is no longer necessary to havelibg++, but you do need to have the GNU implementation oflibstdc++. If you are usingg++2.7.2,libstdc++is distributed along withlibg++, but for later versions,libstdc++is distributed separately. Foregcs,libstdc++is included with the compiler distribution. If you plan to modify the parser you will also need GNUbisonandflex. If you modify the documentation, you will need GNU Texinfo, along with the patch for themakeinfoprogram that is distributed with Octave. GNU Make,gcc, andlibstdc++,gnuplot,bison,flex, and Texinfo are all available from many anonymous ftp archives. The primary site is ftp.gnu.org, but it is often very busy. A list of sites that mirror the software on ftp.gnu.org is available by anonymous ftp from ftp://ftp.gnu.org/pub/gnu/GNUinfo/FTP. If you don't have a Fortran compiler, or if your Fortran compiler doesn't work like the traditional Unix f77, you will need to have the Fortran to C translatorf2c. You can getf2cfrom any number of anonymous ftp archives. The most recent version off2cis always available from netlib.att.com. On an otherwise idle Pentium 133 running Linux, it will take somewhere between 1-1/2 to 3 hours to compile everything, depending on whether you are building shared libraries. You will need about 100 megabytes of disk storage to work with (considerably less if you don't compile with debugging symbols). To do that, use the commandmake CFLAGS=-O CXXFLAGS=-O LDFLAGS=
instead of just ‘make’. - If you encounter errors while compiling Octave, first check the list of known problems below to see if there is a workaround or solution for your problem. If not, see section B Known Causes of Trouble, for information about how to report bugs.
-
Once you have successfully compiled Octave, run ‘make install’.
This will install a copy of octave, its libraries, and its documentation
in the destination directory. As distributed, Octave is installed in
the following directories. In the table below, prefix defaults to
‘/usr/local’, version stands for the current version number
of the interpreter, and arch is the type of computer on which
Octave is installed (for example, ‘i586-unknown-gnu’).
- ‘prefix/bin’
- Octave and other binaries that people will want to run directly.
- ‘prefix/lib’
- Libraries like libcruft.a and liboctave.a.
- ‘prefix/share’
- Architecture-independent data files.
- ‘prefix/include/octave’
- Include files distributed with Octave.
- ‘prefix/man/man1’
- Unix-style man pages describing Octave.
- ‘prefix/info’
- Info files describing Octave.
- ‘prefix/share/octave/version/m’
- Function files distributed with Octave. This includes the Octave version, so that multiple versions of Octave may be installed at the same time.
- ‘prefix/lib/octave/version/exec/arch’
- Executables to be run by Octave rather than the user.
- ‘prefix/lib/octave/version/oct/arch’
- Object files that will be dynamically loaded.
- ‘prefix/share/octave/version/imagelib’
- Image files that are distributed with Octave.
| ISBN 0954161726 | GNU Octave Manual | See the print edition |