Installing octave from source

From Notes_Wiki
Revision as of 04:30, 10 November 2012 by Saurabh (talk | contribs) (Created page with "=Installing Octave from source= ==Installing Octave from source in CentOS-5.3== #First install fltk, fftw and gperf using yum #Download latest stable source of octave from h...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Installing Octave from source

Installing Octave from source in CentOS-5.3

  1. First install fltk, fftw and gperf using yum
  2. Download latest stable source of octave from http://www.gnu.org/software/octave/download.html
  3. Run command 'export F77=gfortran'
  4. Configure octave using `./configure'. Normal configure may not work as will cause errors during compilation. It is necessary to use gfortan instead of g77 as GNU f77 (also known as g77) will not be updated beyond 3.4.6, and the 3.4.6 libraries are not quite compatible with 4.1.x. libraries that are installed as part of the current Centos gcc/g++ development tools. This is the cause of the "__cxa_get_exception_ptr" error as it tries to get the C/C++ and FORTRAN files to play nice together. Luckily GNU gfortran (with the same version libraries as g++) works very nicely with the octave source. Same information is also available on http://www.centos.org/modules/newbb/viewtopic.php?topic_id=7958
    Ensure that output of configure command has line "Fortran compiler: gfortran -O" near end.
  5. Run octave in place using `./run-octave'
  6. Check installation with `make check'
  7. If you have root access then you can install octave in default path using `make install'. If you do make install you can remove the source directory.


Creating graphs with octave installed from source on CentOS

Some times while using plot() function we may get error

gnuplot> if (exists("GPVAL_TERM")) print GPVAL_TERM; else print NaN
                    ^
         line 0: invalid expression 

error: Invalid call to strcat.  Correct usage is:

 -- Function File:  strcat (S1, S2, ...)

This is since the version of gnuplot is older and does not supports the call used by octave. Hence one should upgrade to latest gnuplot by compiling it from source. You can download gnuplot from sourceforge page at http://sourceforge.net/projects/gnuplot/files/