Octave for macOS: Difference between revisions

1,111 bytes removed ,  27 April 2013
Update Homebrew instructions: suite-sparse is fixed now, so remove the workaround; add link to issue tracker
m (replace "MacOS X" with "Mac OS X", matching Apple's usage)
(Update Homebrew instructions: suite-sparse is fixed now, so remove the workaround; add link to issue tracker)
Line 33: Line 33:
====Simple Installation Instructions====
====Simple Installation Instructions====


*Install XCode: This is done via the Mac App Store. For Mac OS X 10.8, it is necessary to run Xcode and install the command-line tools via its Xcode's Preferences.  
*Install XCode via the Mac App Store.
** Once installed, install the Command Line Tools from XCode's Apple Menu > Preferences > Downloads.
*Follow [http://www.finkproject.org/download/srcdist.php Fink's installation instructions]. For those who prefer it, there is a GUI available for Fink, [http://finkcommander.sourceforge.net Fink Commander].
*Follow [http://www.finkproject.org/download/srcdist.php Fink's installation instructions]. For those who prefer it, there is a GUI available for Fink, [http://finkcommander.sourceforge.net Fink Commander].
*Fink has excellent support for Octave and includes recent as well as dated versions. A list of what Fink has available for Octave is [http://pdb.finkproject.org/pdb/browse.php?summary=octave here]. To install the latest Octave, type {{Codeline|<nowiki>sudo fink install octave</nowiki>}} at the Terminal's command line.  For those running the 64 bit version of Fink, it is recommended that {{Codeline|octave-atlas}} 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 a few hours.
*Fink has excellent support for Octave and includes recent as well as dated versions. A list of what Fink has available for Octave is [http://pdb.finkproject.org/pdb/browse.php?summary=octave here]. To install the latest Octave, type {{Codeline|<nowiki>sudo fink install octave</nowiki>}} at the Terminal's command line.  For those running the 64 bit version of Fink, it is recommended that {{Codeline|octave-atlas}} 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 a few hours.
Line 46: Line 47:
====Simple Installation Instructions====
====Simple Installation Instructions====


*Install XCode: This is done via the Mac App Store.
*Install XCode via the Mac App Store.
*Follow [http://www.macports.org/install.php MacPorts' installation instructions].
*Follow [http://www.macports.org/install.php MacPorts' installation instructions].
*MacPorts has good support for Octave. A list of what MacPorts has available for Octave is [http://www.macports.org/ports.php?by=name&substr=octave here]. To install the most recent version of Octave, type {{Codeline|sudo port install octave-devel +atlas+docs}} 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.
*MacPorts has good support for Octave. A list of what MacPorts has available for Octave is [http://www.macports.org/ports.php?by=name&substr=octave here]. To install the most recent version of Octave, type {{Codeline|sudo port install octave-devel +atlas+docs}} 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.
Line 57: Line 58:
====Simple Installation Instructions====
====Simple Installation Instructions====


*Install XCode: This is done via the Mac App Store. (technically you may only require just the xcode command line tools- this download is smaller at 113 megs rather than the full xcode suite at about 1.6 gigs-)
First, install Homebrew:
* download and install xquartz
*Install XCode via the Mac App Store.
** Once installed, install the Command Line Tools from XCode's Apple Menu > Preferences > Downloads.
*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, you must first enable the scientific related formulae by typing at the Terminal's command line:
* {{Codeline|brew tap homebrew/science}} to import the scientific computing packages, including Octave.


brew tap homebrew/science
Then, install Octave:
* {{Codeline|brew update && brew upgrade}} to pick up the latest package definitions.
* {{Codeline|brew install gfortran}}
* {{Codeline|brew install octave}}


Then, if you do not have a fortran compiler installed, type
Note that Octave has many dependencies which will be downloaded and installed prior to Octave. The entire installation process can take a few hours.
 
brew install gfortran
 
brew install octave


**** caution -information below on using suite-sparse 3.7.0 might have been outdated by now , so try the normal build above which uses suite-sparse 4.2.0, and if that fails try the approach below *****
If you run in to trouble, you can report bugs at [https://github.com/Homebrew/homebrew-science/issues?state=open Homebrew-science's issue tracker]. The [https://github.com/mxcl/homebrew/wiki/troubleshooting Homebrew Troubleshooting Guide] can help you diagnose problems and craft useful bug reports.
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)
 
brew tap homebrew/versions
brew versions suite-sparse
 
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)
 
cd /usr/local/Library/Taps/homebrew-science/
git checkout  ff53163 /usr/local/Library/Taps/homebrew-science/suite-sparse.rb
 
Now compile and activate the selected version and install Octave
 
brew unlink suite-sparse
brew install -v ./suite-sparse.rb
brew switch suite-sparse 3.7.0
brew install octave
**** caution -information above on using suite-sparse 3.7.0 might have been outdated by now , so try the normal build above which uses suite-sparse 4.2.0, and if that fails try the approach above  *****
 
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==
Line 108: Line 89:


<code>
<code>
  tell application "Terminal"
  tell application "Terminal"
   do script "`which octave`; exit"
   do script "`which octave`; exit"
  end tell
  end tell
</code>
</code>


* Select "Save as ..." from the "File" menu
* Select "Save as ..." from the "File" menu
* In the menu that appears, select "Application" from the "File format" menu, then navigate to the "Applications" folder and save your script there as "Octave.app"
* In the menu that appears, select "Application" from the "File format" menu, then navigate to the "Applications" folder and save your script there as "Octave.app"


To change the application icon  
To change the application icon  
21

edits