我在制作HSAIL时遇到以下问题:
[ 3%] Built target libhsail-includes
[ 6%] Building CXX object libHSAIL/CMakeFiles/hsail.dir/HSAILScannerRules.cpp.o
In file included from /home/Computador/hsail/HSAIL-Tools-master/libHSAIL/HSAILScannerRules.cpp:46:0:
/home/Computador/hsail/build/libHSAIL/generated/HSAILScannerRules_gen_re2c.hpp: In member function ‘HSAIL_ASM::ETokens HSAIL_ASM::Scanner::scanModifier(HSAIL_ASM::EScanContext, HSAIL_ASM::Scanner::Token&)’:
/home/Computador/hsail/build/libHSAIL/generated/HSAILScannerRules_gen_re2c.hpp:271:17: error: unused variable ‘ctxMarker’ [-Werror=unused-variable]
const char *ctxMarker = NULL;
^~~~~~~~~
/home/Computador/hsail/build/libHSAIL/generated/HSAILScannerRules_gen_re2c.hpp: In member function ‘HSAIL_ASM::ETokens HSAIL_ASM::Scanner::scanDefault(HSAIL_ASM::EScanContext, HSAIL_ASM::Scanner::Token&)’:
/home/Computador/hsail/build/libHSAIL/generated/HSAILScannerRules_gen_re2c.hpp:14065:17: error: unused variable ‘ctxMarker’ [-Werror=unused-variable]
const char *ctxMarker = NULL;
^~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [libHSAIL/CMakeFiles/hsail.dir/build.make:248: libHSAIL/CMakeFiles/hsail.dir/HSAILScannerRules.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: libHSAIL/CMakeFiles/hsail.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
使用 make 执行以下命令(make --just-print)
make CXXFLAGS+=-Wno-error=unused-variable -f HSAILAsm/CMakeFiles/HSAILasm.dir/build.make HSAILAsm/CMakeFiles/HSAILasm.dir/depend
cd /home/Computador/hsail/build && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /home/Computador/hsail/HSAIL-Tools-master /home/Computador/hsail/HSAIL-Tools-master/HSAILAsm /home/Computador/hsail/build /home/Computador/hsail/build/HSAILAsm /home/Computador/hsail/build/HSAILAsm/CMakeFiles/HSAILasm.dir/DependInfo.cmake --color=
make CXXFLAGS+=-Wno-error=unused-variable -f HSAILAsm/CMakeFiles/HSAILasm.dir/build.make HSAILAsm/CMakeFiles/HSAILasm.dir/build
/usr/bin/cmake.exe -E cmake_echo_color --switch= --green --progress-dir=/home/Computador/hsail/build/CMakeFiles --progress-num=1 "Building CXX object HSAILAsm/CMakeFiles/HSAILasm.dir/HSAILAsm.cpp.o"
cd /home/Computador/hsail/build/HSAILAsm && /usr/bin/c++.exe -DAMD_EXTENSIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/Computador/hsail/HSAIL-Tools-master/libHSAIL -I/home/Computador/hsail/build/libHSAIL/generated -I/home/Computador/hsail/HSAIL-Tools-master/libHSAIL-AMD -I/home/Computador/hsail/build/libHSAIL-AMD/generated -fpic -Wall -Werror -std=c++11 -pthread -fno-rtti -fvisibility-inlines-hidden -o CMakeFiles/HSAILasm.dir/HSAILAsm.cpp.o -c /home/Computador/hsail/HSAIL-Tools-master/HSAILAsm/HSAILAsm.cpp
我已经知道,我可以传递命令 -Wno-error=unused-variable 来禁用错误,可能主要用于开发人员和我的用户,但只需在 makefile 上使用 CXXFLAGS 传递它,它就将其包含在所有 make 命令中执行并可能到 GCC——顺便说一下,在 makefile 中,我将它包含在 build.make 上给出的错误之前的最后一个 make 命令之前(错误从那里前进到其他 makefile)——但是当它执行程序 c++ 时。 exe,您可以看到它没有出现我试图传递的 -Wno-error 。我应该如何将它成功传递给 c++.exe 程序。是c++.exe因为我在cygwin下