2014-09-30 11 views
6

Ben derleme için nvcc gereksinimine sahip birbir yazılım yapıyorum. CUDA özellikli bir GPU'm yok, ama aslında buna ihtiyacım yok - bir arkadaş Linux'ta tam olarak aynı yazılımını yapıyor, CUDA GPU'su yok, ama her şey yolunda.nvcc + c2hs 10.9.5

En yeni CUDA araç setini https://developer.nvidia.com/cuda-downloads (cuda_6.5.14_mac_64.pkg) ürününden sorunsuz bir şekilde kurdum. Ama ben 'u numaralı yazılımda yaptığım gibi sorunlara girdim. Ben tavşan deliğinden derinlerine gitmek başardı elinde iz ile

$ mkdir temp; cd temp; cabal sandbox init 


$ cabal get cuda 
Unpacking to cuda-0.6.5.0/ 


$ cd cuda-0.6.5.0/Foreign/CUDA/Analysis 


$ c2hs -d trace --cpp=/Developer/NVIDIA/CUDA-6.5/bin/nvcc --cppopts=-ccbin --cppopts=/usr/bin/clang --cppopts=-Xcompiler --cppopts=--stdlib=libstdc++ Device.chs 
Attempting to read file `Device.chs'... 
...parsing `Device'... 
...successfully loaded `Device'. 
Invoking cpp as `/Developer/NVIDIA/CUDA-6.5/bin/nvcc -E -x c -ccbin /usr/bin/clang -Xcompiler --stdlib=libstdc++ -U__BLOCKS__ -DC2HS_MIN_VERSION(mj,mn,rv)=(mj<=0&&mn<=18&&rv<=2) Device.chs.h'... 
In file included from <built-in>:170: 
<command line>:3:29: error: expected comma in macro parameter list 
#define C2HS_MIN_VERSION(mj 1 
          ^
<command line>:5:11: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions] 
#define rv) (mj<=0&&mn<=18&&rv<=2) 
     ^
Device.chs.h:1:10: fatal error: 'cbits/stubs.h' file not found 
#include "cbits/stubs.h" 
     ^
1 warning and 2 errors generated. 
c2hs: Error during preprocessing custom header file 

:

Ben küçük bir ölçekte sorunu yeniden başardı

$ /Developer/NVIDIA/CUDA-6.5/bin/nvcc -E -x c -ccbin /usr/bin/clang -Xcompiler --stdlib=libstdc++ -U__BLOCKS__ -DC2HS_MIN_VERSION(mj,mn,rv)=(mj<=0&&mn<=18&&rv<=2) Device.chs.h 
zsh: parse error near `)' 


$ /Developer/NVIDIA/CUDA-6.5/bin/nvcc -E -x c -ccbin /usr/bin/clang -Xcompiler --stdlib=libstdc++ -U__BLOCKS__ -D'C2HS_MIN_VERSION(mj,mn,rv)=(mj<=0&&mn<=18&&rv<=2)' Device.chs.h 
# 1 "Device.chs.h" 
# 1 "<built-in>" 1 
# 1 "<built-in>" 3 
# 170 "<built-in>" 3 
# 1 "<command line>" 1 
In file included from <built-in>:170: 
<command line>:3:29: error: expected comma in macro parameter list 
#define C2HS_MIN_VERSION(mj 1 
          ^
<command line>:5:11: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions] 
#define rv) (mj<=0&&mn<=18&&rv<=2) 
     ^
# 1 "<built-in>" 2 
# 1 "Device.chs.h" 2 
Device.chs.h:1:10: fatal error: 'cbits/stubs.h' file not found 
#include "cbits/stubs.h" 
     ^

1 warning and 2 errors generated. 


$ Developer/NVIDIA/CUDA-6.5/bin/nvcc -x c -D 'C2HS_MIN_VERSION(mj,mn,rv)=(mj<=0&&mn<=18&&rv<=2)' Device.chs.h 
(same issue) 

Hiç var fikrin nasıl düzeltileceği. Bu arada, hem clang hem de gcc, -D aracılığıyla argümanlarla makroları geçirerek tamamdır.

Muhtemelen ilgili:

$ echo $PATH 
/Users/konrad/bin:/Users/konrad/.ghc-current/bin:/Users/konrad/.cabal/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Developer/NVIDIA/CUDA-6.5/bin 

$ echo $DYLD_LIBRARY_PATH 
/Developer/NVIDIA/CUDA-6.5/lib: 

$ echo $LD_LIBRARY_PATH 
/usr/local/cuda/lib: 

$ ghc --version 
The Glorious Glasgow Haskell Compilation System, version 7.8.3 

$ cabal --version 
cabal-install version 1.20.0.3 
using version 1.20.0.0 of the Cabal library 

$ c2hs --version 
C->Haskell Compiler, version 0.18.2 The shapeless maps, 31 Oct 2014 
    build platform is "x86_64-darwin" <1, True, True, 1> 

$ gcc --version 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) 
Target: x86_64-apple-darwin13.4.0 
Thread model: posix 

$ gcc-4.9 --version 
gcc-4.9 (GCC) 4.9.0 20140411 (prerelease) 
Copyright (C) 2014 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

I (geç 2013 MBP Retina 15"), Intel İris Pro 5100 var

+0

Zsh önce hiç kullanılmamış, bir şekilde (?) komut satırınızı genişleterek olabilir n beklenmedik bir şekilde? Yani '' mn '' kısmı gitmiş gibi görünüyor. Belki de emrinize "noglob" yazmayı deneyebilirsiniz? –

+0

Bunu zaten denedim, 'sh' maalesef tam olarak aynı sonuçları kullandı. – kgadek

cevap

2

olarak https://github.com/haskell/c2hs/issues/111 başına, bir değişiklik c2hs HEAD itildi 21 Kasım etrafında çalışmak. nvcc bir upstream quirk tarafından neden oldu, bu nedenle, bu noktada, en son c2hs kullanarak gerçekten işe yaramalıdır.

+0

Teşekkürler, yakında tekrar deneyeceğim! – kgadek

İlgili konular