This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
guide:compiling_octave [2011/12/05 12:23] hamish created |
guide:compiling_octave [2021/12/09 16:42] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Compiling Octave from Source ====== | + | ====== Compiling Octave |
| - | This guide is written | + | This guide is written |
| + | export LD_LIBRARY_PATH=$HOME/ | ||
| + | export LD_LIBRARY_PATH=$HOME/ | ||
| + | export PATH=$HOME/ | ||
| + | export LDFLAGS=" | ||
| + | export CPPFLAGS=" | ||
| + | export CXXFLAGS=$CPPFLAGS | ||
| + | export F77=gfortran | ||
| - | Before you begin, make sure your bash environmental variable are set correctly, for [[quick:start# | + | log out and in again, |
| + | $ gcc --version | ||
| + | gcc (GCC) 4.6.2 | ||
| + | |||
| + | |||
| + | |||
| + | ===== Prerequisites | ||
| + | |||
| + | Before you build Octave, you some libraries need to be built | ||
| + | |||
| + | === LAPACK and BLAS === | ||
| + | |||
| + | Download the LAPACK source and extract, setup make and build as follows, | ||
| + | $ cd ~/scratch | ||
| + | $ wget http:// | ||
| + | $ tar -xf lapack-3.4.0.tgz | ||
| + | $ cd lapack-3.4.0 | ||
| + | Setup make, | ||
| + | $ cp make.inc.example make.inc | ||
| + | $ emacs make.inc | ||
| + | # change | ||
| + | # OPTS = -O2 and, NOOPT = -O0 | ||
| + | # to | ||
| + | # OPTS = -O2 -fPIC and, NOOPT = -O0 -fPIC | ||
| + | # save (crtl-x crtl-s) and exit (crtl-x ctrl-c) | ||
| + | $ make | ||
| + | Make BLAS | ||
| + | $ cd BLAS/SRC | ||
| + | $ make | ||
| + | Make LAPACK | ||
| + | $ cd ../../ | ||
| + | $ make | ||
| + | Which should give you test results such as | ||
| + | --> | ||
| + | Processing LAPACK Testing output found in the TESTING direcory | ||
| + | SUMMARY | ||
| + | ================ | ||
| + | REAL | ||
| + | DOUBLE PRECISION 1052315 204 (0.019%) 0 (0.000%) | ||
| + | COMPLEX | ||
| + | COMPLEX16 | ||
| + | |||
| + | --> ALL PRECISIONS 3180834 268 (0.008%) 0 (0.000%) | ||
| + | |||
| + | For more information visit [[ http:// | ||
| + | |||
| + | === PCRE - Perl Compatible Regular Expressions === | ||
| + | |||
| + | From the [[http:// | ||
| + | |||
| + | === FFTW === | ||
| + | |||
| + | Refer to [[guide: | ||
| + | |||
| + | === binutils and libtools (optional) === | ||
| + | |||
| + | binutils | ||
| + | $ wget http:// | ||
| + | $ tar -xf binutils-2.22.tar.bz2 | ||
| + | $ cd binutils-2.22 | ||
| + | $ mkdir BUILD | ||
| + | $ cd BUILD | ||
| + | $ ../ | ||
| + | $ make | ||
| + | $ make -k check | ||
| + | # If all the tests are passed, install into you home directory | ||
| + | $ make install | ||
| + | |||
| + | libtools | ||
| + | $ wget http:// | ||
| + | $ tar -xf libtool-2.4.2.tar.gz | ||
| + | $ cd libtool-2.4.2.tar.gz | ||
| + | $ mkdir BUILD | ||
| + | $ cd BUILD | ||
| + | $ ../ | ||
| + | $ make | ||
| + | $ make -k check | ||
| + | # If all the tests are passed, install into you home directory | ||
| + | $ make install | ||
| + | |||
| + | If you have not already add the following line in your .bashrc file | ||
| + | export PATH=$HOME/ | ||
| + | then logout and login again, you should see | ||
| + | $ ld -v | ||
| + | GNU ld (GNU Binutils) 2.22 | ||
| + | |||
| + | |||
| + | === UMFPACK (optional) === | ||
| + | " | ||
| + | |||
| + | $#still to be done | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Download Source ===== | ||
| + | |||
| + | Since the ftp is blocked on the Tsessbe login node, make use of an http mirror to download octave. | ||
| + | $ cd ~/ | ||
| + | $ wget http://www.mirrorservice.org/ | ||
| + | | ||
| + | |||
| + | ===== Configuration ===== | ||
| + | |||
| + | $ cd ~/ | ||
| + | $ mkdir BUILD | ||
| + | $ cd BUILD | ||
| + | $ ../ | ||
| + | $ cp ../AUTHORS ./ #this is a bug in the configuration script... | ||
| + | |||
| + | After configuration is complete, alot of warning about missing librarys are given | ||
| + | |||
| + | ===== Build ===== | ||
| + | |||
| + | $ make | ||
| + | |||
| + | If errors occur such as | ||
| + | * g++: Internal error: Killed (program cc1plus) | ||
| + | wait a while and then make again, as the process was killed by the usage limiter which runs on the login node. If nessary try the approach shown in [[guide: | ||
| + | |||
| + | ===== Check ===== | ||
| + | |||
| + | $ make check | ||
| + | |||
| + | notable failures are | ||
| + | scripts/ | ||
| + | scripts/ | ||
| + | PASS | ||
| + | |||
| + | Summary: | ||
| + | |||
| + | PASS | ||
| + | FAIL 11 | ||
| + | |||
| + | |||
| + | ===== Install ===== | ||
| + | |||
| + | $ make install | ||
| + | |||
| + | Add the following to the end of your .bashrc file | ||
| + | |||
| + | # for Octave 3.4.3 installed in $HOME | ||
| + | export LD_LIBRARY_PATH=$HOME/ | ||
| + | |||
| + | Log in and out, then | ||
| + | $ octave --version | ||
| + | GNU Octave, version 3.4.3 | ||
| + | Copyright (C) 2011 John W. Eaton and others. | ||
| - | Also note that for this guide, all binary and libraries are installed home directory, i.e prefix=$HOME. My setup | ||
| - | $ export PATH=/ | ||
| - | $ export LD_LIBRARY_PATH=/ | ||
| - | $ export LD_LIBRARY_PATH=/ | ||
| - | $ gcc --version | ||
| - | gcc (GCC) 4.3.4 | ||