Octave (itch) Mac OS
Octave (itch) Mac OS
This section lists situations/commands where Octave behavessignificantly different from Matlab and where this is relevant forthe learning and teaching of Matlab at the School of EngineeringSciences.
- OS: Sierra 10.12+ Processor: x64 architecture with SSE2 Memory: 500 MB RAM Graphics: Metal capable Intel or AMD GPUs Storage: 200 MB available space Additional Notes: Apple officially supported drivers Linux. OS: Ubuntu 16.04 and Ubuntu 18.04 Processor: x64 architecture with SSE2 instruction set support Memory: 500 MB RAM.
- I am running Mac OS Mavericks 10.9.4. Installed Octave 3.8.1 via Homebrew which came with gnuplot 4.6. Have XQuartz 2.7.6 installed. I restarted my computer after all was done. In order to plot in octave-cli everyone states that I should just 'set terminal x11' BUT I don't even have x11 listed when I run 'set terminal' in gnuplot.
- Hi, I installed Octave and the Jupyter kernel today. Just typing octave in the terminal didn't work because I should specify the path. In the file /.bashprofile I made an alias to make this wo.
- The version I have tried on a Mac OS X system (although having the same version number 3.0.0) did by default not have the octave package odepkg installed and did therefore not know about the ode45 command (but has alternative commands such as lsode that we can use instead).
Students are invited to report incompatibility issues not listed here(by email to fangohr@soton.ac.uk).
The version I have tried on a Mac OS X system (although having the same version number 3.0.0) did by default not have the octave package odepkg installed and did therefore not know about the ode45 command (but has alternative commands such as lsode that we can use instead).
4.1 General observations
4.1.1 Windows
I have done a few tests (creation of vectors, plotting of x andagainst y-vector, check that ode45 command exists) with version3.0 on MS Windows, and Octave seems to behave exactly like Matlab(although the ouput displayed on screen sometimes has a slightly differentformat).
Hints:
- to close a figure window, just press q (when the focus is on this window)
4.1.2 Mac OS X
The version I have tried on a Mac OS X system (although having thesame version number 3.0.0) did by default not have the octave packageodepkg installed and did therefore not know about the ode45command (but has alternative commands such as lsode that we can useinstead). All octave packages can be downloaded fromhttp://octave.sourceforge.net/packages.html and installed with pkginstall FILENAME (see octave web pages for further instructions).
4.1.3 Linux/Unix
There is of course octave for Linux (originally, Octave was developed onUnix/Linux and only later ported to Windows and Mac OS X).
4.2 ODE45 - function handle
The ode45 function in Matlab can be called like this:
or like this:
The first version passes the function name rhs as a string to theode45 function, the other one as a handle.
Octave only supports the second option, so in Octave the correspondingcommand has to read:
4.3 ODE45 - default accuracy
Matlab's default settings for allowed absolute and relative errortolerances (and related to that step size in the integration) differfrom Octave's. Octave has a larger step size. To reduce this, one canuse the following settings
Reduce the maximum allowed step size (MaxStep), and the initial step size:
(It seems that the MaxStep does not apply to the very first step-- that's why we need to set both.)
Then pass this options object vopt to the ode45 command like this:
Or reduce the absolute and/or relative tolerances to enforce smaller integration steps:
All parameters can be combined, for example:
[Tested with octave GNU Octave, version 3.0.3 on Mac OS X]
4.4 Editing m-files
A student reports that on Mac OS X, they cannot type edit myfile.mto open an editor to edit the file. The edit command (in Matlab) willstart an editor instructing it to load the file myfile.m if itexists, or creating an empty file and loading it into the editor ifthe file does not yet exist. The default editor is part of the MATLABGraphical User Interface.
As there is no such GUI for Octave, the edit command in Octave (on anyoperating system) is likely to try to invoke the default editor thathas been defined. On Unix (this includes Linux and Mac OS X), it iscommon to set an environment variable with nameEDITOR to contain the name of the desired editor.
If you find that the edit myfile.m command does not worksatisfactorily, the simplest work around is not to use it. Instead youcan open the m-file directly in some text editor of your choice. Youneed to make sure you save the file myfile.m, before you execute the file byeither typing myfile at the Octave prompt, or calling myfile()if myfile.m contains a function.
You need to make sure the octave program is in the same workingdirectory as the file. You can use the commands pwd (Print WorkingDirectory) in octave to display the current directory and cd toChange Directory:
Any plain text editorwill do. On all platforms Emacs is available (although it might needsome getting used to): We recommend XEmacs for Windows, Emacs orXEmacs for Linux and Aquamacs for Mac OS X. All of these support syntaxhighlighting for matlab files (and also for LaTeX files).
Another often used cross-platform editor is VIM.
You can also use Textedit on Mac OS X (which is very basic but comeswith Mac OS X preinstalled), edit on Windows (which is even morebasic) or any other source code text editor (see list of these onWikipedia entry for Source code editor).
4.5 Further resources
See also FAQ on Matlab compatibility at http://wiki.octave.org/FAQ#Differences_between_Octave_and_Matlab
and this Wiki entry http://en.wikibooks.org/wiki/MATLAB_Programming/Differences_between_Octave_and_MATLAB
Octave 4.2.2 VM installer for Mac OS X 10.10 Yosemite, 10.11 El Capitan, 10.12 Sierra, 10.13 High Sierra[edit]
Point and click configuration files that cause Vagrant to automatically download and configure an Octave 4.2.2 server VM under OS X including 10.10 Yosemite, 10.11 El Capitan, 10.12 Sierra and 10.13 High Sierra. The install process pulls down Octave 4.2.2 from the repository. All software used in running this server VM is open source (Vagrant, VirtualBox, Octave). The Octave GUI and graphics will display seamlessly on the Mac via the Mac's native X-windows server, while the server runs headless. The recommended configuration ensures that by default user files written by the GUI are in a folder shared with the Mac's filesystem, and the VM suspends automatically when the user quits the GUI. Any edited files then persist in the Mac's shared folder.
Binary installer for OS X 10.9.1[edit]
A binary installer for Mavericks can be found on Octave Forge.
This installer will install all binaries for GNU Octave 3.8.0 itself and its dependencies under
And will create two entries in the Applications folder
Which will start Octave in CLI and GUI mode respectively, these are just small wrappers containing a startup script and an icon to allow launching Octave from the Finder.
Octave (itch) Mac Os Download
If you wish to uninstall GNU Octave 3.8.0 and all other software installed by this installer you can simply move the three folders listed above to the Trash. Notice that you will need to authenticate with an administrator password to be allowed to do so.
Octave (itch) Mac Os Catalina
You may need to override Gatekeeper to allow installation. You may find instructions about how to do this on this page in the section labeled 'How to open an app from a unidentified developer and exempt it from Gatekeeper'.
In short:
- In Finder, Control-click or right click the icon of the app.
- Select Open from the top of contextual menu that appears.
- Click Open in the dialog box. If prompted, enter an administrator name and password.
This installer is known to work on OS X 10.9.1, you may try, at your own risk, to use it for installing on other system versions but it is not guaranteed to work.
MacPorts: Custom Installation Instructions[edit]
For best performance, variability and reliability the custom installation is suggested.
Preliminary Port Installations
- The new Octave 4 port relies on the accelerator variant. Unfortunately this variant is known for some problems (see below). A better alternative is the 'atlas' port, it is necessary to build it with the here specified variant prior to the Octave port installation:
sudo port install atlas +gcc5
. This can last for many hours. Do this overnight. If a prior atlas installation failed, dosudo port clean atlas
before reinstallation. - Octave depends on arpack, too. Unfortunately arpack is installed with the accelerate variant by default. The accelerate variant uses Apple's Vector Libraries which have some known bugs that can cause Octave to crash if using certain functions in arpack. To avoid this install arpack with the atlas variant instead of the accelerate variant
sudo port install arpack -accelerate+atlas
. You can even do this after you installed Octave. The new variant become active by default.
Octave Installation
- MacPorts has good support for Octave. A list of what MacPorts has available for Octave is here. To install the most recent version of Octave, type
sudo port install octave -accelerate+atlas
at the Terminal's command line. Octave has many dependencies which will be downloaded and installed prior to Octave. The entire installation process can take some time. - Note that
octave-devel
has been replaced byoctave
, see MacPorts Revision 114034. - The variant installed may be important to the user's experience. The available variants for
octave
are displayed by typingport variants octave
. In MacPorts 2.3.4 the variants accelerate, app, docs, fltk, gfortran, graphicsmagic, qt4gui and sound are installed by default (marked with '+' sign inport variants octave
output). If you need Java support add the new Java variant (+java). A installed Java JRE is mandatory. Go To the Oracle Java website for Download. The following command works fine:sudo port install octave -accelerate+atlas+java
If Octave crashes when plotting use the Gnuplot graphic toolkit instead of FLTK. Typegraphics_toolkit('gnuplot')
in Octave before plotting. For using the nicer wxt-terminal of Gnuplot, typesetenv('GNUTERM','wxt')
in Octave. To make this the standard behavior append both commands in one of Octave's startup files e.g. your~/.octaverc
. To close the graphic window of gnuplot use the Octave commandclose()
to get rid of the Gnuplot instance instead of using the close button of the window.- The first plot after startuing Octave 4 can last a while.
To get detailed instructions from start to end on one page, refer Hani's Omnium Gatherum.
Octave (itch) Mac Os Pro
Fink installation instructions[edit]
→ Latest Octave: Version 3.8.2
The Fink project uses dpkg and APT (Debian's package management system), as well as its own frontend program, fink (which is implemented as a set of Perl modules).
Install GNU Octave using Fink:
- Install Xcode via the Mac App Store.
- Install the Command Line Tools by opening a terminal and type
sudo xcode-select --install
.
- Install the Command Line Tools by opening a terminal and type
- Follow Fink's installation instructions.
- Fink has excellent support for Octave and includes recent as well as dated versions. A list of what Fink has available for Octave is here. To install the latest Octave with GUI support, type
fink install octave-qtmac
orfink install octave-qtx11
at the Terminal's command line. For those running the 64 bit version of Fink, it is recommended thatoctave-atlas-qtmac
oroctave-atlas-qtx11
be installed instead as there are some bugs/features with Apple's vecLib for the X86_64 architecture. Octave has many dependencies which will be downloaded and installed prior to Octave. The entire installation process can take many hours. - Fink should also be used to install [packages for Octave. For example, the control systems package may be installed by typing
fink install control-atlas-oct382
at a terminals command line.
For the doc()
function to be supported by Octave, either the unversioned octave
, octave-atlas
, or octave-ref
package must be installed. Essentially, those features used at run-time which don't have a version somewhere in the file path are included in these packages.
Octave (itch) Mac OS