Talk:Build from source

From Octave
Revision as of 14:49, 14 June 2013 by Rettaw (talk | contribs) (Format change)
Jump to navigation Jump to search

Manual Introduction

Below is some proposed text for the manual for collaborative editing:


Building Octave is easiest on Unix-like systems, e.g. Debian, Ubuntu, etc. The procedure for building and installing Octave from its sources on a Unix-like system is described in the sections below. To build on other systems requires considerably more expertise, but is possible. Further information on this is available online, such as on the Octave wiki (http://www.octave.org/wiki/index.php?title=GNU_Octave_Wiki), but note that this information is not directly controlled by the Octave authors.

Octave is a large and complex program which depends on many other packages and libraries. The first section below describes how to obtain and install these dependencies before attempting to build Octave itself.

This second section describes the process of building Octave itself. On a Unix-like system building Octave can often be as simple as running a few commands from the terminal. The Octave build system is based on GNU make (http://www.gnu.org/software/make/). This is a commonly used system for compiling large and complex programs. It is often supplied as a standard package, so you are likely to already have it installed. Before running make to build Octave you must also first configure the build process on your system by running a shell script supplied with the source code. This configuration stage is also described in the second section.

Note that this description applies only to Octave releases. If you wish to build the development source, you must obtain them from the Mercurial archive. Building the development sources requires additional steps as described in <Building the Development Sources>. Further information on building Octave can be found in the readme files supplied with the source code.


New page content

Here I'm working on a new version of this page Rettaw 04:49, 14 June 2013 (PDT)


Clone the sources

The latest development sources of Octave are available via this Mercurial archive. With Mercurial and git installed you get the latest development version of Octave sources with the following command:

hg clone http://www.octave.org/hg/octave 

This will clone two repositories, one of which is subrepository of the main Octave repository. Once you have these, you can resync with the archive by doing

hg -v pull 
hg -v update

The -v option is not required but provides extra information about what was pulled and updated.

If you decide to use the development sources from the Mercurial archive, please read the file etc/HACKING that is available with the source files.

Build tools

The following is lifted from the manual (G.1.2) and etc/HACKING the 2013-06-14, if the current date is much different and your build fails because of missing requirements, please follow the links and see if they have been updated.

The following tools are required:

C++, C, and Fortran compilers The Octave sources are primarily written in C++, but some portions are also written in C and Fortran. The Octave sources are intended to be portable. Recent versions of the GNU compiler collection (GCC) should work (http://gcc.gnu.org). If you use GCC, you should avoid mixing versions. For example, be sure that you are not using the obsolete g77 Fortran compiler with modern versions of gcc and g++.
GNU Make Tool for building software (http://www.gnu.org/software/make). Octave's build system requires GNU Make. Other versions of Make will not work. Fortunately, GNU Make is highly portable and easy to install.
AWK, sed, and other Unix utilities Basic Unix system utilities are required for building Octave. All will be available with any modern Unix system and also on Windows with either Cygwin or MinGW and MSYS.

Additionally, the following tools may be needed:

Bison Parser generator (http://www.gnu.org/software/bison). You will need Bison if you modify the oct-parse.yy source file or if you delete the files that are generated from it.
Flex Lexer analyzer (http://www.gnu.org/software/flex). You will need Flex if you modify the lex.ll source file or if you delete the files that are generated from it.
Autoconf Package for software configuration (http://www.gnu.org/software/autoconf). Autoconf is required if you modify Octave's configure.ac file or other files that it requires.
Automake Package for Makefile generation (http://www.gnu.org/software/automake). Automake is required if you modify Octave's Makefile.am files or other files that they depend on.
Libtool Package for building software libraries (http://www.gnu.org/software/libtool). Libtool is required by Automake.
Gnulib <http://www.gnu.org/software/gnulib/>
gperf <http://www.gnu.org/software/gperf/>
Gzip <http://www.gnu.org/software/gzip/>
Mercurial <http://mercurial.selenic.com/>
Perl <http://www.cpan.org/>
Rsync <http://samba.anu.edu.au/rsync/>
Tar <http://www.gnu.org/software/tar/>

Run the bootstrap script

Configure the build

Build dependencies

Run make