User Tools

Site Tools


guide:compiling_octave

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
guide:compiling_octave [2011/12/05 22:26]
hamish [Compile Prerequits (Optional)]
guide:compiling_octave [2021/12/09 16:42] (current)
Line 1: Line 1:
-====== Compiling Octave from Source ======+====== Compiling Octave 3.4.3 from Source ======
  
-This guide is written as to try and help CHPC users who are struggling to compile the Octave version required for their codes. This guide is written for the Sun Tsessbe Cluster. The reader is advise to read through the INSTALL file located in the Octave Source they wish to install before proceeding with this guide.+This guide is written for the Sun Tsessbe Cluster. The reader is advise to read through the INSTALL file located in the Octave Source Folder before proceeding with this guide. Also it recommended to make use of temporary or scratch directory to do all the compilation in (i.e. ~/scratch or /tmp/$USER), as to save disk space in your home directory. This guide assumes GCC 4.6.2 has been installed in your home directory as  in [[guide:compiling_gcc|Compiling GCC from Source]]. Paste the following lines at the end of your ./bashrc file 
 +  export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH 
 +  export LD_LIBRARY_PATH=$HOME/lib64:$LD_LIBRARY_PATH 
 +  export PATH=$HOME/bin:$PATH 
 +  export LDFLAGS="-L$HOME/lib64 -L$HOME/lib" 
 +  export CPPFLAGS="-I$HOME/include -L$HOME/lib64 -L$HOME/lib" 
 +  export CXXFLAGS=$CPPFLAGS 
 +  export F77=gfortran
  
-Before you beginmake sure your bash environmental variable are set correctly, for [[quick:start#what_you_can_do|example ]]. Also it recommended that you make you use of temporary or scratch directory to do all the compilation in (i.e. ~/scratch or /tmp/$USER), as to save disk space in your home directory.+log out and in again 
 +  $  gcc --version 
 +  gcc (GCC) 4.6.
 +  
  
-Also note that for this guide, all binary and libraries are installed home directory, i.e prefix=$HOME. My setup 
-  $ export PATH=/opt/gridware/gcc-4.3/bin:$PATH 
-  $ export LD_LIBRARY_PATH=/opt/gridware/gcc-4.3/lib/:$LD_LIBRARY_PATH 
-  $ export LD_LIBRARY_PATH=/opt/gridware/gcc-4.3/lib64/:$LD_LIBRARY_PATH 
-  $ gcc --version 
-    gcc (GCC) 4.3.4 
-     
-===== Download Source ===== 
  
-Since the ftp is blocked on the Tsessbe login nodei made use of http mirror to download octave. +===== Prerequisites  ===== 
-  $ cd ~/scratch  + 
-  $ wget http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/octave/octave-3.2.4.tar.bz2 +Before you build Octaveyou some libraries need to be built 
-  $ tar -xf octave-3.2.4.tar.bz2+ 
 +=== LAPACK and BLAS === 
 + 
 +Download the LAPACK source and extract, setup make and build as follows, 
 +  $ cd ~/scratch 
 +  $ wget http://www.netlib.org/lapack/lapack-3.4.0.tgz 
 +  $ tar -xf lapack-3.4.0.tgz 
 +  $ cd lapack-3.4.
 +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 
 +    -->   LAPACK TESTING SUMMARY  <-- 
 +  Processing LAPACK Testing output found in the TESTING direcory 
 +  SUMMARY              nb test run numerical error    other error   
 +  ================    =========== ================= ================   
 +  REAL              1070421 38 (0.004%) 0 (0.000%)  
 +  DOUBLE PRECISION 1052315 204 (0.019%) 0 (0.000%)  
 +  COMPLEX          508588 2 (0.000%) 0 (0.000%)  
 +  COMPLEX16          549510 24 (0.004%) 0 (0.000%)
      
-===== Compile Prerequits (Optional=====+  --> ALL PRECISIONS 3180834 268 (0.008%) 0 (0.000%)
  
-Before you build Octave, you may to build some of these libraries+For more information visit [[ http://www.netlib.org/lapack/lawn81/ | Quick Installation Guide for LAPACK on Unix Systems ]]
  
-=== UMFPACK === +=== PCRE - Perl Compatible Regular Expressions ===
-"UMFPACK is a set of routines for solving unsymmetric sparse linear systems, Ax=b, using the Unsymmetric MultiFrontal method." [[http://www.cise.ufl.edu/research/sparse/umfpack/|UMFPACK]]. See [[http://matrixprogramming.com/2008/03/umfpack| Compiling UMFPACK]]+
  
-  $#still to be done+From the [[http://www.pcre.org/|PCRE website]], follow the link source forge to download the appropriate source file. Extract, go into directory, make BUILD directory, enter build directory. ../configure with home prefix. make. make check. make install. If $HOME/lib is not in your LD_LIBRARY_PATH, add it via export or in your .bashrc file.
  
-=== FFTW ===+=== FFTW  ===
  
-"FFTW is a C subroutine library for computing the discrete Fourier transform (DFT)" [[http://www.fftw.org/index.html|FFTW Homepage]] +Refer to [[guide:compiling_octave_3_2_4|Compiling Octave 3.2.4 from Source]] 
-  $ cd ~/scratch + 
-  $ wget http://www.fftw.org/fftw-3.3.tar.gz +=== binutils and libtools (optional) ===  
-  $ tar -xf fftw-3.3.tar.gz + 
-  $ cd fftw-3.3+binutils 
 +  $ wget http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/binutils/binutils-2.22.tar.bz2 
 +  $ tar -xf binutils-2.22.tar.bz2 
 +  $ cd binutils-2.22
   $ mkdir BUILD   $ mkdir BUILD
   $ cd BUILD   $ cd BUILD
-  $ export F77=gfortran 
   $ ../configure --prefix=$HOME   $ ../configure --prefix=$HOME
   $ make   $ make
-  $ make check #test it +  $ make -k check 
-  $ make install #only if all tests are passed+  # If all the tests are passed, install into you home directory 
 +  $ make install
  
 +libtools
 +  $ wget http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz
 +  $ tar -xf libtool-2.4.2.tar.gz
 +  $ cd libtool-2.4.2.tar.gz
 +  $ mkdir BUILD
 +  $ cd BUILD
 +  $ ../configure --prefix=$HOME
 +  $ 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/bin:$PATH
 +then logout and login again, you should see
 +  $ ld -v
 +  GNU ld (GNU Binutils) 2.22
 +
 +
 +=== UMFPACK (optional) ===
 +"UMFPACK is a set of routines for solving unsymmetric sparse linear systems, Ax=b, using the Unsymmetric MultiFrontal method." [[http://www.cise.ufl.edu/research/sparse/umfpack/|UMFPACK]]. See [[http://matrixprogramming.com/2008/03/umfpack| Compiling UMFPACK]]
 +
 +  $#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 ~/scratch 
 +  $ wget http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/octave/octave-3.4.3.tar.bz2
 +  $ tar -xf octave-3.4.3.tar.bz2
      
 ===== Configuration ===== ===== Configuration =====
  
-At the time this guide was written, the f77 compiler was broken [?]: +   $ cd ~/scratch/octave-3.4.3
-   $ f77 --help +
-   /usr/bin/dirname: missing operand +
-   Try `/usr/bin/dirname --help' for more information. +
-   NOTICE: Invoking /usr/bin/f90 -f77 -ftrap=%none --help +
-   /usr/bin/f77: line 43: /usr/bin/f90: No such file or directory +
-   /usr/bin/f77: line 43: exec: /usr/bin/f90: cannot execute: No such file or directory +
-    +
-So gfortran will be used in its place, +
-   $ cd ~/scratch/octave-3.2.4+
    $ mkdir BUILD    $ mkdir BUILD
    $ cd BUILD    $ cd BUILD
-   $ export F77=gfortran +   $ ../configure --prefix=$HOME --with-blas=$HOME/scratch/lapack-3.4.0/librefblas.a --with-lapack=$HOME/scratch/lapack-3.4.0/liblapack.a  --disable-docs  
-   $ export LDFLAGS=-L$HOME/lib #if you compiled you own fftw3 in your home directory +   $ cp ../AUTHORS ./ #this is a bug in the configuration script...
-   $ ../configure --prefix=$HOME --without-fftw3 --without-fftw3f --without-umfpack --enable-static +
- +
-Options explained +
-  * --- prefix=$HOME, configure for installation into home directory +
-  * ---without-fftw3 --without-fftw3f, Use the included fftpack library for computing Fast Fourier Transforms instead of the fftw3 libraryIf this option is not chosen the following build was encounter : +
- +
-  /usr/bin/ld: /usr/local/lib/libfftw3f.a(apiplan.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC +
-  /usr/local/lib/libfftw3f.a: could not read symbols: Bad value +
-  +
-  --without-umfpack (is the UMFPACK library available?+
  
 After configuration is complete, alot of warning about missing librarys are given After configuration is complete, alot of warning about missing librarys are given
Line 81: Line 129:
   * g++: Internal error: Killed (program cc1plus)   * 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:compiling_gcc#compiling_gcc|Compiling GCC from Source]]. 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:compiling_gcc#compiling_gcc|Compiling GCC from Source]].
 +
 +===== Check =====
 +
 +  $ make check
 +
 +notable failures are
 +  scripts/linear-algebra/onenormest.m .................... PASS    3/4    FAIL 1
 +  scripts/optimization/sqp.m ............................. ** On entry to DORGLQ parameter number  5 had an illegal value 
 +    PASS   16/17   FAIL 1
 +
 +Summary:
 +
 +  PASS   6829
 +  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/lib/octave/3.4.3:$LD_LIBRARY_PATH
 +  
 +Log in and out, then 
 +  $ octave --version
 +  GNU Octave, version 3.4.3
 +  Copyright (C) 2011 John W. Eaton and others.
  
/app/dokuwiki/data/attic/guide/compiling_octave.1323116808.txt.gz · Last modified: 2021/12/09 16:42 (external edit)