Je suis sur Mac OS Sierra 10.12.4 et essayer de faire CUDA 8.0 travail sur mon MacBook Pro (fin 2013) avec le CUDA compatible NVIDIA GeForce GT 750M.« make » commande utilise le compilateur clang mal (pour compiler les échantillons CUDA) - comment résoudre ce problème?
J'ai suivi les NVIDIA installation guide et installé Xcode 8.2 et les outils de ligne de commande correspondant, mais lorsque je tente de compiler les exemples que je reçois l'erreur suivante:
$ make -C 1_Utilities/deviceQuery
/Developer/NVIDIA/CUDA-8.0/bin/nvcc -ccbin clang++ -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_60,code=compute_60 -o deviceQuery.o -c deviceQuery.cpp
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc fatal : The version ('30900') of the host compiler ('clang') is not supported
make: *** [deviceQuery.o] Error 1
Voici Je pense que le problème est:
le « make » commande utilise le mauvais clang, mais je ne sais pas comment changer/corriger cela.
Ici vous pouvez voir les deux versions de tintement, qui sont sur ma machine:
$ clang --version
clang version 3.9.0 (tags/RELEASE_390/final)
Target: x86_64-apple-darwin16.5.0 Thread model: posix
InstalledDir: /opt/local/libexec/llvm-3.9/bin$ /usr/bin/clang --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.5.0
Thread model: posix InstalledDir: /Applications/Xcode_8.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Comment puis-je faire la commande "make" utiliser la version clang correcte dans le dossier/usr/bin/clang par défaut?
Ou est-il un moyen de dire « faire » commande d'utiliser la version clang dans le dossier/usr/bin/clang explicitement en ajoutant des paramètres/tags?
Voici aussi comment mon ~/.bash_profile ressemble si cela aide:
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
# MacPorts Installer addition on 2016-09-26_at_12:06:30: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# colorful terminal
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
# CUDA
export PATH=/Developer/NVIDIA/CUDA-8.0.61/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-8.0.61/lib\
${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
merci beaucoup, remplaçant "clang ++" avec "/ usr/bin/clang" dans les fichiers de construction fixe la question :) –