
Any advice? If you can't even install a package with no dependencies except base, I think there's trouble: $ cabal install cmath Resolving dependencies... Configuring cmath-0.3... Preprocessing library cmath-0.3... Building cmath-0.3... [1 of 1] Compiling Foreign.C.Math.Double ( dist/build/Foreign/C/Math/Double.hs, dist/build/Foreign/C/Math/Double.o ) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc: In function ‘s2sB_ret’: /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:2850:0: error: ‘gamma’ undeclared (first use in this function) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:2850:0: error: (Each undeclared identifier is reported only once /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:2850:0: error: for each function it appears in.) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc: In function ‘s2t0_ret’: /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:2896:0: error: ‘gamma’ undeclared (first use in this function) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc: In function ‘s2uH_ret’: /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:3088:0: error: ‘isinf’ undeclared (first use in this function) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc: In function ‘s2v6_ret’: /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:3134:0: error: ‘isinf’ undeclared (first use in this function) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc: In function ‘s2vv_ret’: /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:3180:0: error: ‘isnan’ undeclared (first use in this function) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc: In function ‘s2vU_ret’: /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:3226:0: error: ‘isnan’ undeclared (first use in this function) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc: In function ‘s2wj_ret’: /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:3272:0: error: ‘finite’ undeclared (first use in this function) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc: In function ‘s2wI_ret’: /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:3318:0: error: ‘finite’ undeclared (first use in this function) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc: In function ‘s2Kh_ret’: /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:4856:0: error: ‘significand’ undeclared (first use in this function) /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc: In function ‘s2KG_ret’: /var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/ghc70799_0/ghc70799_0.hc:4902:0: error: ‘significand’ undeclared (first use in this function) cabal: Error: some packages failed to install: cmath-0.3 failed during the building phase. The exception was: ExitFailure 1 Thanks for any help! amindfv / Tom

On Thu, Jan 19, 2012 at 2:06 PM, Tom Murphy
Any advice?
If you can't even install a package with no dependencies except base, I think there's trouble:
$ cabal install cmath Resolving dependencies... Configuring cmath-0.3... Preprocessing library cmath-0.3... Building cmath-0.3...
Which version of ghc are you using? Which version of the 'cabal' executable do you have installed? Thanks, Antoine

Sorry; brain not working today:
The Glorious Glasgow Haskell Compilation System, version 7.0.3
cabal-install version 0.10.2
using version 1.10.1.0 of the Cabal library
amindfv / Tom
On 1/19/12, Antoine Latter
On Thu, Jan 19, 2012 at 2:06 PM, Tom Murphy
wrote: Any advice?
If you can't even install a package with no dependencies except base, I think there's trouble:
$ cabal install cmath Resolving dependencies... Configuring cmath-0.3... Preprocessing library cmath-0.3... Building cmath-0.3...
Which version of ghc are you using? Which version of the 'cabal' executable do you have installed?
Thanks, Antoine

Is it possible that I have a version of math.h which doesn't have
these definitions ("gamma," "finite," "isinf," etc.) in it?
Tom
On 1/19/12, Tom Murphy
Sorry; brain not working today:
The Glorious Glasgow Haskell Compilation System, version 7.0.3 cabal-install version 0.10.2 using version 1.10.1.0 of the Cabal library
amindfv / Tom
On 1/19/12, Antoine Latter
wrote: On Thu, Jan 19, 2012 at 2:06 PM, Tom Murphy
wrote: Any advice?
If you can't even install a package with no dependencies except base, I think there's trouble:
$ cabal install cmath Resolving dependencies... Configuring cmath-0.3... Preprocessing library cmath-0.3... Building cmath-0.3...
Which version of ghc are you using? Which version of the 'cabal' executable do you have installed?
Thanks, Antoine

On Thu, Jan 19, 2012 at 3:24 PM, Tom Murphy
Is it possible that I have a version of math.h which doesn't have these definitions ("gamma," "finite," "isinf," etc.) in it?
That's a good guess based on the error messages - or math.h isn't in whatever paths we're looking in. What sort of system are you compiling this on? You could write a test C program using those functions, if you're familiar with your C tool-chain. Antoine

I had this problem with an updated archlinux 64bit. I ``fixed'' it forcing binutils to downgrade. pacman -Udd http://arm.konnichi.com/core/os/x86_64/binutils-2.20.1-4-x86_64.pkg.tar.xz cabal install cmath pacman -S binutils I'm also having a similar error with bindings-sc3 now, but it does not ``fix'' it.

On Thu, Jan 19, 2012 at 16:37, Antoine Latter
On Thu, Jan 19, 2012 at 3:24 PM, Tom Murphy
wrote: Is it possible that I have a version of math.h which doesn't have these definitions ("gamma," "finite," "isinf," etc.) in it?
That's a good guess based on the error messages - or math.h isn't in whatever paths we're looking in.
What sort of system are you compiling this on?
Pathnames indicated it's OS X. My first question is whether the appropriate Xcode is installed, including the optional components (pre-Xcode 4, the "BSD" packages needed to compile most Unix software were optional). Note that Xcode 4 from the App Store actually puts an installer program in /Applications; that has to be run to actually install Xcode. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On 1/19/12, Brandon Allbery
On Thu, Jan 19, 2012 at 16:37, Antoine Latter
wrote: On Thu, Jan 19, 2012 at 3:24 PM, Tom Murphy
wrote: Is it possible that I have a version of math.h which doesn't have these definitions ("gamma," "finite," "isinf," etc.) in it?
That's a good guess based on the error messages - or math.h isn't in whatever paths we're looking in.
If math.h wasn't in the paths at all, wouldn't I get an error about _every_ function being undefined?
What sort of system are you compiling this on?
Mac OS 10.6.7
[...] My first question is whether the appropriate Xcode is installed, including the optional components (pre-Xcode 4, the "BSD" packages needed to compile most Unix software were optional).
I really am not sure about whether I installed the BSD packages. I'd guess I did, but maybe not. How can I tell, and is there a simple remedy?
Note that Xcode 4 from the App Store actually puts an installer program in /Applications; that has to be run to actually install Xcode.
It's XCode 3.2.6. Also, I've got 20 copies of math.h on my hard drive, at least of couple of which feature definitions of "gamma," "isinf," etc. Thanks for your help! Tom

On Fri, Jan 20, 2012 at 15:26, Tom Murphy
On 1/19/12, Brandon Allbery
wrote: On Thu, Jan 19, 2012 at 16:37, Antoine Latter
wrote: On Thu, Jan 19, 2012 at 3:24 PM, Tom Murphy
wrote: Is it possible that I have a version of math.h which doesn't have these definitions ("gamma," "finite," "isinf," etc.) in it?
That's a good guess based on the error messages - or math.h isn't in whatever paths we're looking in.
If math.h wasn't in the paths at all, wouldn't I get an error about _every_ function being undefined?
The problem isn't math.h; these are link errors, so it's /usr/lib/libm.dylib that is somehow wrong. I can't help with this too much as I'm on Lion so it's a symlink to libSystem.dylib (and if that's messed up, you don't even *boot* much less compile stuff). -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

I've got some free time again so I'm returning to this problem.
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?
Thanks for the help,
Tom
On 1/20/12, Brandon Allbery
On Fri, Jan 20, 2012 at 15:26, Tom Murphy
wrote: On 1/19/12, Brandon Allbery
wrote: On Thu, Jan 19, 2012 at 16:37, Antoine Latter
wrote: On Thu, Jan 19, 2012 at 3:24 PM, Tom Murphy
wrote: Is it possible that I have a version of math.h which doesn't have these definitions ("gamma," "finite," "isinf," etc.) in it?
That's a good guess based on the error messages - or math.h isn't in whatever paths we're looking in.
If math.h wasn't in the paths at all, wouldn't I get an error about _every_ function being undefined?
The problem isn't math.h; these are link errors, so it's /usr/lib/libm.dylib that is somehow wrong. I can't help with this too much as I'm on Lion so it's a symlink to libSystem.dylib (and if that's messed up, you don't even *boot* much less compile stuff).
-- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On Wed, Apr 18, 2012 at 16:18, Tom Murphy
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,

On 4/18/12, Brandon Allbery
On Wed, Apr 18, 2012 at 16:18, Tom Murphy
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.
[...]
is not used or useful. The modern -fasm codegen doesn't know what to do with C-level declarations. If your 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
I note that OS X doesn't have a gamma(). There are lgamma() and tgamma() and variations thereon. (and no related macros in
, 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 /Developer/SDKs/MacOSX10.6.sdk/usr/include/architecture/i386/)) Thanks for your help. Tom

On Wed, Apr 18, 2012 at 21:39, Tom Murphy
On 4/18/12, Brandon Allbery
wrote: On Wed, Apr 18, 2012 at 16:18, Tom Murphy
wrote: 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.
7.0.4 has -fasm by default, but you can force -fvia-C still. With -fasm, the include files are not used afaik; since direct assembly code is created and not C code, a C include file is not useful.
Hmm, that's true... I don't really understand how .hsc files are compiled, but isn't the "#include
" in cmath done in the very standard FFI style?
If warnings are on, I think that elicits a "this is not used any more" warning with -fasm.
I note that OS X doesn't have a gamma(). There are lgamma() and tgamma()
and variations thereon. (and no related macros in
, confirming that it is not related.) What do you mean by OS X not having them? On my system (10.6), gamma()
I'm on 10.7, and I have no gamma(). I just checked the 10.6 SDK includes; it has extern double gamma ( double ); /* Legacy API: please use C99 tgamma() instead. */ so apparently it was deprecated and is now removed. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On 4/19/12, Brandon Allbery
On Wed, Apr 18, 2012 at 21:39, Tom Murphy
wrote: On 4/18/12, Brandon Allbery
wrote: On Wed, Apr 18, 2012 at 16:18, Tom Murphy
wrote: 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.
7.0.4 has -fasm by default, but you can force -fvia-C still. With -fasm, the include files are not used afaik; since direct assembly code is created and not C code, a C include file is not useful.
Hmm, that's true... I don't really understand how .hsc files are compiled, but isn't the "#include
" in cmath done in the very standard FFI style? If warnings are on, I think that elicits a "this is not used any more" warning with -fasm.
So does nobody use cmath anymore? I'm trying to install the latest version (which is from 2008). Tom

On Thu, Apr 19, 2012 at 06:31, Tom Murphy
So does nobody use cmath anymore? I'm trying to install the latest version (which is from 2008).
At a guess, it's well supported on Linux and (since it's dons) NetBSD. OS X and Windows, probably not so well tested. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

cmath doesn't build now, but I successfully installed hsc3 (which
depends on cmath) on my computer less than 6 months ago. Same CPU and
OS version, but different ghc/HP, and possibly different XCode.
Also:
Some other packages which have the same FFI C-include style build fine
on my machine. Some which even include math.h. For example:
- strptime
- mp3decoder
So maybe it's not a problem involving not having -fvia-c?
Tom
On 4/19/12, Brandon Allbery
On Thu, Apr 19, 2012 at 06:31, Tom Murphy
wrote: So does nobody use cmath anymore? I'm trying to install the latest version (which is from 2008).
At a guess, it's well supported on Linux and (since it's dons) NetBSD. OS X and Windows, probably not so well tested.
-- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

Also, is there a way that I could "short circuit" (in the "True || _ =
True" sense) the whole process of fixing this?
For example, cabal-install cmath on a machine with similar
architecture and OS, break out my SICP [0], and try to replicate
cabal's storage methods by hand?
Tom
[0] http://www.vex.net/~trebla/haskell/sicp.xhtml
On 4/19/12, Tom Murphy
cmath doesn't build now, but I successfully installed hsc3 (which depends on cmath) on my computer less than 6 months ago. Same CPU and OS version, but different ghc/HP, and possibly different XCode.
Also:
Some other packages which have the same FFI C-include style build fine on my machine. Some which even include math.h. For example: - strptime - mp3decoder
So maybe it's not a problem involving not having -fvia-c?
Tom
On 4/19/12, Brandon Allbery
wrote: On Thu, Apr 19, 2012 at 06:31, Tom Murphy
wrote: So does nobody use cmath anymore? I'm trying to install the latest version (which is from 2008).
At a guess, it's well supported on Linux and (since it's dons) NetBSD. OS X and Windows, probably not so well tested.
-- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
participants (4)
-
Antoine Latter
-
Bernardo Barros
-
Brandon Allbery
-
Tom Murphy