Build from source: Difference between revisions

5,835 bytes added ,  10 January 2012
→‎Dependencies: Began porting octave build docs to wiki
(Added short introduction and a couple of sentences to the Build section)
(→‎Dependencies: Began porting octave build docs to wiki)
Line 21: Line 21:
=Dependencies=
=Dependencies=


On Debian systems, many of the required build dependencies for all versions can be obtained through:
Octave is a fairly large program with many build dependencies.  You may be able to find pre-packaged versions of the dependencies distributed as part of your system, or you may have to build some or all of them yourself.


<nowiki>apt-get build-dep octave3.2</nowiki>
==Tips for Specific Systems==


Which obtains the build dependencies for Octave version 3.2. Some of the required libraries and tools are listed below.
The names of pre-compiled packages vary by system and do not always match exactly the names listed above.


=== Tools ===
You will usually need the development version of an external dependency so that you get the libraries and header files for building software, not just for running already compiled programs.  These packages typically have names that end with the suffix <nowiki>-dev</nowiki> or <nowiki>-devel</nowiki>.
* autoconf
* automake
* GNU sed
* GNU awk
* GNU make
* nm
* flex
* bison
* less
* gperf (if building from scratch)
* perl (also if building from scratch) or python
* gnuplot
* texinfo
* ghostscript
* a TeX? distribution (if building the documentation)


=== Libraries ===
On systems with <nowiki>apt-get</nowiki> (Debian, Ubuntu, etc.), you may be able to install most of the tools and external packages using a command similar to
 
  apt-get build-dep octave
 
The specific package name may be <nowiki>octave3.2</nowiki> or <nowiki>octave3.4</nowiki>, making the command
 
  apt-get build-dep octave3.2
 
for example). The set of required tools and external dependencies does not change frequently, so it is not important that the version match exactly, but you should use the most recent one available.
 
On systems with <nowiki>yum</nowiki> (Fedora, Red Hat, etc.), you may be able to install most of the tools and external packages using a command similar to
 
  yum-builddep octave
 
The <nowiki>yum-builddep</nowiki> utility is part of the <nowiki>yum-utils</nowiki> package.
 
For either type of system, the package name may include a version number. The set of required tools and external dependencies does not change frequently, so it is not important that the version exactly match the version you are installing, but you should use the most recent one available.
 
=== Build Tools ===
 
The following tools are required:
 
{| cellpadding="4" border="1" cellspacing="0"
!Tool
!Description
|-
|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 @code{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:
 
{| cellpadding="4" border="1" cellspacing="0"
!Tool
!Description
|-
|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.
|}
 
=== External Packages ===


{| cellpadding="4" border="1" cellspacing="0"
{| cellpadding="4" border="1" cellspacing="0"
!Library
!Library
!Status
!Debian Package Name
!Debian Package Name
!Comments
!Comments
|-  
|-  
|A version of BLAS and LAPACK, e.g. Atlas
|A version of BLAS and LAPACK, e.g. Atlas
|Required
|libatlas-base-dev
|libatlas-base-dev
|
|Basic Linear Algebra Subroutine library ([http://www.netlib.org/blas]).  Accelerated BLAS libraries such as ATLAS ([http://math-atlas.sourceforge.net]) are recommended for better performance.
|-  
|-  
|arpack
|arpack
|Recommended
|libarpack2-dev
|libarpack2-dev
|New GPL-conformant version
|Library for the solution of large-scale eigenvalue problems ([http://forge.scilab.org/index.php/p/arpack-ng]).  ARPACK is required to provide the functions eigs and svds.
|-  
|-  
|curl
|curl
|Recommended
|libcurl4-gnutls-dev  
|libcurl4-gnutls-dev  
|
|Library for transferring data with URL syntax ([http://curl.haxx.se]).  cURL is required to provide the urlread and urlwrite functions and the ftp class.
|-  
|-  
|fftw
|fftw3
|Recommended
|fftw3-dev
|fftw3-dev
|
|Library for computing discrete Fourier transforms ([http://www.fftw.org]).  FFTW3 is used to provide better performance for functions that compute discrete Fourier transforms (fft, ifft, fft2, etc.).
|-  
|-  
|fltk
|fltk
|Recommended
|libfltk1.1-dev
|libfltk1.1-dev
|
|Portable GUI toolkit ([http://www.fltk.org]).  FLTK is currently used to provide windows for Octave's OpenGL-based graphics functions.
|-  
|-  
|fontconfig
|fontconfig
|Recommended
|libfontconfig1-dev  
|libfontconfig1-dev  
|Library for configuring and customizing font access ([http://www.freedesktop.org/wiki/Software/fontconfig]).  Fontconfig is used to manage fonts for Octave's OpenGL-based graphics functions.
|-
|FreeType
|Recommended
|
|
|Portable font engine ([http://www.freetype.org]).  FreeType is used to perform font rendering for Octave's OpenGL-based graphics functions.
|-  
|-  
|glpk
|glpk
|Recommended
|libglpk-dev
|libglpk-dev
|GNU Linear Programming Kit ([http://www.gnu.org/software/glpk]). GPLK is required for the function glpk.
|-
|gnuplot
|Recommended
|
|
|Interactive graphics program ([http://www.gnuplot.info]).  gnuplot is currently the default graphics renderer for Octave.
|-
|-
|GraphicsMagick
|GraphicsMagick++
|Recommended
|libgraphicsmagick++1-dev  
|libgraphicsmagick++1-dev  
|
|Image processing library (@url{http://www.graphicsmagick.org}). GraphicsMagick++ is used to provide the imread and imwrite. functions.
|-
|-
|hdf5
|hdf5
|Recommended
|libhdf5-mpich-dev
|libhdf5-mpich-dev
|
|Library for manipulating portable data files ([http://www.hdfgroup.org/HDF5]).  HDF5 is required for Octave's load and save commands to read and write HDF data files.
|-  
|-  
|ncurses
|ncurses
|Recommended
|libncurses5-dev
|libncurses5-dev
|
|
|-
|OpenGL
|Recommended
|
|API for portable 2D and 3D graphics ([http://www.opengl.org]).  An OpenGL implementation is required to provide Octave's OpenGL-based graphics functions.  Octave's OpenGL-based graphics functions usually outperform the gnuplot-based graphics functions because plot data can be rendered directly instead of sending data and commands to gnuplot for interpretation and rendering.
|-
|-
|PCRE
|PCRE
|Required
|libpcre3-dev
|libpcre3-dev
|
|The Perl Compatible Regular Expression library ([http://www.pcre.org]).
|-
|-
|qhull
|Qhull
|Recommended
|libqhull-dev
|libqhull-dev
|
|Computational geometry library ([http://www.qhull.org]).  Qhull is required to provide the functions convhull, convhulln, delaunay, delaunay3, delaunayn, voronoi, and voronoin.
|-  
|-  
|qrupdate
|qrupdate
|Recommended
|
|
|
|QR factorization updating library ([http://sourceforge.net/projects/qrupdate]).  QRUPDATE is used to provide improved performance for the functions qrdelete, qrinsert, qrshift, and qrupdate.
|-  
|-  
|readline
|readline
|Strongly <br> Reccomended
|libreadline5-dev
|libreadline5-dev
|
|If you wish to build Octave without GNU readline installed, you must use the --disable-readline option when running the configure script.
|-  
|-  
|SuiteSparse
|SuiteSparse
|Recommended
|libsuitesparse-dev
|libsuitesparse-dev
|Without metis due to licensing issues: UMFPACK - AMD - CAMD - COLAMD - CCOLAMD - CHOLMOD - CXSPARSE
|Sparse matrix factorization library ([http://www.cise.ufl.edu/research/sparse/SuiteSparse]). SuiteSparse is required to provide sparse matrix factorizations and solution of linear equations for sparse systems.
|-
|-
|zlib
|zlib
|Recommended
|zlib1g-dev
|zlib1g-dev
|
|Data compression library ([http://zlib.net]).  The zlib library is required for Octave's load and save commands to handle compressed data, including Matlab v5 MAT files.
|}
|}
<nowiki>Note for users of Debian stable "lenny", as of 2010/07/09, you can install these dependencies with
 
apt-get install autoconf automake flex bison gperf gnuplot libreadline5-dev libncurses5-dev zlib1g-dev \
    libatlas-base-dev fftw3-dev libglpk-dev libsuitesparse-dev libarpack2-dev libhdf5-mpich-dev \
    libpcre3-dev libcurl4-gnutls-dev libqhull-dev gfortran libfltk1.1-dev libgraphicsmagick++1-dev
 
Qrupdate is missing, but it is easy to install from http://qrupdate.sourceforge.net
You may need to add the line:  #include "GL/glu.h"    in src/DLD-FUNCTIONS/fltk_backend.cc.</nowiki>


=Download=
=Download=
39

edits