6

The new GNU Octave 4.0.1 was released March 23, 2016. I would like to find some standard way to install it in El Capitan (mine OS X 10.11.3) because it has significantly better support in some functions than Matlab, discussed in the thread here. I do brew search octave and get

homebrew/science/octave    Caskroom/cask/octave       Caskroom/cask/xoctave    

where one of the first two should be a correct one. The project's homepage support for OS X is down here about installing Octave on OS X systems. There is also ruby's way of installing Octave described in the thread How to install Octave on OS X (Yosemite) but for Yosemite. I would like to find some standard way of getting Octave for OS X.

I do successfully brew update and brew upgrade before the commands. My Homebrew is 0.9.5 (git revision 80d1; last commit 2016-03-24). user1256923. I run brew info octave but I get

Error: No available formula with the name "octave"

How can you install Octave in some standard way for El Capitan?

1

Using MacPorts ( http://macports.org/ ), with insight from instructions at http://blog.hani-ibrahim.de/en/octave4-mac-os-x-el-capitan-install.html (as well as http://blog.hani-ibrahim.de/en/octave-mac-os-x-el-capitan-install.html and http://blog.hani-ibrahim.de/en/octave4-upgrade-via-macports.html) as well as the Octave wiki at http://wiki.octave.org/Octave_for_MacOS_X#MacPorts

It seems as though MacPort's default atlas variant doesn't play nice with Octave, and arpac and qrupdate also have issues with their default installion, needing specific "variants" to properly build. Basically to get all of Octave 4 running, I did:

sudo port install atlas +gcc5
sudo port install arpack -accelerate+atlas+gfortran 
sudo port install qrupdate -accelerate+atlas+gcc5
sudo port install octave -gcc5+gfortran-accelerate+atlas+docs+fltk+graphicsmagick+java-gui-metis-qtgui+app+qt4gui+sound

Probably some of the octave variant flags are unneeded for some people, but I went with the options suggested by hani-ibrahim.de and it works for me to get command line Octave up and running, as well as giving a nifty Octave.app in the /Applications/MacPorts directory.

If you need Java support with the Java variant (+java) as above, you probably need a JDK (Java Development Kit) to get the necessary command line suff for that magic to work, so go to ( http://www.oracle.com/technetwork/java/javase/index.html ) for a download. Maybe the smaller JRE (Java Runtime Environment) would be sufficient, but I have installed the full JDK. Omitting the (+java) flag removes this requirement.

I just tested it (2016/09/01) on Mac OS X 10.11.6 and was able to intall via MacPorts with no errors, ending up with atlas @3.10.2_2, arpack @3.3.0_3, qrupdate @1.1.2_4 and octave @4.0.3_0

On about 2016/12/05, with just the xcode command line tools installed (not the full XCode), I was able to use the above to install on macOS 10.12.1 Sierra: arpack @3.3.0_3, atlas @3.10.2_2, qrupdate @1.1.2_4, and octave @4.2.0_1. I initially was not able to get 4.2.0_0 installed, but 0_1 finally did. The installation ended with the warning "unless octave is run with –no-gui-libs, graphics_toolkit(“fltk”) will cause a crash" but I have not investigated this issue.

  • In MacOS Sierra, this doesn't work, I had to run: cd $(brew --repo); git fetch; git reset --hard origin/master and after that: brew install homebrew/science/octave and it's working now, more infor here: twitter.com/MacHomebrew/status/763686348041641984 – calbertts Dec 11 '16 at 1:46
  • Hi @calbertts did you mean to put this comment in the "homebrew" answer? – j-beda Dec 12 '16 at 19:50
  • I've tried with all the answers, and this one worked fine until the latest command, that's why I'm sharing what I had to do to make it work. – calbertts Dec 12 '16 at 20:01
  • 1
    Hi @calbertts, MacHomebrew and MacPorts are totally seperate package managers, so invoking "brew install" to fix a non working "port octave" is a bit like saying "The instructions on how to fix the squeeky screen door with the Philips screwdriver did not quite work for me. What did work was to knock a hole in the wall on the other side of the house and mount a different screen door there using a Robertson screwdriver". If you installed Octave using brew, perhaps you might want to uninstall the MacPorts stuff to eliminate duplication or possible conflicts/confusion when updating or invoking. – j-beda Dec 13 '16 at 21:04
6

From my homebrew:

brew info octave
homebrew/science/octave: stable 4.0.0 (bottled), HEAD
high-level interpreted language for numerical computing  
https://www.gnu.org/software/octave/index.html
Not installed

and

brew cask info octave
octave: 3.8.2-1
Octave
https://gnu.org/software/octave/
Not installed

xoctave is a gui which I suspect is independent. I'd use homebrew for the installation.

FWIW the Octave wiki it explains what to do:

brew tap homebrew/science
brew update && brew upgrade --all
brew install octave
  • With mine I have to run brew install homebrew/science/octave – Danijel-James W May 18 '16 at 4:18
  • This is because you didn't tap homebrew/science – RenatoUtsch Jun 19 '16 at 5:33
2

if you have already installed gcc...

sudo chown -R (username):admin /usr/local/lib/gcc/

and

brew install octave

after this, you make cross fingers...

  • "Make cross fingers" love it. – Deesbek May 18 '16 at 3:40
0

I found Octave.app when searching for resolution to problems related to the homebrew installation of octave on High Sierra.

The Octave.app has at macOS based testing suite. And when needed, has even applied patches to address upstream code issues.

Octave.app is based on the homebrew build, just with the value add of macOS specific testing, bundling, … and patching.

Indeed, Octave.app even had fixed the very Qt issue(s?) that appeared to be causing problems with the homebrew release in my case. Since Octave.app patched the upstream Qt issues which Homebrew had not, I unlinked the homebrew version and installed Octave.app.

# if octave exists from either regular Homebrew or dpo/openblas formulae 
brew unlink octave

Octave.app launches OK in GUI mode. Octave.app installs from a dmg. Thus, neither Homebrew nor MacPorts are required.

I also added the following to the bash profile:

##############
### Octave ###
##############
### http://octave-app.org/
alias octave="open -a \"Octave\""

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .