Faster-rcnn.pytorch: gcc failing

Created on 17 Jul 2018  路  2Comments  路  Source: jwyang/faster-rcnn.pytorch

Hi,

Thanks for your code. When I am trying to compile make.sh based on your instruction on centos-7 with titan-x gpu and cuda-8.0 I am getting the following error. Could you please help me setting this up properly. Many thanks.

running build_ext
skipping 'model/utils/bbox.c' Cython extension (up-to-date)
skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
Compiling nms kernels by nvcc...
/home/kalyanb/Desktop/faster-rcnn/lib/model/nms
Including CUDA code.
['/home/kalyanb/Desktop/faster-rcnn/lib/model/nms/src/nms_cuda_kernel.lib', '/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/ATen.lib', '/usr/local/cuda-8.0/lib/x64/cudart.lib', '/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/_C.lib']
generating /tmp/tmp8otu47o2/_nms.c
setting the current directory to '/tmp/tmp8otu47o2'
running build_ext
building '_nms' extension
creating home
creating home/kalyanb
creating home/kalyanb/Desktop
creating home/kalyanb/Desktop/faster-rcnn
creating home/kalyanb/Desktop/faster-rcnn/lib
creating home/kalyanb/Desktop/faster-rcnn/lib/model
creating home/kalyanb/Desktop/faster-rcnn/lib/model/nms
creating home/kalyanb/Desktop/faster-rcnn/lib/model/nms/src
gcc -pthread -B /home/kalyanb/anaconda3/envs/pytorch/compiler_compat -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda-8.0/include -I/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/include -I/home/kalyanb/anaconda3/envs/pytorch/include/python3.5m -c _nms.c -o ./_nms.o
In file included from /home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THVector.h:5:0,
from /home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/TH.h:12,
from _nms.c:492:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_polevlu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: note: use option -std=c99 or -std=gnu99 to compile your code
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_polevlfu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:142:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_trigammau2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:260:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_trigammafu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:278:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
Traceback (most recent call last):
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/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/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/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 49, in
ffi.build()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/__init__.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/__init__.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/api.py", line 697, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/recompiler.py", line 1520, in recompile
compiler_verbose, debug)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.error.VerificationError: CompileError: command 'gcc' failed with exit status 1
Compiling roi pooling kernels by nvcc...
/home/kalyanb/Desktop/faster-rcnn/lib/model/roi_pooling
Including CUDA code.
['/home/kalyanb/Desktop/faster-rcnn/lib/model/roi_pooling/src/roi_pooling.lib', '/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/ATen.lib', '/usr/local/cuda-8.0/lib/x64/cudart.lib', '/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/_C.lib']
generating /tmp/tmpfqbf6tlj/_roi_pooling.c
setting the current directory to '/tmp/tmpfqbf6tlj'
running build_ext
building '_roi_pooling' extension
creating home
creating home/kalyanb
creating home/kalyanb/Desktop
creating home/kalyanb/Desktop/faster-rcnn
creating home/kalyanb/Desktop/faster-rcnn/lib
creating home/kalyanb/Desktop/faster-rcnn/lib/model
creating home/kalyanb/Desktop/faster-rcnn/lib/model/roi_pooling
creating home/kalyanb/Desktop/faster-rcnn/lib/model/roi_pooling/src
gcc -pthread -B /home/kalyanb/anaconda3/envs/pytorch/compiler_compat -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda-8.0/include -I/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/include -I/home/kalyanb/anaconda3/envs/pytorch/include/python3.5m -c _roi_pooling.c -o ./_roi_pooling.o
In file included from /home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THVector.h:5:0,
from /home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/TH.h:12,
from _roi_pooling.c:492:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_polevlu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: note: use option -std=c99 or -std=gnu99 to compile your code
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_polevlfu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:142:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_trigammau2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:260:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_trigammafu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:278:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
Traceback (most recent call last):
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/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/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/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 49, in
ffi.build()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/__init__.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/__init__.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/api.py", line 697, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/recompiler.py", line 1520, in recompile
compiler_verbose, debug)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.error.VerificationError: CompileError: command 'gcc' failed with exit status 1
Compiling roi align kernels by nvcc...
/home/kalyanb/Desktop/faster-rcnn/lib/model/roi_align
Including CUDA code.
['/home/kalyanb/Desktop/faster-rcnn/lib/model/roi_align/src/roi_align_kernel.lib', '/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/ATen.lib', '/usr/local/cuda-8.0/lib/x64/cudart.lib', '/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/_C.lib']
generating /tmp/tmp9zecd3ms/_roi_align.c
setting the current directory to '/tmp/tmp9zecd3ms'
running build_ext
building '_roi_align' extension
creating home
creating home/kalyanb
creating home/kalyanb/Desktop
creating home/kalyanb/Desktop/faster-rcnn
creating home/kalyanb/Desktop/faster-rcnn/lib
creating home/kalyanb/Desktop/faster-rcnn/lib/model
creating home/kalyanb/Desktop/faster-rcnn/lib/model/roi_align
creating home/kalyanb/Desktop/faster-rcnn/lib/model/roi_align/src
gcc -pthread -B /home/kalyanb/anaconda3/envs/pytorch/compiler_compat -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda-8.0/include -I/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/include -I/home/kalyanb/anaconda3/envs/pytorch/include/python3.5m -c _roi_align.c -o ./_roi_align.o
In file included from /home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THVector.h:5:0,
from /home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/TH.h:12,
from _roi_align.c:492:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_polevlu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: note: use option -std=c99 or -std=gnu99 to compile your code
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_polevlfu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:142:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_trigammau2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:260:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_trigammafu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:278:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
Traceback (most recent call last):
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/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/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/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 48, in
ffi.build()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/__init__.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/__init__.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/api.py", line 697, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/recompiler.py", line 1520, in recompile
compiler_verbose, debug)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.error.VerificationError: CompileError: command 'gcc' failed with exit status 1
Compiling roi crop kernels by nvcc...
/home/kalyanb/Desktop/faster-rcnn/lib/model/roi_crop
Including CUDA code.
['/home/kalyanb/Desktop/faster-rcnn/lib/model/roi_crop/src/roi_crop_cuda_kernel.lib', '/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/ATen.lib', '/usr/local/cuda-8.0/lib/x64/cudart.lib', '/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/_C.lib']
generating /tmp/tmp4uv8u0la/_roi_crop.c
setting the current directory to '/tmp/tmp4uv8u0la'
running build_ext
building '_roi_crop' extension
creating home
creating home/kalyanb
creating home/kalyanb/Desktop
creating home/kalyanb/Desktop/faster-rcnn
creating home/kalyanb/Desktop/faster-rcnn/lib
creating home/kalyanb/Desktop/faster-rcnn/lib/model
creating home/kalyanb/Desktop/faster-rcnn/lib/model/roi_crop
creating home/kalyanb/Desktop/faster-rcnn/lib/model/roi_crop/src
gcc -pthread -B /home/kalyanb/anaconda3/envs/pytorch/compiler_compat -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda-8.0/include -I/home/kalyanb/anaconda3/envs/pytorch/bin/Lib/site-packages/torch/lib/include -I/home/kalyanb/anaconda3/envs/pytorch/include/python3.5m -c _roi_crop.c -o ./_roi_crop.o
In file included from /home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THVector.h:5:0,
from /home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/TH.h:12,
from _roi_crop.c:492:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_polevlu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: note: use option -std=c99 or -std=gnu99 to compile your code
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_polevlfu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:142:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_trigammau2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:260:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function u2018TH_trigammafu2019:
/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:278:3: error: u2018foru2019 loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
Traceback (most recent call last):
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/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/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/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 49, in
ffi.build()
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/__init__.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/utils/ffi/__init__.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/api.py", line 697, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/recompiler.py", line 1520, in recompile
compiler_verbose, debug)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/kalyanb/anaconda3/envs/pytorch/lib/python3.5/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.error.VerificationError: CompileError: command 'gcc' failed with exit status 1

Most helpful comment

Solved it by adding these lines to make.sh

export CXXFLAGS="-std=c++11"
export CFLAGS="-std=c99"
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export CPATH=/usr/local/cuda-8.0/include${CPATH:+:${CPATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

All 2 comments

Solved it by adding these lines to make.sh

export CXXFLAGS="-std=c++11"
export CFLAGS="-std=c99"
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export CPATH=/usr/local/cuda-8.0/include${CPATH:+:${CPATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

thk

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gullalc picture gullalc  路  4Comments

EmmaSRH picture EmmaSRH  路  4Comments

GPaolo picture GPaolo  路  5Comments

Wanggcong picture Wanggcong  路  5Comments

kebijuelun picture kebijuelun  路  5Comments