gnuplot with AquaTerm on OSX Snow Leopard

17 01 2010

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

Actions

Information

19 responses

10 02 2010
Soeren

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.

20 04 2010
Chris

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

Cheers, Christian

3 06 2010
Mike

Thanks very much, it works!

7 06 2010
Christophe

Thank you very much. It helped me a lot!

19 06 2010
Snow Leopard上安装Gnuplot « ASTR 627

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

28 06 2010
Snow Leopard上安装Gnuplot » ASTR627

[...] 其实还是很简单,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。下面是安装步骤: [...]

14 08 2010
Michelle

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

7 09 2010
Nicho

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

17 12 2010
KW

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.

2 01 2011
2010 in review « /usr

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

3 04 2011
DW

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

29 04 2011
Bernhard Wagner

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…

28 08 2011
Octave on Mac OS X » Philipp Klaus's Computing Blog

[...] 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 [...]

3 03 2012
Mark Lim

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

3 03 2012
Bernhard Wagner

Why compile it yourself? Why not use MacPorts or homebrew?

If you absolutely need to compile it yourself, the error you’re getting seems to suggest you should compile gnuplot for a 32bit architecture.

More details possibly here: http://www.miscdebris.net/blog/2010/03/25/install-gnuplot-4-4-0-on-mac-os-x/

4 03 2012
Mark Lim

Thanks for the tip.
I followed the http://www.miscdebris.net link.

I finally got it to work on x11 version 1.4.2
It’s 10.6.8 os X works in gnuplot 4.4.3 on mac mini.

All the demos worked on x11. Compiling gives me more options – thats good but a lot of learning curve and persistency.

Furthermore…
I like to set to aqua though…Can you advise how to compile it again?
Many thanks

23 07 2012
Dan

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

17 09 2012
Christian M.

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!

10 10 2012
JRG Pulido

try installing aquaterm first
then gnuplot

I use it via octave and works well on Lion

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 )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: