Info, comments, help and suggestions:
persquare@mac.com

Octave

Update 2001-10-05: These instructions does not work with Mac OS X 10.1
Update 2001-10-26:
AFAIK a version of Octave compiled using OS X 10.0.4 will run without problems under 10.1
Ben Singer is working on a fix for compiling under 10.1, help him out... More info here
Added a link to Ben's page on how to enable dynamic linking in Octave (for .oct files)
Added a bug to the buglist below: tempnam() is broken on OS X 10.0.4

Info: Matlab-like package for numerical analysis. 
Screenshots: [1] 
Homepage: www.octave.org
News:
Links: Ben Singers page on how to enable dynamic linking
       Easy install using Fink is available
Needs: f2c and texinfo (or TeX)
Recommended: GNUPlot (XWindows) for plotting and TeX for printed docs (provides texinfo too).

How To install Octave under MacOS X 10.0.x.

  1. Get the Octave 2.1.34 source tarball here
  2. Unpack the sources
  3. Get this patch and put it in the directory containing the source folder
  4. From the terminal, cd to the octave/ directory and issue the command:
    [~/tmp/octave] user % patch -p1 <../octave_patch
  5. Replace config.guess and config.sub with the ones in /usr/libexec/ by issuing the command:
    cp /usr/libexec/config.* .
    cp /usr/libexec/config.* kpathsea/.
  6. Set the environment variable CPPFLAGS:
    setenv CPPFLAGS -no-cpp-precomp
  7. Type sh ./configure to create the Makefiles from Makefile.in et al.
  8. Edit Makeconf so that line 105:
    UGLY_DEFS = -DOCTAVE_SOURCE=1 -DSEPCHAR=\':\' -DSEPCHAR_STR=\\\":\\\" -DUSE_READLINE=1
    becomes
    UGLY_DEFS = -DOCTAVE_SOURCE=1 -DSEPCHAR=\':\' -DSEPCHAR_STR=\\\\\":\\\\\" -DUSE_READLINE=1
  9. In directory src, issue the following command
    c++ -c -no-cpp-precomp -I. -I.. -I../liboctave -I../libcruft/misc -I../glob -DHAVE_CONFIG_H \
    -fno-implicit-templates -g -O2 -Wall ArrayInst.cc -o ArrayInst.o

    Be careful if you copy and paste here, it is a single command!
    This should create a file ArrayInst.o in src/
  10. cd .. back to the top directory and run
    make
    to compile and link the program.
    • If you get an error, that you have to rerun ranlib on libkpathsea.a, just type
      ranlib kpathsea/libkpathsea.a
      followed by
      make
    • By default, debugging is on. Thrillseekers might want to experiment with
      make CXXFLAGS=-O2 CFLAGS=-O2
      See the INSTALL file for more info.
  11. To install Octave type:
    sudo make install and give your admin password at the prompt.
  12. Extras:
    To display bitmap images in your preferred (tiff-)viewer, which by default is Preview.app,
    you need to install "convert" from the TexShop page and place the file image.m in
    /usr/local/share/octave/2.1.34/site/m/image/
    by typing
    sudo cp image.m /usr/local/share/octave/2.1.34/site/m/image/
    This will have effect on the following commands in octave: image, imshow, imagesc


Bugs: OS X 10.0.x has a broken tempnam() function. 
      It is not critical(?) and could be solved by using tmpnam() instead. 
      A patch will be provided at some point in the future... 

Gotchas: The Fink version of f2c seems to cause trouble, use the one provided here.

Other: This patch is not beautiful, but it is a start! 
       NB. It will probably be made unneccessary by the next devtool release slated for September.  
       
       Linking against ATLAS, PPC optimization, altivec etc. is missing. (Feel free to help out!)

       The screenshot shows an (experimental and buggy) Aqua-native terminal for GNUPlot, i.e. no XWindows needed.  
       
       Thanks to Thomas Torsney-Weir for providing the final fixes needed and everybody who has provided feedback and advice!   

f2c

Info: f2c - Fortran to C translater
Homepage: www.netlib.org
Needs: Internet connection

How to build and install f2c:

  1. Get the script buildf2c
  2. Type chmod +x buildf2c
    to make it executable.
  3. Type sudo sh ./buildf2c
    build and install f2c (hence the superuser do).

Other: If you have downloaded the f2c tarball, uncomment the wget command in section 1, 
       i.e. # wget --passive-ftp ...