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/07 13:33]
hamish
guide:compiling_octave [2021/12/09 16:42] (current)
Line 1: Line 1:
-====== Compiling Octave 3.4.3 from Source (UNDER CONSTRUCTION) ======+====== Compiling Octave 3.4.3 from Source ======
  
-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 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. +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 
-Also note that for this guide, all binary and libraries are installed home directory, i.e prefix=$HOMEIf you have not installed GCC a version of GCC in your home directory, do   +  export LD_LIBRARY_PATH=$HOME/lib64:$LD_LIBRARY_PATH 
-  $ export PATH=/opt/gridware/gcc-4.3/bin:$PATH +  export PATH=$HOME/bin:$PATH 
-  export LD_LIBRARY_PATH=/opt/gridware/gcc-4.3/lib/:$LD_LIBRARY_PATH +  export LDFLAGS="-L$HOME/lib64 -L$HOME/lib" 
-  export LD_LIBRARY_PATH=/opt/gridware/gcc-4.3/lib64/:$LD_LIBRARY_PATH +  export CPPFLAGS="-I$HOME/include -L$HOME/lib64 -L$HOME/lib" 
-  $ gcc --version +  export CXXFLAGS=$CPPFLAGS 
-    gcc (GCC) 4.3.4+  export F77=gfortran
  
-Otherwisemake sure the following is at the end of your .bashrc file +log out and in again
-  $ export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH +
-  $ export LD_LIBRARY_PATH=$HOME/lib64:$LD_LIBRARY_PATH +
-  $ export PATH=$HOME/bin:$PATH+
   $  gcc --version   $  gcc --version
   gcc (GCC) 4.6.2   gcc (GCC) 4.6.2
Line 19: Line 16:
  
  
-===== Prerequisite  =====+===== Prerequisites  =====
  
 Before you build Octave, you some libraries need to be built Before you build Octave, you some libraries need to be built
Line 63: Line 60:
 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. 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 (optional)  FIX ME, still get linking errors when compiling octave === +=== FFTW  ===
- +
-"FFTW is a C subroutine library for computing the discrete Fourier transform (DFT)" [[http://www.fftw.org/|FFTW Homepage]] +
- +
-  $ cd ~/scratch +
-  $ wget http://www.fftw.org/fftw-3.3.tar.gz +
-  $ tar -xf fftw-3.3.tar.gz +
-  $ cd fftw-3.3 +
-  $ mkdir BUILD +
-  $ cd BUILD +
-  $ export F77=gfortran +
-  $ export FFLAGS=-fPIC +
-  $ ../configure --prefix=$HOME +
-  $ make +
-  $ make check #test it +
-  $ make install #only if all tests are passed +
- +
  
 +Refer to [[guide:compiling_octave_3_2_4|Compiling Octave 3.2.4 from Source]]
  
 === binutils and libtools (optional) ===  === binutils and libtools (optional) === 
Line 108: Line 89:
   # If all the tests are passed, install into you home directory   # If all the tests are passed, install into you home directory
   $ make install   $ make install
-   
-The tool is required, as if the default ld is used error of the following nature occur during the octave build 
-  $ /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 
-use a later version of ld should hopefully avoid this error... 
  
 If you have not already add the following line in your .bashrc file If you have not already add the following line in your .bashrc file
Line 140: Line 117:
    $ mkdir BUILD    $ mkdir BUILD
    $ cd BUILD    $ cd BUILD
-   $ ../configure --prefix=$HOME --with-blas=$HOME/scratch/lapack-3.4.0/librefblas.a --with-lapack=$HOME/scratch/lapack-3.4.0/liblapack.a --enable-static --disable-dynamic  --disable-docs+   $ ../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 
    $ cp ../AUTHORS ./ #this is a bug in the configuration script...    $ cp ../AUTHORS ./ #this is a bug in the configuration script...
- 
-Possible error 
-  * if error regarding fftw3f or fftw3 are encounter, either use the '--without-fftw3f --without-fftw3' flags in configure, or compile fftw3 as done the compiling Octave 3.2.4 guide. 
  
 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 170: Line 144:
   FAIL     11   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.1323257598.txt.gz · Last modified: 2021/12/09 16:42 (external edit)