multimodallearning / pytorch-mask-rcnn

Other
2.01k stars 557 forks source link

cffi.VerificationError: CompileError: command 'gcc' failed with exit status 1 #97

Closed dailybudushu closed 4 years ago

dailybudushu commented 4 years ago

Including CUDA code. /data/fuhao/mask-rcnn/nms generating /tmp/tmp4ju5sz9z/_nms.c setting the current directory to '/tmp/tmp4ju5sz9z' running build_ext building '_nms' extension creating data creating data/fuhao creating data/fuhao/mask-rcnn creating data/fuhao/mask-rcnn/nms creating data/fuhao/mask-rcnn/nms/src gcc -pthread -B /home/fuhao/anaconda3/envs/pytorch_cuda8/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/fuhao/anaconda3/envs/pytorch_cuda8/include/python3.6m -c _nms.c -o ./_nms.o In file included from /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THVector.h:5:0, from /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/TH.h:12, from _nms.c:540: /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevl’: /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (size_t i = 0; i <= len; i++) { ^ /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevlf’: /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:142:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (size_t i = 0; i <= len; i++) { ^ /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigamma’: /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:260:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < 6; ++i) { ^ /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigammaf’: /home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:278:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < 6; ++i) { ^ Traceback (most recent call last): File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile extra_postargs) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/spawn.py", line 36, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix % (cmd, exit_status)) distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build dist.run_command('build_ext') File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension depends=ext.depends) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/ccompiler.py", line 574, in compile self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile raise CompileError(msg) distutils.errors.CompileError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "build.py", line 34, in ffi.build() File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 184, in build _build_extension(ffi, cffi_wrapper_name, target_dir, verbose) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 108, in _build_extension outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/cffi/api.py", line 727, in compile compiler_verbose=verbose, debug=debug, **kwds) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/cffi/recompiler.py", line 1536, in recompile compiler_verbose, debug) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile outputfilename = _build(tmpdir, ext, compiler_verbose, debug) File "/home/fuhao/anaconda3/envs/pytorch_cuda8/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build raise VerificationError('%s: %s' % (e.class.name, e)) cffi.VerificationError: CompileError: command 'gcc' failed with exit status 1

nvcc -V :Cuda compilation tools, release 8.0, V8.0.44

my conda environment: pytorch 0.4.0 py36_cuda8.0.61_cudnn7.1.2_1 python 3.6.10

how to solve it?