在Mac OS X 10.7.5中安装cuda模块时出错(检查C编译器是否工作... no) [英] Error installing cuda module in Mac OS X 10.7.5 (checking whether the C compiler works… no)

查看:507
本文介绍了在Mac OS X 10.7.5中安装cuda模块时出错(检查C编译器是否工作... no)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Mac OS X 10.7.5上安装cuda软件包与cabal。
haskell安装了haskell平台64位mac版本。 ghc版本为7.6.3,gcc版本为4.2。

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

似乎是调用32位架构的gcc我安装了64位版本的haskell。

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

可能有什么问题?

推荐答案

href =http://stackoverflow.com/questions/8890030/install-cuda-for-haskell-using-autoconf-on-win7>使用Autoconf on Win7安装CUDA for Haskell 解决Mac的问题

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


  1. 删除以前的版本 - sudo uninstall-hs all --remove

  2. https://开发人员安装cuda sdk。 nvidia.com/cuda-downloads?sid=407404

  3. 下载haskell cuda源 http://hackage.haskell.org/package/cuda

  4. 打开 Setup.hs

  5. 在第56行,修改代码以使用clang - [(CC,/ usr / bin / clang)
    或者您可以设置任何c / c ++编译器/opt/local/bin/gcc-mp-4.8。

  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".

然后运行runhaskell:

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

这篇关于在Mac OS X 10.7.5中安装cuda模块时出错(检查C编译器是否工作... no)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆