Installing Surfer on Funtoo

Surfer is a program for visualizing algebraic surfaces. Since I need it for my algebraic geometry class, I wanted it to compile and install on my funtoo machines, however the usual configure, make, make install procedure failed and I needed two additional steps to make it work. Here is how I installed it locally, with the sources in /usr/local/src and the binaries installed to /usr/local/bin.

First we need to fetch the sources:

cd /usr/local/src # if it doesn't exist, create it
mkdir surfer
cd surfer
tar -xf ../surfer.tar.bz2

Next we first need to install surf, which is a project on which surfer is based. Luckily the sources come with surfer, so we just need to extract them and install them:

tar -xf surf-for-surfer.tar.gz
cd surf
sh configure --disable-gui
make && make install
cd ..

Now comes the part where I needed to add some tweaks. First we run ./configure as usual, however when you try to run make you will get the following:

cd . && /bin/sh /usr/local/src/surfer/missing --run automake-1.10 --gnu  Makefile
aclocal.m4:16: warning: this file was generated for autoconf 2.61.
You have another version of autoconf.  It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'. version mismatch.  This is Automake 1.10.3, but the definition used by this AM_INIT_AUTOMAKE comes from Automake 1.10.1.  You should recreate aclocal.m4 with aclocal and run automake again. `pg_DATA' is used but `pgdir' is undefined
make: *** [] Error 1

To fix the first issue, just type aclocal and you're good to go. However, the second issue needs a small addition to just before the line that says pg_DATA = gallery.tar add pgdir = $(pkgdatadir). Now we can run make && make install as usual.

Finally we can invoke the program via surfer and enjoy some algebraic surfaces, for example this beautiful smooth algebraic set for the polynomial x^2-yz+xz-x.

A smooth algebraic set rendered with Surfer.