multimodallearning / pytorch-mask-rcnn

Other
2.01k stars 557 forks source link

issue with getting distutils.errors.CompileError: command 'gcc' failed with exit status 1 even after changing to Pytorch 0.4.0 #65

Open prantikbubun opened 5 years ago

prantikbubun commented 5 years ago

Hi I get the error when doing python build.py gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -m64 -fPIC -m64 -fPIC -fPIC -DWITH_CUDA -I/home/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/ironman/anaconda3/envs/project1/include/python3.6m -c _nms.c -o ./_nms.o In file included from /home/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THVector.h:5:0, from /home/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/TH.h:12, from _nms.c:492: /home/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevl’: /home/ironman/anaconda3/envs/project1/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 mode for (size_t i = 0; i <= len; i++) { ^ /home/ironman/anaconda3/envs/project1/lib/python3.6/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/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevlf’: /home/ironman/anaconda3/envs/project1/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 mode for (size_t i = 0; i <= len; i++) { ^ /home/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigamma’: /home/ironman/anaconda3/envs/project1/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 mode for (int i = 0; i < 6; ++i) { ^ /home/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigammaf’: /home/ironman/anaconda3/envs/project1/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 mode for (int i = 0; i < 6; ++i) { ^ Traceback (most recent call last): File "/home/ironman/anaconda3/envs/project1/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile extra_postargs) File "/home/ironman/anaconda3/envs/project1/lib/python3.6/distutils/ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "/home/ironman/anaconda3/envs/project1/lib/python3.6/distutils/spawn.py", line 36, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "/home/ironman/anaconda3/envs/project1/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/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build dist.run_command('build_ext') File "/home/ironman/anaconda3/envs/project1/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/ironman/anaconda3/envs/project1/lib/python3.6/distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/home/ironman/anaconda3/envs/project1/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "/home/ironman/anaconda3/envs/project1/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "/home/ironman/anaconda3/envs/project1/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension depends=ext.depends) File "/home/ironman/anaconda3/envs/project1/lib/python3.6/distutils/ccompiler.py", line 574, in compile self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) File "/home/ironman/anaconda3/envs/project1/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/ironman/anaconda3/envs/project1/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/ironman/anaconda3/envs/project1/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/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/cffi/api.py", line 697, in compile compiler_verbose=verbose, debug=debug, **kwds) File "/home/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/cffi/recompiler.py", line 1520, in recompile compiler_verbose, debug) File "/home/ironman/anaconda3/envs/project1/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile outputfilename = _build(tmpdir, ext, compiler_verbose, debug) File "/home/ironman/anaconda3/envs/project1/lib/python3.6/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

Harathi123 commented 5 years ago

Hi @prantikbubun , are you able to resolve this issue?

Thanks, Harathi

prantikbubun commented 5 years ago

Nope not yet

On Thu, Dec 20, 2018, 4:08 PM Harathi <notifications@github.com wrote:

Hi @prantikbubun https://github.com/prantikbubun , are you able to resolve this issue?

Thanks, Harathi

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/multimodallearning/pytorch-mask-rcnn/issues/65#issuecomment-449135829, or mute the thread https://github.com/notifications/unsubscribe-auth/AVqC8RpPCHzN2evmTqBsEE7GUp7D9e3Cks5u6_xFgaJpZM4Y8q1j .

Harathi123 commented 5 years ago

Ok, thanks!

Y132om commented 4 years ago

Nope not yet On Thu, Dec 20, 2018, 4:08 PM Harathi @.*** wrote: Hi @prantikbubun https://github.com/prantikbubun , are you able to resolve this issue? Thanks, Harathi — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#65 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AVqC8RpPCHzN2evmTqBsEE7GUp7D9e3Cks5u6_xFgaJpZM4Y8q1j .

I also encountered the same problem, how to solve it??

dailybudushu commented 4 years ago

I also encountered the same problem.

ElvishElvis commented 4 years ago

Same problem here

donaldr commented 4 years ago

Same problem

YanglanWang commented 3 years ago

edit geometric/maskrcnn/nms/build.py like geometric/maskrcnn/roialign/roi_align/build.py

declare extra_compile_args = [ '-std=c99'], and add "extra_compile_args=extra_compile_args" as one parameter in ffi=create_extension(...