0

I'm trying to install cuda package with cabal on Mac OS X 10.7.5. The haskell was installed with haskell platform 64bit mac version. ghc version is 7.6.3, gcc version is 4.2.

>> cabal install cuda
Resolving dependencies...
[1 of 1] Compiling Main             ( /var/folders/ng/h2hkycqd2q5g2hz42c47bt4w0000gn/T/cuda-0.5.1.1-59169/cuda-0.5.1.1/Setup.hs, /var/folders/ng/h2hkycqd2q5g2hz42c47bt4w0000gn/T/cuda-0.5.1.1-59169/cuda-0.5.1.1/dist/setup/Main.o )
Linking /var/folders/ng/h2hkycqd2q5g2hz42c47bt4w0000gn/T/cuda-0.5.1.1-59169/cuda-0.5.1.1/dist/setup/setup ...
Configuring cuda-0.5.1.1...
checking for gcc... cc -arch i386 /usr/bin/gcc
checking whether the C compiler works... no
configure: error: in `/private/var/folders/ng/h2hkycqd2q5g2hz42c47bt4w0000gn/T/cuda-0.5.1.1-59169/cuda-0.5.1.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
Failed to install cuda-0.5.1.1
cabal: Error: some packages failed to install:
cuda-0.5.1.1 failed during the configure step. The exception was:
ExitFailure 77

It seems like that 32bit architecture of gcc is invoked when I installed 64 bit version of haskell.

What might be wrong?

prosseek
  • 182,215
  • 215
  • 566
  • 871
  • possible duplicate of [Install CUDA for Haskell using Autoconf on Win7](http://stackoverflow.com/questions/8890030/install-cuda-for-haskell-using-autoconf-on-win7) – talonmies Dec 16 '13 at 05:57

1 Answers1

0

I could use Install CUDA for Haskell using Autoconf on Win7 to solve the issue with Mac OS X.

  1. Remove previous versions - sudo uninstall-hs all --remove
  2. Install cuda sdk from https://developer.nvidia.com/cuda-downloads?sid=407404
  3. download haskell cuda source http://hackage.haskell.org/package/cuda
  4. Open Setup.hs
  5. At line 56, modify the code to use clang - [("CC", "/usr/bin/clang") Or you can setup any c/c++ compiler "/opt/local/bin/gcc-mp-4.8".

Then run the runhaskell:

> cabal install

Or, you can execute these three commands:

>runhaskell Setup.hs configure
>runhaskell Setup.hs build
>runhaskell Setup.hs install
Community
  • 1
  • 1
prosseek
  • 182,215
  • 215
  • 566
  • 871