Building ROctave

What versions of Octave can I use?
I am not certain. I have tested this with 2.0.17
When I try to compile ROctave, I get a lot of output that looks something like
(CXX=g++ ; export CXX ; /usr/local/bin/mkoctfile -o libConverters.so  -I-I. -I/usr/local/src -I/usr/Rcheck/R//include -D_R_=1 -DUSE_R=1 -L/usr/Rcheck/R//bin -lR   Converters.cc )
cc1plus: warning: changing search order for system directory "/usr/local/include"
cc1plus: warning:   as it has already been specified as a non-system directory
In file included from /usr/local/include/octave-2.0.17/octave/mx-defs.h:72,
                 from /usr/local/include/octave-2.0.17/octave/chMatrix.h:37,
                 from /usr/local/include/octave-2.0.17/octave/mx-base.h:28,
                 from /usr/local/include/octave-2.0.17/octave/ov.h:38,
                 from /usr/local/include/octave-2.0.17/octave/variables.h:38,
                 from /usr/local/include/octave-2.0.17/octave/defun-int.h:26,
                 from /usr/local/include/octave-2.0.17/octave/defun-dld.h:30,
                 from /usr/local/include/octave-2.0.17/octave/oct.h:33,
                 from ROctave.h:3,
                 from Converters.cc:1:
/usr/local/include/octave-2.0.17/octave/oct-cmplx.h:28: syntax error before `;'
   token
In file included from /usr/local/include/octave-2.0.17/octave/chMatrix.h:37,
                 from /usr/local/include/octave-2.0.17/octave/mx-base.h:28,
                 from /usr/local/include/octave-2.0.17/octave/ov.h:38,
                 from /usr/local/include/octave-2.0.17/octave/variables.h:38,
                 from /usr/local/include/octave-2.0.17/octave/defun-int.h:26,
                 from /usr/local/include/octave-2.0.17/octave/defun-dld.h:30,
                 from /usr/local/include/octave-2.0.17/octave/oct.h:33,
                 from ROctave.h:3,
                 from Converters.cc:1:
/usr/local/include/octave-2.0.17/octave/mx-defs.h:81: parse error before `&'
   token
/usr/local/include/octave-2.0.17/octave/mx-defs.h
    .....
What's the problem?
Most likely, there is an incompatibility between Octave and the C++ compiler you are using. I specifically use g++ 2.95.3 when compiling this package as g++ version 3.1 does not work and generates the errors above.

Thanks to John Eaton and Dirk Eddelbuettel, I have access to a machine that I can work on to adapt this package to Octave 2.1.37. Hopefully that will happen reasonably soon.

  • When I tried installing ROctave, I got an error message
     checking for R... /usr/local/bin/R
     You don't seem to have libR.so built. You need this to embed R in Octave.
     See the FAQ.html file for how to build this.
    
    What should I do?
    You need to build libR.so. To do this, you will have to build R from source. And you will need to configure it with the argument --enable-R-shlib. So download the source and change directory to it and issue the commands
       ./configure --enable-R-shlib
       make
    
  • Running ROctave

    When I run Octave and try to call R, I get an error message about a .so file not being available and an error about ROctave_callR.
    Getting the LD_LIBRARY_PATH correct is important. Make certain to include $R_HOME/bin in the setting, where $R_HOME is the location of the R installation. (You can find it via the command R RHOME.)
    When I run Octave and try to call an R function, I get something like
    octave:1> ROctave_callR("rnorm", 10)
    error: `ROctave_callR' undefined near line 1 column 1
    error: evaluating index expression near line 1, column 1
    octave:1>
    
    The problem is that Octave cannot find the .oct files you built when you compiled the ROctave module. You need to add the ROctave/src directory to your OCTAVE_PATH environmnent variable and re-start Octave.

    Duncan Temple Lang <duncan@research.bell-labs.com>
    Last modified: Tue Oct 29 20:26:19 UTC 2002