gnuplot with AquaTerm on OSX Snow Leopard

The gnuplot graphing utility has always had excellent support for multiple terminal types. While the X11 terminal is a satisfactory GUI view for the graphs, I prefer to use the AquaTerm terminal on OSX as it is more ‘Mac-like’ and feels more natural.

Also, I do prefer to compile gnuplot by myself on OSX rather than downloading the pre-packaged binaries – as this gives me more control over the compilation (including getting around the stupid Apple readline bug – where Apple has essentially shipped a broken readline by using libedit to emulate the non-existent libreadline).

This local compile requires that AquaTerm be installed so that the library dependencies for aquaterm exists in:

terminal.png

and the corresponding headers are available at:

1____terminal.png
In addition, the AquaTerm.app itself resides in /Applications.

However, on OS X Snow Leopard, there is a catch – the version of AquaTerm is 32 bit, whereas the default compilation of gnuport results in a 64-bit version – which is not able to load the 32-bit libaquaterm dynamic libraries.

littlesnapper.png

In such a case, the gnuplot compilation does succeed – however, the default terminal becomes the X11 version – which is back to square-one.

A darwinports port does exist for gnuplot – however, as mentioned in an earlier post, this port seems to depend on half of the port repository (i.e., a ton of stuff you do NOT want gets installed as well).

However, there is a easier way to get around this situation. Here’s how.

  1. First install the default binary for AquaTerm from SourceForge and install normally. This step is to basically setup the right folders and symlinks so that you do not have to muck with these later
  2. Now install AquaTerm again from Darwinports – this port has the correct patches needed – and more importantly – builds a 64 bit version by default. This will also install the application under /Applications/MacPorts/

2____terminal.png

  1. Now comes the fun part. We will replace two folders from the darwinports version to the previously installed AquaTerm.
    • Step 1: Replace /Library/Frameworks/AquaTerm.framework with /opt/local/Library/Frameworks/AquaTerm.framework. This will ensure that the correct 64 bit AquaTerm libraries get referenced by the gnuplot compilation
    • Step 2: Replace /Applications/AquaTerm.app with /Applications/MacPorts/AquaTerm.app. This will ensure that the correct 64-bit AquaTerm binary is in the correct location
    • Step 3 (Optional): You can now uninstall the darwinports version by running sudo port uninstall aquaterm from a terminal window
  2. Download the source code for gnuplot and extract the same.
  3. Run ./configure (using a command line parameter to ignore the broken Apple readline) and then make and make install (install will happen in /usr/local)

3____terminal.png

That’s it! The compilation should now succeed and gnuplot will be linked with the correct 64-bit aquaterm dynamic library. Enjoy!

4____terminal.png
figure0.png

About these ads

20 Comments on “gnuplot with AquaTerm on OSX Snow Leopard”

  1. Soeren says:

    Or you could just use homebrew, add a remote for this http://github.com/afh/homebrew/tree/newbrew/Library/Formula and pull the newbrew branch and then do brew install aquaterm && brew install gnuplot.

    Darwinports is altogether too messy in my opinion.

  2. Chris says:

    Thanks heaps! That was really helpful; I had spent 2 hrs trying to google for alternative work-arounds.

    Cheers, Christian

  3. Mike says:

    Thanks very much, it works!

  4. Christophe says:

    Thank you very much. It helped me a lot!

  5. […] term显示效果很一般,所以还是要用AquaTerm。这样就需要有64位的AquaTerm,通过MacPorts可以做到。 所以在安装gnuplot之前,先安装64位的AquaTerm,到MacPorts网站下载Snow […]

  6. […] 其实还是很简单,gnuplot官网有manual, 在terminal用cvs命令获取源码包 cvs -d:pserver:anonymous@gnuplot.cvs.sourceforge.net:/cvsroot/gnuplot login cvs -z3 -d:pserver:anonymous@gnuplot.cvs.sourceforge.net:/cvsroot/gnuplot co -P gnuplot 然后进入gnuplot文件夹直接编译安装 ./prepare ./configure –with-readline=bsd –x-include=/usr/include/X11 –x-libraries=/usr/X11/lib make && sudo make instal 这样就可以使用gnuplot了,不过因为这样编译的是64位gnuplot,是无法使用AquaTerm来显示图片的。默认的X11 term显示效果很一般,所以还是要用AquaTerm。通过MacPorts可以安装64位的AquaTerm。下面是安装步骤: […]

  7. Michelle says:

    Thank you so much – this worked for me, and now I can get on with the math.

  8. Nicho says:

    Hi
    Thanks for this nice guide. I just wanted to add that i got gnuplot 4.5 working with the 64 bit aquaterm from fink. suing the steps from this guide:

    Install 64bit fink
    install aquaterm (from sourceforge)
    compile and install 64bit aquaterm from fink

    replace the framework and app files with the files from fink (I did use links as i then can uninstall using fink)

    compile and install gnuplot

    I think the installation of the 32bit aquaterm can be skipped, for just copying the 64bit files to the right folders.

    Nicho

  9. KW says:

    Thank you!

    I installed gnuplot via Macports before following the steps above. Now I have no more problems plotting Graphs with gnuplot and displaying them in Aquaterm.

  10. […] gnuplot with AquaTerm on OSX Snow Leopard January 20108 comments and 1 Like on WordPress.com, 3 […]

  11. DW says:

    Thanks a lot! That was really helpful, been hours try to figure out this one!

  12. On Snow Leopard 10.6.7 using MacPorts I had to do this:
    sudo port install gnuplot
    Install AquaTerm from http://sunet.dl.sourceforge.net/project/aquaterm/AquaTerm/v1.0.1/AquaTerm1.0.1.dmg

    Now in terminal:
    gnuplot -e “plot sin(x)”
    opened the graph in AquaTerm

    At least someone else had been having the same problem: https://trac.macports.org/ticket/17587

    The proper solution would be to fix this issue in MacPorts…

  13. […] to install gnuplot including its AquaTerm terminal via homebrew (see Soeren’s comment on http://slashusr.wordpress.com/2010/01/17/gnuplot-with-aquaterm-on-osx-snow-leopard/). But the build for AquaTerm failed :( : 1 2 3cd /usr/local/Library/Formula/ wget […]

  14. Mark Lim says:

    Hi ,
    Can you help out?
    My objective is to compile and install gnuplot using Aquaterm on OS X Snow leopard. 10.6.8. Gnuplot 4.4.3 source.

    1. I had tried to configure with builtin readline….seems ok

    2. Make command seem to give me errors
    ld: warning: in /System/Library/Frameworks//QuickTime.framework/QuickTime, missing required architecture x86_64 in file
    ld: warning: in /usr/lib/libwx_macud-2.8.dylib, missing required architecture x86_64 in file
    Undefined symbols:
    “wxFrame::DoGetClientSize(int*, int*) const”, referenced from:
    vtable for wxtFramein wxt_gui.o
    “wxApp::GetClassInfo() const”, referenced from:
    vtable for wxtAppin wxt_gui.o
    “wxWindow::MacGetLeftBorderSize() const”, referenced from:
    vtable for wxtPanelin wxt_gui.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make[3]: *** [gnuplot] Error 1
    make[2]: *** [all-recursive] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
    lims-mac-mini:gnuplot-4.4.3 lim$ pwd
    /gnuplot-4.4.3
    lims-mac-mini:gnuplot-4.4.3 lim$ ls

  15. Dan says:

    Thank you so much for posting this up. Years later, people are still running into this issue. Your fix worked like a charm.

    All the best,

    Dan

  16. Christian M. says:

    Thank you so much. I have spent many hours over the past two weeks working on this silly problem. I have a new Mac Book Pro with Mountain Lion and was not able to get Octave to plot anything, even though gnuplot was more than happy to work with the X11 through XQuartz. I tried the DMG installs of Octave, GnuPlot, and Aquaterm, which all worked separately, but not together. Ditto for MacPorts and Homebrew. Then I went through several web pages of “fixes”. Again, no success. But at last with these instructions – I have plots with Octave!

  17. JRG Pulido says:

    try installing aquaterm first
    then gnuplot

    I use it via octave and works well on Lion

  18. bamboo says:

    After hours to try to get working I finally got it !

    Thank you so much !


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 67 other followers