오류: #error 이 파일에는 ISO C++ 2011 표준에 대한 컴파일러 및 라이브러리 지원이 필요합니다.

오류: #error 이 파일에는 ISO C++ 2011 표준에 대한 컴파일러 및 라이브러리 지원이 필요합니다.

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올바른 철자를 알려줄 것입니다. 에서 호출되는 경우 MakefileLIB =이나 유사한 줄을 확인하세요.

관련 정보