3

I'm trying to build the text library on OS X 10.8 (Mountain Lion) but I get the following erros:

beta@lucy:/tmp/text-0.11.2.2 ☺ $ cabal configure 
Resolving dependencies...
Configuring text-0.11.2.2...

/var/folders/2h/9h8d4hb57cl65ww61yxtkmv00000gn/T/4266.c:1:12:
     warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
           ^
1 warning generated.
beta@lucy:/tmp/text-0.11.2.2 ☺ $ cabal build    
Building text-0.11.2.2...
Preprocessing library text-0.11.2.2...

Data/Text.hs:6:52:  warning: missing terminating ' character
-- Copyright   : (c) 2009, 2010, 2011, 2012 Bryan O'Sullivan,
                                                   ^

Data/Text.hs:87:12:
     warning: missing terminating ' character
        , foldl'
               ^

     [snip]
                                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
27 warnings and 20 errors generated.

I am using GHC 7.4.2. The following versions of gcc/llvm-gcc are installed (through XCode's command line tools):

gcc:

beta@lucy:/tmp/text-0.11.2.2 ☹ $ which gcc
/usr/bin/gcc
beta@lucy:/tmp/text-0.11.2.2 ☺ $ gcc -v   
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

llvm-gcc:

beta@lucy:/tmp/text-0.11.2.2 ☺ $ which llvm-gcc
/usr/bin/llvm-gcc
beta@lucy:/tmp/text-0.11.2.2 ☺ $ llvm-gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

Any pointers to what the problem can be? Can anyone else build text on Mountain Lion?

beta
  • 2,380
  • 21
  • 38
  • Builds on my computer... same version of llvm-gcc. I have XCode 4.4 installed. – Nathan Howell Jul 28 '12 at 15:41
  • I am also having this problem, with a new 10.7.4 machine, with GHC 7.4.2 and X-Code 4.4 (GCC 4.2.1). This would seem to be due to CPP. – solidsnack Aug 20 '12 at 19:17
  • Yeah, it looked like it was a CPP problem. I spent some time trying to get to the bottom of it, but in the end I just reinstalled the Haskell Platform. :/ – beta Aug 21 '12 at 08:02

1 Answers1

1

I also encountered this problem during my PAKCS installation on my 10.8.5.

My solution was

  1. Install Apple gcc-4.2
    brew install apple-gcc42
  2. Edit /usr/bin/ghc and change pgmgcc as follows
    pgmgcc="/usr/local/bin/gcc-4.2"
  3. Rebuild all packages by referring to the answer of What's the best workaround for not having "cabal upgrade"?

Finally, I could complete my text package installation.

I hope you have fun!

See also: Cabal doesn't work on Mac OS X Lion because of gcc path

Community
  • 1
  • 1
Fujimoto Youichi
  • 7,039
  • 1
  • 15
  • 10