![오류: #error 이 파일에는 ISO C++ 2011 표준에 대한 컴파일러 및 라이브러리 지원이 필요합니다.](https://linux55.com/image/191772/%EC%98%A4%EB%A5%98%3A%20%23error%20%EC%9D%B4%20%ED%8C%8C%EC%9D%BC%EC%97%90%EB%8A%94%20ISO%20C%2B%2B%202011%20%ED%91%9C%EC%A4%80%EC%97%90%20%EB%8C%80%ED%95%9C%20%EC%BB%B4%ED%8C%8C%EC%9D%BC%EB%9F%AC%20%EB%B0%8F%20%EB%9D%BC%EC%9D%B4%EB%B8%8C%EB%9F%AC%EB%A6%AC%20%EC%A7%80%EC%9B%90%EC%9D%B4%20%ED%95%84%EC%9A%94%ED%95%A9%EB%8B%88%EB%8B%A4..png)
Ubuntu 20.04 LTS에서 TAU(Profiling and Profiling Tools)를 사용하여 C++ 코드를 실행하기 위해 일부 클러스터를 사용하고 있습니다. 내가 실행하는 명령은 다음과 같습니다.
tau_cxx.sh -I$FFTW3_INC wrappingScript.cpp spectralFunctions.cpp arithmeticFunctions.cpp -optLinking="-lfftw3 -lm -g" -o ../../Datasim/TauTest.out
그러나 이로 인해 다음과 같은 오류가 발생합니다.
Executing> /opt/apps/gcc/5.2.0/bin/g++ -I/opt/apps/gcc5_2/mvapich22_2/fftw/3.3.8/include wrappingScript.cpp spectralFunctions.cpp arithmeticFunctions.cpp -o ../../Datasim/TauTest.out
In file included from /arcapps/cascades-broadwell-slurm/opt/apps/gcc/5.2.0/include/c++/5.2.0/cstdint:35:0,
from arithmeticFunctions.cpp:8:
/arcapps/cascades-broadwell-slurm/opt/apps/gcc/5.2.0/include/c++/5.2.0/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
make: *** [all] Error 1
그래서 저는 다음과 같이 컴파일하려고 합니다 -std=c++11
.
tau_cxx.sh -I$FFTW3_INC -std=c++11 wrappingScript.cpp spectralFunctions.cpp arithmeticFunctions.cpp -optLinking="-lfftw3 -lm -g" -o ../../Datasim/TauTest.out
이것은 어떻게 든 나를 엉망으로 만들고 -I$FFTW3_INC
다음과 같은 오류가 발생합니다.
undefined reference to `fftw_malloc'
또한 다음과 같은 TAU 옵션에 연결해 보았습니다.
tau_cxx.sh -I$FFTW3_INC wrappingScript.cpp spectralFunctions.cpp arithmeticFunctions.cpp -optLinking="-lfftw3 -lm -std=c++11 -g" -o ../../Datasim/TauTest.out
이것은 효과가 없으며 원래 오류가 발생합니다. 누구든지 도와줄 수 있나요?
답변1
(필수) -std=c++11
플래그를 추가한 후(이상하게도 현재 기본값(예: ISO C++ 2017 + GNU 확장)에는 이전 플래그가 포함되어야 함) 컴파일할 수 있지만 -std=gnu++17
정의 (아마도 일부 라이브러리에서는) fftw_malloc
가 사라졌습니다. 매뉴얼 페이지를 확인하면 fftw_malloc
올바른 철자를 알려줄 것입니다. 에서 호출되는 경우 Makefile
줄 LIB =
이나 유사한 줄을 확인하세요.