From Octave
Jump to: navigation, search

Octave has too many configure options. On IRIX you can choose the C compiler (gcc vs cc), the Fortran compiler (g77 vs f77), the C++ compiler (g++ vs CC), the FFT library (FFTW or FFTPACK), the linear algebra library (scs, ATLAS or LAPACK) and others. Some options do not work together, such as scs and g++.

The following script allows you to easily specify the options you want use while encoding the constraints for my specific setup. Save it as octaveconf somewhere in your path and type octaveconf for help. You may need to modify details such as the location of the compiler.

Perhaps we want to build a script covering multiple systems which encodes knowledge of compilers and environments other than gcc.

IRIX Issues[edit]

rpath isn't being set correctly in configure[edit]

If my g++ 3.2 environment was set up properly, this would be a matter of converting the RLD_FLAG='...' line for sgi into '-rpath $(octlibdir)', but in my current setup I need -rpath /usr/local/lib:$(octlibdir) because I can't figure out how to get /usr/local/lib on to the default load library path.

My octaveconf script converts RLD_PATH in Makeconf after ./configure runs. --enable-rpath=... would do the same job, except that will need to be patched to support this.

syscalls has issues with 64 bit numbers[edit]

This is a problem for fs.ino() and fs.size(). It is not correct to cast them to double, but that is what I am doing now. Until we figure out a nice way to limit the type explosion in the operator table, I'm not keen to and any more basic numeric types to octave. The fact that we need scalar, complex scalar, matrix, complex matrix and maybe sparse and complex sparse types for each precision doesn't help.

Mips PRO CC 7.3 is not ISO compliant[edit]

The following issues may go away when we upgrade to 7.4.

a. I needed to fake the <cxxx> headers.See here cmath is particularly tricky --- some lines therein may be copied from the GNU stdc++ lib which I referenced while doing this.

b. I get the following errors when building, but commenting out the offending functions seems to solve the problem:

 CC -c  -I. -I.. -I../liboctave -I../src -I../libcruft/misc  -I../glob -I../glob -DHAVE_CONFIG_H  -g -O2 -LANG:std \
 -I/data/freeware/src/CC-isoheaders -I/usr/local/include -woff 3333 ./TEMPLATE-INST/ -o Array-tc.o 
 cc-3234 CC: ERROR File = ./TEMPLATE-INST/, Line = 44
   Explicit specialization of function "Array<octave_value>::resize_fill_value" must precede its first use.
 Array<octave_value>::resize_fill_value (void)
 cc-1136 CC: ERROR File = oct-obj.h, Line = 70
   Too many arguments in function call.
     { ::operator delete (p, static_cast<void *> (0)); }

SGI has multiple ABIs, and the linker complains if it has to guess[edit]

To suppress the warnings, the link line needs -L/usr/lib32/mips4. I haven't tried compiling for lib64. octaveconf predefines LDFLAGS to include this, -L/usr/local/lib (for readline) and -rpath /usr/local/lib (for readline and libc++). There may be a problem with multiple -rpath options in src/Makefile which I haven't yet resolved automatically.

scs and g++ 3.2 won't work together[edit]

Configure --without-lapack --without-blas in this case.


# Octave configure script for jazz.  Type octaveconf for options.
# Notes:
# (1) The gcc compiler we are using is gcc 3.2 stored in /usr/local/bin.
#     The gcc 3.0.4 compiler in /usr/freeware/bin also works, except that
#     libstdc++ in /usr/local/lib trumps that in /usr/freeware/lib. We need
#     -L/usr/local/lib on the command line to pick up libreadline, thus
#     we are forced to use /usr/local/lib
# (2) atlas is not yet compiled for jazz.
# (3) fftw will not compile with the current octave sources (2003-01-01)
# (4) We are using a slightly old version of the SGI compiler.  The new
#     one is more standards compliant.  Fix the CXXFLAGS after we upgrade.
# (5) We need to hack -rpath because --enable-rpath doesn't allow us to
#     override the RLD_FLAG options.  Fix configure so that we can.
# (6) We can't use scs with g++ until we resolve the bus error that results.
# Usage notes
if test -z "$*" || test "$1" = "--help"; then cat <<EOF
Configure octave for jazz.
First change to the root octave directory:
   cd /data/freeware/src/octaveXXX
where XXX is the version of octave you are compiling.
If compiling from CVS, XXX is blank and you need to do the following:
   gmake distclean
   cvs -q update -d
   # resolve any conflicts then do the following
Next configure octave as appropriate. Leave options blank for the default.
   ../octaveconf  options
where options are chosen from the following
   default             use defaults for all options
   shared|static       build shared or static libs
   cc|gcc              C compiler
   CC|g++              C++ compiler
   f77|g77             Fortran compiler
   fftpack|fftw        FFT library
   scs|atlas|lapack    Linear algebra library
The first option in each group is the default.
# Make sure we are in the octave root
if test ! -f "src/"; then
   echo "Change to the octave root directory first"
# Process the options
for opt in $*; do
   case "$opt" in
       shared)  shared=yes ;;
       static)  shared=no ;;
       cc)      cc=cc ;;
       gcc)     cc=gcc ;;
       CC)      cxx=CC ;;
       g++)     cxx=g++ ;;
       f77)     f77=f77 ;;
       g77)     f77=g77 ;;
       fftw)    fft=fftw ;;
       fftpack) fft=fftpack ;;
       scs)     lapack=scs ;;
       atlas)   lapack=atlas ;;
       lapack)  lapack=lapack ;;
       default) ;;
       *)       otheropts="$otheropts $opt" ;;
# Assign defaults
: ${shared:=yes} ${cc:=cc} ${cxx:=CC} ${f77:=f77} ${fft:=fftpack} ${lapack:=scs}
# Which FFT library to use
case "$fft" in
   fftw)    fftopts='--with-fftw="-I/usr/freeware/include -L/usr/freeware/lib32 -lfftw"' ;;
   fftpack) fftopts= ;;
# Build static or shared
case "$shared" in
   yes) sharedopts="--disable-static --enable-shared" ;;
   no)  sharedopts="--disable-shared --enable-static --enable-dl" ;;
# Which C compiler to use
case "$cc" in
   cc)  CC=cc CFLAGS="-g -O -I/usr/local/include" ;;
   gcc) CC=/usr/local/bin/gcc CFLAGS="-g -O -I/usr/local/include" ;;
# Which C++ compiler to use.
# The following notes apply to the SGI compiler
#   1. Warning 1682 occurs when a overloaded virtual function is only
#      partially instantiated for a particular class
#      Warning 3333 says placement delete has been disabled.
#   2. /data/freeware/src/CC-isoheaders is my implementation of the
#      standard C++ headers corresponding to the standard C headers.
#   3. LANG:std says to follow the ISO standards
#   Points 2 and 3 will be resolved when the CC compiler is upgraded.
case "$cxx" in
   CC)  CXX=CC CXXFLAGS="-g -O2 -LANG:std -I/data/freeware/src/CC-isoheaders -I/usr/local/include -woff 3333" ;;
   g++) CXX=/usr/local/bin/g++ CXXFLAGS="-g -O2 -Wall -I/usr/local/include" ;;
# Which Fortran compiler to use
case "$f77" in
   f77) F77=f77 FFLAGS="-g -O" ;;
   g77) F77=/usr/local/bin/g77 FFLAGS="-g -O" ;;
# Need -L/usr/local/lib to find libreadline.
# Need -L/usr/lib32/mips4 to avoid complaints about mips3 vs mips4.
LDFLAGS="-L/usr/local/lib -L/usr/lib32/mips4 -rpath /usr/local/lib"
# Hack the configure script so that it doesn't find scs unless we are
# explicitly looking for it.
# Override scs if using g++ until we resolve the bus error that results
if test "$cxx" = "g++" -a "$lapack" = scs ; then lapack=lapack; fi
case "$lapack" in
 lapack) lapackopts="--without-lapack --without-blas" ;;
 scs)    lapackopts="" ;; # configure will find scs if it exists
 atlas)  echo "Atlas is not yet compiled for jazz" && exit ;;
cp configure configure.bak
sed $sedopts < configure.bak > configure
# Do the actual configure
./configure $sharedopts $lapackopts $fftopts $otheropts
# Hack the resulting Makeconf so that it includes the correct RLD_PATH
# New versions of octave accept --enable-rpath='-rpath ...' so the
# the sed hack below is not necessary.
case "$shared" in
 yes) rld='-rpath /usr/local/lib:$(octlibdir)' ;;
 no) rld='-rpath /usr/local/lib' ;;
cp Makeconf Makeconf.bak
sed -e"s,RLD_FLAG *=.*$,RLD_FLAG = $rld," < Makeconf.bak > Makeconf