[Haskell-beginners] cmath Install troubles

Tom Murphy amindfv at gmail.com
Thu Apr 19 03:39:28 CEST 2012

On 4/18/12, Brandon Allbery <allbery.b at gmail.com> wrote:
> On Wed, Apr 18, 2012 at 16:18, Tom Murphy <amindfv at gmail.com> wrote:
>> 2 important facts:
>> - A test C program, using one of the "undefined" functions (isnan)
>> compiles with GCC and runs
>> - I went in by hand and temporarily replaced each version of math.h on
>> my computer with a version that has the necessary functions defined.
>> Cabal-install still failed with the same error.
>> This makes it seem like cabal doesn't have access to _any_ math.h
>> file, but if this were the case, wouldn't I get many more
>> undefined-function errors than I do?
> Unless you are using an older ghc with -fvia-C,
I have 7.0.4.

> <math.h> is not used or
> useful.  The modern -fasm codegen doesn't know what to do with C-level
> declarations.  If your <math.h> is using macros to define gamma as
> something else, you will need to find that something else or use a wrapper
> library.

Hmm, that's true...
I don't really understand how .hsc files are compiled, but isn't the
"#include <math.h>" in cmath done in the very standard FFI style?

> I note that OS X doesn't have a gamma().  There are lgamma() and tgamma()
> and variations thereon.  (and no related macros in <math.h>, confirming
> that it is not related.)

What do you mean by OS X not having them? On my system (10.6), gamma()
is defined (at least in math.h (well, at least the ones in
/usr/include/architecture/i386/ and

Thanks for your help.

More information about the Beginners mailing list