testing without installing

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

testing without installing

Paul Kienzle-2
Here is a public domain script which I wrote to test a
new version of octave without installing it.  Is there
a better way to do this?

Paul Kienzle
[hidden email]


#!/bin/sh

if test "$1" = --help ; then cat <<EOF
Run the compiled octave without installing it.  Make sure you are in
the octave root directory before running.

This may not work if octave is configured using --enable-shared --with-rpath,
and if you have already installed the current version. That's because the
rpath specified in the binary takes precedence over LD_LIBRARY_PATH.  If
you encounter this problem, you can:
   (a) use --preload as the first option to preload the libraries (this
       works on Linux, but maybe not on other OSes),
   (b) reconfigure using --enable-static --disable-shared --enable-dl,
   (c) change OCTAVE_VERSION in src/version.h, reconfigure and recompile, or
   (d) reconfigure using --without-rpath and recompile (but you will need to
       reconfigure using --with-rpath and recompile before installing).

Octave is run without sourcing .octaverc first.  You can do this explicitly
on startup using source("~/.octaverc").
EOF
    exit
fi

if test ! -f src/octave.cc ; then
    echo "Not in the octave root directory"
    exit
fi

BASE=`pwd`
OCTAVE=$BASE/src/octave
ARGS="--norc --path .:$BASE/scripts//:$BASE/src"

if test "$1" = --preload ; then
    shift
    LIBCRUFT=$BASE/libcruft/libcruft.so
    LIBOCTAVE=$BASE/liboctave/liboctave.so
    LIBOCTINTERP=$BASE/src/liboctinterp.so
    PRELOAD=$LIBCRUFT:$LIBOCTAVE:$LIBOCTINTERP
    LD_PRELOAD=$PRELOAD ldd $OCTAVE
    LD_PRELOAD=$PRELOAD $OCTAVE $ARGS $*
else
    LIBPATH=$BASE/libcruft:$BASE/liboctave:$BASE/src
    LD_LIBRARY_PATH=$LIBPATH ldd $OCTAVE
    LD_LIBRARY_PATH=$LIBPATH $OCTAVE $ARGS $*
fi