Octave: Can't start GUI after installing from homebrew

I installed octave using homebrew.

When I call

octave --force-gui

I get error:

octave: GUI features missing or disabled in this build

Q: How to make it work in GUI mode?

I also tried

brew reinstall octave --with-qt --with-fltk --with-gui

like it was suggested in this post, but it didn't help.

Here is some debug information:

$brew info octave
octave: stable 4.4.0 (bottled), HEAD
High-level interpreted language for numerical computing
https://www.gnu.org/software/octave/index.html
/usr/local/Cellar/octave/4.4.0 (2,173 files, 45.4MB) *
  Poured from bottle on 2018-05-10 at 18:11:38
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/octave.rb
==> Dependencies
Build: gnu-sed ✘, pkg-config ✘
Required: arpack ✔, epstool ✔, fftw ✔, fig2dev ✔, fltk ✔, fontconfig ✔, freetype ✔, gcc ✔, ghostscript ✔, gl2ps ✔, glpk ✔, gnuplot ✔, graphicsmagick ✔, hdf5 ✔, libsndfile ✔, libtool ✔, pcre ✔, portaudio ✔, pstoedit ✔, qhull ✔, qrupdate ✔, readline ✔, suite-sparse ✔, veclibfort ✔
==> Requirements
Build: java >= 1.6 ✔
==> Options
--HEAD
    Install HEAD version

Solution 1:

I had same problem and asked same question. I answered it myself. Remove homebrew version of Octave. Install MacPorts version of Octave. MacPorts is a package manager like Homebrew. Their version of Octave works fine. Instructions for installing MacPorts and Octave are given at MacPorts home page.

Solution 2:

It worked for me if I first install qt:

brew install qt

Then install octave with --with-qt:

brew install octave --with-qt

(Or, if you've already installed it:

brew reinstall octave --with-qt

)

Solution 3:

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

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

Indeed, Octave.app fixed the very Qt issue(s?) that appeared to be causing problems with the homebrew release. The brew reinstall octave --with-qt and a number of other attempts did not work in my case with the current homebrew version.

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

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