데비안 GNU/리눅스 시스템에서 CUDA 툴킷으로 컴파일하려고하지만 아주 단순한 프로그램에서도 C++ 11 지원이 분명히 있습니다. 부서진.CUDA nvcc 컴파일러가 C++ 11을 사용하면 실패합니다. (Linux; clang 3.8)
- 리눅스 커널 : 4.13.0
- CUDA 툴킷 : 8.0.61
- 연타 :
첫째, 여기에 관련 소프트웨어 버전의 목록입니다 3.8.1
- 의 libc : 2.25
- 된 libstdC++ : 정말 기본적인 테스트 파일을 사용하여 7.2.0
,아래는 :
__global__ void testfunc(float *a, float *b, int N)
{
for (int i = 0; i < N; ++i) {
b[i] += a[i];
}
}
그리고 명령을 사용하여 컴파일 :
nvcc -ccbin clang-3.8 -std c++11 -o test test.cu
나는
declaration conflicts with target of using declaration already in scope
오류의 긴 목록을 가져옵니다. 아래에 두 가지를 보여 드리겠습니다. 자동으로 20으로 자릅니다.
/usr/include/math_functions.h:8925:41: error: declaration conflicts with target of using declaration already in scope
__attribute((always_inline)) inline int signbit(float x);
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/cmath:668:16: note: target of using declaration
constexpr bool signbit(float __x)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/math.h:68:12: note: using declaration
using std::signbit;
^
/usr/include/math_functions.h:8929:41: error: declaration conflicts with target of using declaration already in scope
__attribute((always_inline)) inline int signbit(double x);
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/cmath:672:16: note: target of using declaration
constexpr bool signbit(double __x)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/math.h:68:12: note: using declaration
using std::signbit;
^
CUDA와 호환되지 않는 컴파일러/라이브러리 버전을 사용하고 있습니까? 특히 데비안이 Nvidia에서 공식적으로 지원하지 않기 때문에이 정보를 찾는 것이 어려워 보입니다. 데비안 저장소가 배포 한 패키지 만 사용하고 있습니다 (테스트 배포 중입니다).
아마도 지원되는 배포판에서 시도해야합니다. clang을 사용하려고하기 때문에, 이것은 올바르게 보이지 않습니다.'..lib/gcc/..'[here] (https://stackoverflow.com/questions/24342312/clang-seems-to-use)를보십시오. -the-gcc-libraries) –
고맙습니다 @RobertCrovella, libC++을 설치하고 clang에 gcc 라이브러리 (CUDA 8.0에 너무 새로 추가되었습니다)를 사용하는 대신'--compiler-options -stdlib = libC++' 지원). 나는 대답을 쓸 것이다. – Archimaredes