-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building requires compiler change on OS X 10.9 #15
Comments
Can you please add clang output to the issue? Building $ clang -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
$ ghc -V
The Glorious Glasgow Haskell Compilation System, version 7.6.3
$ cabal -V
cabal-install version 1.20.0.1
using version 1.20.0.0 of the Cabal library |
Sure thing, here's the output: % cabal install bitset --with-gcc=/usr/bin/clang
Resolving dependencies...
Notice: installing into a sandbox located at /private/tmp/.cabal-sandbox
Configuring bitset-1.4.8...
Building bitset-1.4.8...
Failed to install bitset-1.4.8
Last 10 lines of the build log ( /private/tmp/.cabal-sandbox/logs/bitset-1.4.8.log ):
[1 of 1] Compiling Main ( /var/folders/qk/bpmfcc8s3pq64gs7bn80k60r0000gp/T/bitset-1.4.8-8598/bitset-1.4.8/dist/dist-sandbox-39782a75/setup/setup.hs, /var/folders/qk/bpmfcc8s3pq64gs7bn80k60r0000gp/T/bitset-1.4.8-8598/bitset-1.4.8/dist/dist-sandbox-39782a75/setup/Main.o )
Linking /var/folders/qk/bpmfcc8s3pq64gs7bn80k60r0000gp/T/bitset-1.4.8-8598/bitset-1.4.8/dist/dist-sandbox-39782a75/setup/setup ...
Configuring bitset-1.4.8...
bin/mkDerivedGmpConstants.c:15:10: fatal error: './gmp.h' file not found
#include "./gmp.h"
^
1 error generated.
cabal: Error: some packages failed to install:
bitset-1.4.8 failed during the building phase. The exception was:
ExitFailure 1
% /usr/bin/clang --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
% ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
% cabal --version
cabal-install version 1.20.0.1
using version 1.20.0.0 of the Cabal library By default in 10.9, gcc is just an alias for clang, so I point it to a MacPorts-installed gcc instead and everything works. |
Can you please try building the version from |
I expected this to work, so when it did not I dug into how clang looks for includes. When passing |
FYI: I just ran into this, and the same fix @acfoltzer used worked (on El Capitan, with ghc 7.8.4 and: $ cabal --version
cabal-install version 1.22.7.0
using version 1.22.5.0 of the Cabal library according to It's also possibly worth mentioning that setting the environment variable on the command line works if you're just installing bitset, it does not work if bitset is a dependency of something you're installing, so I'm still stuck, actually. |
The default C compiler on newer versions of OS X is clang rather than gcc. Using clang, the bitset installation fails as it can't find the
"./gmp.h"
include. For now, usingcabal install bitset --with-gcc=$MY_GCC
works, but it would be nice if the build worked with clang as well. Thanks!The text was updated successfully, but these errors were encountered: