Important notice!

The information here is getting old and since I don't have the time to update it,
I will retire this site.
Whatever is on these pages will be left for reference.

Octave

Update 2002-01-03:Updated info for Mac OS X 10.1.2/octave 2.1.35
Update 2001-11-09: Moved extras to the Matlab replacement corner
Update 2001-11-07: From now on, I will focus on integrating Octave with Aqua, see main page for news on that.
Update 2001-11-07: Fink has Octave 2.1.35 for Mac OS X 10.1 - use and support fink!
Update 2001-10-30: These instructions are for Mac OS X 10.1, old info for 10.0.x is here.

Info: Matlab-like package for numerical analysis. 

Screenshots: [1]
 
Homepage: www.octave.org

Links: Ben Singers page on how to compile octave for OS X along with the bugs he found.
       Octave-forge provides Matlab compatibility and more
       Easy install using Fink is available
       
Needs: f2c and texinfo (or TeX)
 
Recommended: You need dlcompat for dynamic loading (.oct files),
             GNUPlot (XWindows) for plotting and 
             TeX for printed docs (provides texinfo too).

How To install Octave under MacOS X 10.1.2 the hard way. (I really recommend using Fink)

  1. Get the Octave 2.1.35 source tarball here
  2. Unpack the sources: gnutar xzf octave-2.1.35.tar.gz
  3. 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/.

  4. Set the environment variable CPPFLAGS:
    setenv CPPFLAGS -no-cpp-precomp
  5. If you have dlcompat, type
    sh ./configure --enable-dl
    otherwise leave out the --enable-dl part.
  6. 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
    and find and change the following flags (still in Makeconf)
    CXXFLAGS = -O2 -Wall
    XTRA_CXXFLAGS = -fno-coalesce-templates -fno-implicit-templates
    LDFLAGS = -Xlinker -m
    If you chose to enable dynamic loading above, in Makeconf, find and change
    SH_LDFLAGS = -bundle -bundle_loader /usr/local/bin/octave
    RDYNAMIC_FLAG =
    Finally, remove mathlib (-lm) from LIBS
    LIBS = -lreadline -lcurses -ldl
    and add the following kludge after that line:
    LIBSTDC++_OBJ = PlotFile.o filebuf.o iofscanf.o iostream.o pfstream.o \
    		SFile.o filedoalloc.o iofsetpos.o iostrerror.o procbuf.o \
    		builtinbuf.o fileops.o iogetc.o ioungetc.o sbform.o cleanup.o \
    		floatconv.o iogetdelim.o iovfprintf.o sbgetline.o cmathi.o \
    		fstream.o iogetline.o iovfscanf.o sbscan.o cstdlibi.o \
    		indstream.o ioignore.o isgetline.o stdexcepti.o cstringi.o \
    		initio.o iomanip.o isgetsb.o stdiostream.o cstrio.o \
    		ioassign.o iopadn.o isscan.o stlinst.o cstrmain.o ioextend.o \
    		iopopen.o ldcomio.o stream.o dcomio.o iofclose.o ioprims.o \
    		ldcomplex.o streambuf.o dcomplex.o iofeof.o ioprintf.o osform.o \
    		strops.o editbuf.o ioferror.o ioputc.o outfloat.o strstream.o \
    		fcomio.o iofgetpos.o ioseekoff.o parsestream.o valarray.o \
    		fcomplex.o iofread.o ioseekpos.o peekc.o

    In src/, edit Makefile by changing the octave target to:
    octave: stamp-prereq $(LIBRARIES) stamp-oct-links \
    		octave.o builtins.o ops.o $(DLD_STATIC_OBJ)
    		ar -x /usr/lib/libstdc++.a
    		$(LD_CXX) $(CPPFLAGS) $(ALL_CXXFLAGS) $(RDYNAMIC_FLAG) \
    		$(ALL_LDFLAGS) -o octave \
    		octave.o builtins.o ops.o $(XERBLA) $(DLD_STATIC_OBJ) \
    		$(OCTAVE_LFLAGS) \
    		$(OCTAVE_LIBS) \
    		$(LEXLIB) $(TERMLIBS) $(BLAS_LIBS) $(LIBS) $(FLIBS) $(LIBSTDC++_OBJ)
    and in doc/interpreter/ change the munge-texi target to:
    munge-texi: munge-texi.o Map-s.o
    		ar -x /usr/lib/libstdc++.a
            	$(CXX) $(CPPFLAGS) $(ALL_CXXFLAGS) $(ALL_LDFLAGS) -o $@ $^ $(LIBSTDC++_OBJ)

  7. cd .. back to the top directory and run
    make
    to compile and link the program.
  8. To install Octave type:
    sudo make install and give your admin password at the prompt.

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

Gotchas: -

Other:   When Apple fixes libstdc++ and C++ templates the neccessary changes for OSX/Darwin should go into octave's sources.  
       
         Linking against ATLAS is possible, see Fink 

         The screenshot shows an Aqua-native terminal for GNUPlot, i.e. no XWindows needed.  
       
         Benjamin Singer did all the brain work on this one... 

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, comment out the curl command in section 1, 
       i.e. # curl --passive-ftp ...