You are currently only viewing entries from September 2010.

To go back to view all items, click here. Also, see October 2010 and August 2010
Wednesday, 15 September 2010

signgam Error Compiling plotutils-2.6

How to compile plotutils-2.6 (on MinGW) # Permalink C Comment

I was just compiling the GNU plotutils library (version 2.6) using MSYS for MinGW, and had the following problematic error:

undefined reference to `signgam'

It turns out there are problems with the 'gauss' methods provided by various platforms: in the file specfun.c in the ode directory of the plotutils source, the following comment occurs:

/* The following gamma-related nonsense is necessary because (1) some
   vendors have lgamma(), some have gamma(), and some have neither [see
   include/sys-defines.h for further comments], (2) some vendors do not
   declare whichever function they have [e.g. Irix 5.3 requires an
   auxiliary preprocessing symbol to be defined for the declaration in
   math.h to be visible], and (3) some vendors supply broken versions which
   we can't use [e.g. AIX's libm.a gamma support is conspicuously broken],
   so we need to link in a replacement, but we can't use the same name for
   the external symbol `signgam'.  What a mess! -- rsm */

There are some threads discussing ways of solving this in old versions, and apparently only with Cygwin; however, I found that the simplest way to solve the problem is to make use of the C macro NO_SYSTEM_GAMMA referenced in the plotutils source - the package will then declare its own gamma functions for us. (So in fact, this isn't an error with plotutils, it's plotutils that provides the solution!)

The fix: make clean the directory and then run configure with an additional flag for the compiler defining the variable NO_SYSTEM_GAMMA. For example:

./configure --prefix=/where/to/install CFLAGS="-DNO_SYSTEM_GAMMA" --enable-libplotter

Then running make, make check and make install as usual, you should be good to go!

Remark: I actually had problems with the make check phase, which reported errors (8 of 11 failures, in fact!) when the relevant files (the .out and .xout files in the test directory) seemed to match. I recommend not worrying/bothering with these unless you have problems, or spot a potential future problem.

Other remark: The --enable-libplotter switch for the configure command is only needed if you want to use the C++ wrapper!

Posted by carl at 13:51

Filed under: Computing

Journal from September 2010

All entries from month September 2010

Simple diagrams for LaTeX with Inkscape • 1.7.2013 Yesterday I discovered how to make nice, simple, elegant diagrams for fairly painless inclusion… [read more - comment]No Data Connection (Android) • 4.6.2013 Just spent an age dealing with a phone (Samsung Galaxy S2, I9100, on the UK network 3) running a… [read more - comment]Android/BusyBox Segmentation Faults • 30.9.2012 Just had a terrifying moment when, after attempting to install BusyBox on an Android device,… [read more - comment]Temporarily Redefining In-built Mathematica Functions • 16.7.2012 Suppose a package you're using is, say, zealously Simplifying lots of Mathematica expressions… [read more - comment]Nuclear Power • 24.7.2011 I've never known the answers to the big questions about energy. I do know that with … [read more - comment]
top / xhtml / css
© Carl Turner 2008-2017
design & engine by suchideas / hosted by xenSmart