Getting Octave to Just Goddamn Work Already on OS X 10.8 Mountain Lion

The So-Help-Me-God Edition

If you are in the fortunate position to be a lucky owner of a spiffy new Macbook, I salute you! In my humble opinion there could not be a finer breed of computer. Savor it, my friend!

However, if you are in the unfortunate position of needing to implement algorithms and plots in GNU Octave, I pity you. It is your fate to run through the gauntlet of Unix dependency hell that is getting open source software to work on a closed source operating system.

But I have good news! Hopefully, I have now exposed all the booby traps that Mountain Lion has set for you, and I've discovered the secret command-line incantations necessary to avoid them. Yes, much like Indiana Jones and the Last Crusade, I will now deftly disarm the traps so that you may pass freely into the chamber of the Holy Grail1. Choose wisely.

  1. First, install XQuartz. In the past this came installed on OS X, but as of Mountain Lion it is no longer included. So go fix that.
  2. You will also need the Xcode Command Line Tools if you don't already have them. Both Homebrew and XQuartz need this to work.
  3. Now you are ready to install Octave from Homebrew:2

    If you don't know what Homebrew is, then do me a favor and slap yourself a couple times. Install Homebrew now; thank me later.

Wow, Neil, that was easy! That's it, huh?

  1. Octave claims to have native drawing support using FLTK, but I haven't been able to get it working yet. We'll rely on gnuplot instead, which must be installed separately:
  2. Now edit your Octave startup file or create a new one:

    and add the line:
    (btw, to save and exit vim, type ':wq', or to exit without saving, type ':q')
  3. Now for the ultimate fix: reboot your machine! Yep, until you restart your Mac, Octave will be unable to launch XQuartz on its own, and you won't be able to plot anything.
  4. Once you're back in, open the terminal, fire up Octave, and plot a sombrero(). You're all set!


  1. The Holy Grail of Octave? Okay, not the greatest analogy.
  2. If you're having trouble with this step, see: Octave for OS X
Tagged , , , , . Bookmark the permalink.

24 Responses to Getting Octave to Just Goddamn Work Already on OS X 10.8 Mountain Lion

  1. Andrew says:

    Will this workflow still apply under Mavericks?

  2. ntraft says:

    Good question. :-P
    I'll let you know once I update, possibly today.

  3. Adjoa says:

    Thanks Neil--this worked perfectly and I didn't need to reboot my Mac either!

    I'm also curious about any Mavericks troubles.

  4. Gany says:

    Hey, thank you so much man.. I'm new to Macs, this helped install octave without breaking a sweat :)

  5. Andrew says:

    No mavericks test yet?

  6. Kate says:

    Well, I don't have it working on Mavericks, and a bit of searching shows I'm not the only one. Going to use ubuntu on virtual box until this is sorted :) .

  7. ntraft says:

    Update: I finally ugpraded to Mavericks and am happy to report that Octave works just fine. I also upgraded XQuartz from 2.7.4 to 2.7.5 and it worked with both versions.

    @Kate: Sorry to hear you're having trouble. What kinds of problems are you having exactly?

  8. Patrick says:

    Any thoughts on how to get this running without using Homebrew? I don't like what brew does to my /usr/local.

  9. ntraft says:

    @Patrick: Pretty sure you can tell brew to install wherever you want, e.g. /opt/local like Macports does. But if you still prefer Macports, check out the link I gave in the footnotes here. On that same page there are also instructions for installation via Macports.

  10. Cliff says:

    I have Octave working on Mavericks; however, Gnuplot still will not work. it repeatedly gives me the argument:
    gnuplot> set terminal aqua enhanced title "Figure 1" size 560 420 font "*,6"
    line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

    I am unable to get your x11 fix above to work (other than doing it every time I open up a new terminal).
    1. Do you have any idea how to fix this?
    2. Do you know how to just install Aquaterm?

  11. ntraft says:

    So it does work when you explicitly run export GNUTERM=x11 on the command line before starting Octave? In that case, your .profile must not be getting sourced. Sorry I didn't explain those so well. I actually didn't understand them when I wrote this.

    If you don't already have a .bash_profile, then you should create one with a single line:

    This will ensure that .profile always gets run.

    - Put the following line into your .octaverc:

    This might be the best option because then it will get set no matter what shell you're using.
    - Use zsh instead, and put the line into .zshrc, which always gets run.
    - As you said, you could also install aquaterm, but I think XQuartz is much superior and better supported.

  12. Shaima says:

    Thank you for the clear instructions and for the additional information about adding export GNUTERM=x11.

  13. Ignacio Sales says:

    Thanks so much for this.

    I just got a brand new Mac with Mavericks on it and was getting so frustrated with the painful install process... which was a breeze in Windows 7! :-S.

    Anyway where I was getting stuck was on the install of gnu plot, but once I used Homebrew to install everything went fine.

    Thanks again


  14. vvk says:

    The install of Octave on Mavericks worked fine as per the instruction above. I do have a strange issue with the Plot Function.

    The plot(x,y,'rx','MarkerSize',10) works fine when I am doing a command line. When I call this from a script file as a function, then I get an error of invalid Syntax.

  15. jackie says:

    Thanks for the article, especially for the ultimate fix- rebooting! I was stucked without rebooting...

  16. ellenjulia says:

    I'm trying to install octave on Mountain Lion and I'm getting hung up installing octave via these instructions as follows:
    ==> Installing octave dependency: suite-sparse
    ==> Downloading

    curl: (22) The requested URL returned error: 403
    Error: Failed to download resource "suite-sparse"
    Download failed:

    Any thoughts? The internet has failed me so far.

  17. ntraft says:

    I just checked my installation... brew info suite-sparse shows it as installed. I think a 403 can happen if a file isn't given the right permissions on the server... so maybe it was a temporary issue on the SuiteSparse server?

    It seems fine now so maybe try again? (I was just able to download it from the link you provided)

    If not, then maybe their server is denying you for some other reason... you might try downloading it from another computer to diagnose the issue...

  18. Hans says:

    I'm running 10.8.5 and XQuartz won't install at all. It hangs up half way through the install. I've tried everything. Nothing works.

    What's more, I can't get any help anywhere. Not even Sourceforge will answer my emails about it. It seems support for X11 has simply been wiped off the face of the Earth as if it never existed.

    Please, somebody, ANYBODY, stop me before I buy a gun & shoot a big hole through this stinking Mac Mini !!!

  19. ntraft says:

    @Hans: Upgrade to Mavericks? ¯\_(ツ)_/¯

  20. Carl says:

    If you want to avoid the MacTeX dependency you can install Octave with brew as follows:

    brew install octave --without-docs


  21. ZR says:

    When I'm brewing Octave, I get:
    Error: Unsupported special dependency :java

    I tried the following command:
    brew install octave --build-from-source --without-java

    Same results
    Error: Unsupported special dependency :java

    Trying to brew upgrade, have some issue with a local commit.. ugh

  22. ZR says:

    Never mind - brew install && upgrade was absolutely necessary. First had to reset the git repo in the Cellar before I could update. Upgrading everything led Brew to ask me if I wanted to update Java (via Cask?). That fixed everything

  23. Anon says:

    I did all this and I still got unknown terminal x11 errors. I had to add one final step:

    brew uninstall gnuplot;brew install gnuplot --with-x

    Now octave works with x11.

    Oh, I needed the slightly different setenv("GNUTERM", "X11") in the octaverc file, too.

  24. 0kyanus8ahis says:

    okyanusbahis Casino is an online gaming platform operated by A Company Limited. With its central hub in Valletta, Malta, okyanusbahis aims to cater to a global audience, targeting players from Brazil. Yet, it is essential to note that okyanusbahis Casino denies entry to players from the United Kingdom.

    One of the vital aspects of any online casino is the variety and standard of casino games it offers. okyanusbahis Casino boasts an impressive list of game providers, including reputable names such as Pragmatic Play, Play'n Go, Betsoft, NetEnt, Microgaming, Evolution, and many others. With such a broad range of providers, players can look forward to a wide selection of high-quality games to pick from. Whether you're a fan of live casino experiences, okyanusbahis Casino has got you need.

    In terms of slots, okyanusbahis Casino offers over 1,000 games, ensuring there is something for every player's preference. From classic slots to contemporary video slots with engaging features and themes, the casino provides a varied and varied slot gaming journey. Moreover, okyanusbahis Casino also offers a live casino option for players seeking an immersive and interactive gambling adventure. With live dealers and real-time gameplay, players can relish the thrill of a land-based casino from the convenience of their own homes.

    When it comes to usability, okyanusbahis Casino offers an instant play version, permitting players to access their favorite games right from their web internet browsers. But, the casino does not provide a downloadable version of its software. Regardless, players can relish the casino's offerings on different operating systems, as okyanusbahis Casino is workable with all main platforms.

    Language support is another area where okyanusbahis Casino stands out, catering to a varied player base. The casino supports multiple languages, including English, Spanish (LATAM), Portuguese (BR), French (CA), and German. This multi-language support confirms that players from various countries can navigate the platform easily and experience a smooth gaming journey.

    In terms of currencies, okyanusbahis Casino accepts USD, EUR, CAD, and BRL, providing choices for players to deposit and wager in their chosen currency. Yet, it is worthwhile noting that okyanusbahis Casino does not permit players from the United States, suggesting that USD deposits and gameplay are not applicable.

    okyanusbahis Casino maintains a high level of security and carries a license from Curacao. This ensures that the casino operates within the legitimate framework and adheres to industry standards. Players can enjoy a safe and fair gaming ambiance while playing at okyanusbahis Casino.

    When it comes to deposits and withdrawals, okyanusbahis Casino provides a selection of payment methods. Yet, specific details regarding the least deposit, withdrawal methods, withdrawal limits, and withdrawal times were not provided in the existing data. It is advised to refer to the casino's website or contact customer support for latest information regarding these aspects.

    In terms of customer support, okyanusbahis Casino offers both email support and live chat functionality. Players can reach out to the support team via email at or take advantage of the live chat feature for prompt assistance. While a support phone number is not offered, the pairing of email and live chat support guarantees that players can easily convey their queries or concerns to the casino's support team.

    Promotions and bonuses are an integral part of the online gambling experience, and okyanusbahis Casino does not fail in this aspect. The casino offers a sizeable welcome bonus for its players. The specifics of the welcome bonus vary based on the player's location. For players in LATAM, the welcome bonus consists of a 120% deposit match up to $600 and 25 free spins. Brazilian players can experience a similar 120% deposit match up to R$4k and 25 free spins. Canadian players are eligible for a 120% deposit match up to $600 and 25 free spins. For players in other regions, the welcome bonus is a 120% deposit match up to 600 EUR and 25 free spins.

    okyanusbahis Casino provides honesty by sharing the terms and conditions of its welcome bonus. Players are encouraged to review these terms to understand the wagering requirements and any other limitations associated with the bonus. The terms and conditions for the welcome bonus can be found on the casino's website.

    In addition of the welcome bonus, okyanusbahis Casino offers offers to keep players interested and rewarded. The details of these promotions can be found on the casino's special promotions page, which is regularly updated to offer new and enticing incentives for players.

    okyanusbahis Casino also runs an affiliate program called okyanusbahis Partners. This program allows people or businesses to earn profits by guiding players to the casino. The affiliate program has its own dedicated website, where interested parties can find more information and sign up.

    In conclusion, okyanusbahis Casino maintains a payout percentage of 95%, which shows that players have a fair chance of winning while playing on the platform. This payout percentage is in line with industry standards and confirms that players can enjoy a gratifying and potentially profitable gaming adventure.

    Overall, okyanusbahis Casino offers an wide range of games from reputable providers, providing players with a diverse and engaging gambling journey. The multi-language support, diverse currency options, and attractive welcome bonuses more enhance the complete attraction of the casino. With its dedication to player safety and fair gaming, okyanusbahis Casino is as a potential online gambling destination.

    Note: The information offered in this review is based on available data as of the time of writing. For the most current information and offerings, it is suggested to visit the okyanusbahis Casino website.

Leave a Reply

Your email address will not be published. Required fields are marked *