Octave for macOS: Difference between revisions

Jump to navigation Jump to search
1,640 bytes removed ,  29 April 2022
→‎Homebrew: Strip outdated and redundant information.
(→‎Anaconda: Add installation instructions)
(→‎Homebrew: Strip outdated and redundant information.)
Line 29: Line 29:
=== Homebrew ===
=== Homebrew ===
→ ''Link to [https://formulae.brew.sh/formula/octave Octave package] there.''
→ ''Link to [https://formulae.brew.sh/formula/octave Octave package] there.''
[https://brew.sh/ Homebrew] was written 2009 by Max Howell and has gained popularity in the Ruby on Rails community and earned praise for its extensibility.


'''Install GNU Octave using Homebrew:'''
'''Install GNU Octave using Homebrew:'''
Line 40: Line 38:
# Install Octave <pre>brew install octave</pre>
# Install Octave <pre>brew install octave</pre>


==== Further reading ====
In case of trouble, see the [https://docs.brew.sh/Troubleshooting Homebrew Troubleshooting Guide].
 
The default charting package in Octave is straight qt. However, on the Mac gnuplot often works better. To switch to gnuplot, place the following text in your {{Path|~/.octaverc}} file:
<pre>setenv('GNUTERM','qt')
graphics_toolkit("gnuplot")</pre>
 
Note: If brew complains about:
<pre>
Linking /usr/local/Cellar/ghostscript/9.14...
Error: Could not symlink share/ghostscript/Resource
/usr/local/share/ghostscript is not writable.
</pre>
This is telling you the user permissions for ghostscript are not setup in a way that your user profile can use. You need to change those permissions to your user profile.
The following command will repair the issue:
<pre>
sudo chown -R `whoami` /usr/local/share/ghostscript
brew link --overwrite ghostscript
</pre>
Then run the <code>brew install octave</code> command again.
 
Note: If brew complains about not having a formula for octave, the following command should fix it:
<pre>brew tap --repair</pre>
 
The command below upgrades Octave and its dependencies to the latest Homebrew-supported versions:
<pre>brew update && brew upgrade octave</pre>
 
Octave has a built-in GUI (developed using Qt lib) installed by default so that gnuplot and other tools can use it directly. This GUI is always installed when installing Octave using Homebrew.
 
In case of trouble, see the [https://docs.brew.sh/Troubleshooting Homebrew Troubleshooting Guide], which assists in diagnosing problems and craft useful bug reports. Bugs may be reported at [https://github.com/Homebrew/homebrew-core/issues Homebrew-core's issue tracker].


=== MacPorts ===
=== MacPorts ===

Navigation menu