1. 程式人生 > >sh make.sh出錯 顯示cffi.error.VerificationError: CompileError: command 'gcc' failed with exit status 1

sh make.sh出錯 顯示cffi.error.VerificationError: CompileError: command 'gcc' failed with exit status 1

編譯的時候顯示錯誤:/lib/include/TH/THMath.h:260:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (int i = 0; i < 6; ++i) {
   ^

在編譯檔案make.sh最上面加以下兩行:
export CXXFLAGS="-std=c++11"
export CFLAGS="-std=c99"
順便查查自己的cuda_arch是不是自己顯示卡對應的,如1080ti 對應 CUDA_ARCH="-gencode arch=compute_61,code=sm_61 "