Editing Installing MacOS X Bundle

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{Warning|This page is outdated (October 2019). For more information, see [[Octave for macOS]].}}
'''Introduction to the Bundle'''
Installing Octave on a mac should be a breeze since is there a nice bundle that's easily downloaded and contains everything that you will need .  But there's a lot of new users that run into problems, and for good reason. If you are a mac user and are suddenly faced with installing stuff that requires you to delve into the bowels of your computer for the first time (or even the second or third) - it can be mighty intimidating and success can be illusive.  This writer knows first hand. So this is largely for those at the low end of the experience spectrum, although there may be some tips that help the power user community if they have need to make Octave work in the mac world.  I hope so, because the things they contribute certainly help me out a lot.


These install instructions are verified to allow the [http://sourceforge.net/projects/octave/files/Octave%20MacOSX%20Binary/2011-04-21%20binary%20of%20Octave%203.4.0/ October 04, 2011 binary for Octave 3.4.0 (hosted on sourceforge)] to run on MacOS 10.7They do not work for MacOS 10.8.
As you probably know, Octave is a numerical computation software platform.  It can calculate just about anything that you can imagine.  But if you want to see the results graphically, you need a plotting system to make that happen.  That's another application called Gnuplot.  Gnuplot takes output from Octave and plots it in windows on your screen - or sends it off to print or whatever you want to do.  This requires a windowing system - (now we're getting a bit closer to the bowels) - and the most common one is X11.  This is installed by default on OS X 10.5 and above.  However many mac users prefer the appearance of another windowing system - Aquaterm.  So this part of the wiki helps you to install Octave and make it plot your results through Gnuplot using the Aquaterm windowing system.  At the end I'll try and deal with some of the issues that arise during installation that might make it seem like 'it just doesn't work'.
'''Let's do it'''
The following is current as of 20120105.  The installation process has been confirmed on an iMac running OS X 10.6.8 that has never previously had octave or gnuplot installed. 
Download this binary  (octave-3.4.0-i386.dmg) at:
http://sourceforge.net/projects/octave/files/Octave%20MacOSX%20Binary/2011-04-21%20binary%20of%20Octave%203.4.0/  
It's the latest version of octave for which an OS X binary is available.
Mount (double click) the dmg.
Look in the 'Extras' folder and find a gnuplot-4.4.3-aqua-i386.dmg disc image.
This is a nice OS X binary of an up to date version of gnuplot and, ironically, may be the only place such a gnuplot binary exists for OS X.  As an added bonus this gnuplot package includes and relies on Aquaterm the windowing system that many Mac users feel produces more elegant plots than X11.
Mount (double click) this dmg.
Move the 'Gnuplot' icon to your Applications folder. For purpose of this discussion - this is assumed to be /Applications.  If you are using a local Applications folder (/~/Applications) appropriate modification of the paths specified below will be necessary.
At this point, Aquaterm is now also installed. It is located at /Applications/Gnuplot.app/Contents/Resources/lib/Aquaterm.app  If you need it for some other application, this is the path that will find it. But don't move it to the upper level of the Applications folder - gnuplot will be looking for it where it self-installs. (To inspect the contents of an .app right click or control-click on it and select 'show package contents')
Move the 'Octave' icon from the first .dmg to the same folder (/Applications).  It is strongly suggested that gnuplot be installed before octave.
Now you have everything you need to run octave+gnuplot+aquaterm. You can put the octave and gnuplot icons in the dock and either will open in a terminal window with a simple 'click'To test octave, click its icon, and the octave prompt should appear in a new terminal window along with some splash screen information. Then type 'sombrero(24)' at the octave prompt and after a while aquaterm should open and the multicolor sombrero plot should appear.


= Download the DMG =
'''Problems, problems, problems ........'''


There is an experimental dmg for Octave 4.0.0. See the bottom of [http://octave.1599824.n4.nabble.com/Mac-OS-Binary-td4673521.html#a4673576 this mailing list discussion]. Testers are very welcome.
If you did all of the above and there is no result, most likely you got the octave prompt, typed the 'sombrero(24)' test, but no plot showed up. You probably got some error message that included the line 'sh: gnuplot: command not found'.  This means (surprise, surprise) that octave couldn't find gnuplot in order to pass on the plot information. We can fix that, but it requires some unix magic on the command line. We are going to create 'dummy' applications at a location where OS X will search and be sure to find them. Open a new terminal window (/Applications/Utilities/Terminal)  and do (ignoring the # comments):


The latest MacOS X binary (DMG) available is for Octave-3.4.0. Click on this [http://sourceforge.net/projects/octave/files/Octave%20MacOSX%20Binary/2011-04-21%20binary%20of%20Octave%203.4.0/ link] to download.
> sudo touch /usr/bin/gnuplot              # creates an empty 'dummy' gnuplot file in directory /usr/bin which is included in most  PATHs. sudo invokes the 'superuser' or administrator and will ask for a password .... then:


Once it has been downloaded, double-click on the dmg to mount the disk image. It is recommended that Gnuplot is installed prior to Octave.
> ln -s  /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot  /usr/bin/gnuplot      #creates a link between the binary in the app in your Applications folder and the new dummy gnuplot file (in the bowels).


= Install Gnuplot & Aquaterm =
> touch /usr/bin/octave    # while we're at it, may as well do the same thing for octave


NOTE: The following instructions are for the Gnuplot in the 'Extras' folder, which DOES NOT WORK, due to some library version issues. Instead you could install a Gnuplot binary from http://www.miscdebris.net/upload/gnuplot-4.2.5-i386.dmg.  Or you could try using MacPorts to install Gnuplot.
> ln -s /Applications/Octave.app/Contents/Resources/octave  /usr/bin/octave    # this is a good way of inserting octave in your PATH so it can be started from the command line


Look in the 'Extras' folder and find the gnuplot-4.4.3-aqua-i386.dmg disc imageDouble-click this dmg to mount the gnuplot disk image.
... # Now to make sure that /usr/bin is in your path do:


On this disk is the OS X binary for Gnuplot. The Gnuplot package includes and relies on Aquaterm for displaying plots using [http://en.wikipedia.org/wiki/Quartz_(graphics_layer) Apple's Quartz graphics layer]. Alternatively, X11 can be used. If your entire data set is easily visible and you do not need to zoom in, you may prefer the pleasant anti-aliasing features of Quartz and Aquaterm.  On the other hand, if your data set is too large or complicated to be easily visible, you may prefer to use X11, which allows you to zoom in and out of regions, set crosshairs at points, and other more advanced features.  Aquaterm is the default, but you can change the default to X11 by creating a file called .bash_profile in your home directory (note the period at the beginning of the file name) and adding the line "export GNUTERM=x11" (without the quotes).
> env


Move the 'gnuplot' icon to your Applications folder. For purpose of this discussion - this is assumed to be /Applications.  If you are using a local Applications folder (~/Applications) appropriate modification of the paths specified below will be necessary.
... # there should be several lines of text in response including something like :  PATH=/opt/local/bin:/opt/local/sbin:/usr/local:/bin:/sbin:'''/usr/bin:'''/usr/sbin:/usr/texbin:/usr/local/bin  -- check to see that /usr/bin: is included


This Gnuplot application includes Aquaterm.  It is located at /Applications/gnuplot.app/Contents/Resources/lib/Aquaterm.app  If you need it for some other application, this is the path that will find itBut don't move it to the upper level of the Applications folder, or else Gnuplot will not know where to find it.
If it is, octave and gnuplot should work fine now. If not, we need to go to the .bashrc fileThis is a(n invisible) file that sets things that are important to you up every time you open a new terminal window.


= Install Octave =
touch .bashrc                  # creates .bashrc file if one doesn't exist
open .bashrc                  # opens it in your editor (probably Textedit)


Move the 'Octave' icon from the first .dmg to the Applications folder (/Applications).
... #  type this in the editor:


Now you have everything you need to run Octave, Gnuplot, and Aquaterm.  You can put the Octave and Gnuplot icons in the dock and either will open in a terminal window with a simple 'click'.  To test Octave, click its icon, and the Octave prompt should appear in a new terminal window along with some splash screen information.  Then type 'sombrero(24)' at the Octave prompt and after a while aquaterm will open and the multicolor sombrero plot should appear. 
PATH=$PATH:/usr/bin
Export PATH


= Running Octave and Gnuplot from a Terminal =
... # save and close


These instructions assume you have already placed Octave and Gnuplot into the Applications folder.
Things should work now ....... Open a new terminal window and type 'octave'  then 'sombrero(24)' at the prompt.
Starting octave from the command line requires these steps to inform bash (your shell) where the octave binary is located.


Starting Octave from the command line requires one further step to inform bash (your shell) where the Octave binary is located.  This is accomplished through the bash initialization file ~/.bashrc (the leading "." means it's normally invisible in the finder).  To run Octave and Gnuplot from a terminal, symbolic links will be used.  The symbolic links will be placed in /usr/local/bin. It is a good idea to verify that neither /usr/local/bin/gnuplot or /usr/local/bin/octave already exist there, as they will be replaced.
'''Some Other Solutions'''


* Open a new terminal window, and enter the commands below.
There are other issues that come up that are largely a function of the way you have your system set up and, perhaps, what remnants of octave/gnuplot/aquaterm/X11 you have floating around in it. Following are things that might help when it just refuses to work.
** {{Codeline|sudo ln -sf /Applications/gnuplot.app/Contents/Resources/bin/gnuplot /usr/local/bin/gnuplot}}
** {{Codeline|sudo ln -sf /Applications/Octave.app/Contents/Resources/bin/octave /usr/local/bin/octave}}
* Test that everything is ok.
** In a Terminal window type the command below.
*** {{Codeline|octave}}
** Octave should now be running. To test Gnuplot / Aquaterm, try a plot.
*** {{Codeline|sombrero ()}}


If Octave did not run ''(or if octave is running but the sombrero() command doesn't appear to do anything)'', check to ensure that your PATH includes /usr/local/bin.
Open .bashrc and add:
export GNUTERMAPP=/Applications/AquaTerm.app
export GNUTERM=aqua


* From the Terminal prompt, type,
save and close
** {{Codeline|env}}
* If the PATH does not include /usr/local/bin, type the commands below.
** Open ~/.bashrc in an editor
*** {{Codeline|touch ~/.bashrc}}
*** {{Codeline|open ~/.bashrc}}
** Add the line below to the contents of ~/.bashrc
*** {{Codeline|<nowiki>export PATH=$PATH:/usr/local/bin</nowiki>}}
** Save ~/.bashrc and exit
* If the PATH does include /usr/local/bin, help may be requested by posting to [https://mailman.cae.wisc.edu/listinfo/help-octave Octave's email list]. Please provide a detailed description of what you've tried and what the results were.
 
[[Category:Outdated pages]]
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: