Octave for macOS: Difference between revisions

Jump to navigation Jump to search
Line 60: Line 60:
*Install XCode: This is done via the MacOS X App Store.
*Install XCode: This is done via the MacOS X App Store.
*Follow [https://github.com/mxcl/homebrew/wiki/installation Homebrew's installation instructions].
*Follow [https://github.com/mxcl/homebrew/wiki/installation Homebrew's installation instructions].
*[http://mxcl.github.com/homebrew/ Homebrew] has good support for Octave. To install Octave, type {{Codeline|<nowiki>brew install homebrew/science/octave</nowiki>}} 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 a few hours.
[http://mxcl.github.com/homebrew/ Homebrew] has good support for Octave. To install Octave, you must first enable the scientific related formulae by typing at the Terminal's command line:
 
{{Codeline|<nowiki>brew tap homebrew/science</nowiki>}}
 
Then, if you do not have a fortran compiler installed, type
 
{{Codeline|<nowiki>brew install gfortran</nowiki>}}
 
Currently, linking Octave fails with the newest suite-sparse (4.1.0). As a solution, an older version can be installed.
First, versioning must be enabled and an older version has to be chosen (in this case, 3.7.0)
 
{{Codeline|<nowiki>brew tap homebrew/versions</nowiki>}}
 
{{Codeline|<nowiki>brew versions suite-sparse</nowiki>}}
 
Then go to the install directory of brew ({{Codeline|<nowiki>/usr/local</nowiki>}} by default) and get the formula for the older version (the revision number, {{Codeline|<nowiki>ff53163</nowiki>}},  is shown in the fourth column by in the previous command's output)
 
{{Codeline|<nowiki>cd /usr/local/Library/Taps/homebrew-science/</nowiki>}}
 
{{Codeline|<nowiki>git checkout  ff53163 /usr/local/Library/Taps/homebrew-science/suite-sparse.rb</nowiki>}}
 
Now compile and activate the selected version and install Octave
 
{{Codeline|<nowiki>brew unlink suite-sparse</nowiki>}}
 
{{Codeline|<nowiki>brew install suite-sparse</nowiki>}}
 
{{Codeline|<nowiki>brew switch suite-sparse 3.7.0</nowiki>}}
 
{{Codeline|<nowiki>brew install octave</nowiki>}}
 
Note that Octave has many dependencies which will be downloaded and installed prior to Octave. The entire installation process can take a few hours.


==Create a launcher app with AppleScript==
==Create a launcher app with AppleScript==