princeton-vl / pose-ae-train

Training code for "Associative Embedding: End-to-End Learning for Joint Detection and Grouping"
BSD 3-Clause "New" or "Revised" License
373 stars 76 forks source link

[Compile Error] Cannot build #32

Closed liuyu666-thu closed 5 years ago

liuyu666-thu commented 5 years ago

When I try to compile the AE loss, I encounter the following problem:

Including CUDA code. generating /tmp/tmpwtp46zqq/_my_lib.c setting the current directory to '/tmp/tmpwtp46zqq' running build_ext building '_my_lib' extension creating home creating home/likewise-open creating home/likewise-open/SENSETIME creating home/likewise-open/SENSETIME/liuyu1 creating home/likewise-open/SENSETIME/liuyu1/WorkShop creating home/likewise-open/SENSETIME/liuyu1/WorkShop/pose-ae-train creating home/likewise-open/SENSETIME/liuyu1/WorkShop/pose-ae-train/extensions creating home/likewise-open/SENSETIME/liuyu1/WorkShop/pose-ae-train/extensions/AE creating home/likewise-open/SENSETIME/liuyu1/WorkShop/pose-ae-train/extensions/AE/src gcc -pthread -B /home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/include/python3.6m -c _my_lib.c -o ./_my_lib.o In file included from /home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THVector.h:5:0, from /home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/TH.h:12, from _my_lib.c:492: /home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevl’: /home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/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/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/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/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevlf’: /home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/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/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigamma’: /home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/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/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigammaf’: /home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/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/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile extra_postargs) File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/distutils/ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/distutils/spawn.py", line 36, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/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/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build dist.run_command('build_ext') File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension depends=ext.depends) File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/distutils/ccompiler.py", line 574, in compile self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/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/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/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/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/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/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/cffi/api.py", line 697, in compile compiler_verbose=verbose, debug=debug, **kwds) File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/cffi/recompiler.py", line 1520, in recompile compiler_verbose, debug) File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile outputfilename = _build(tmpdir, ext, compiler_verbose, debug) File "/home/likewise-open/SENSETIME/liuyu1/anaconda3/envs/pytorch0.4/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

Anyone knows how to fix this?

liuyu666-thu commented 5 years ago

never mind. Already solved.

pavanteja295 commented 5 years ago

Whats the pytorch version you are using ?

liuyu666-thu commented 5 years ago

@pavanteja295 0.4.0

hhaAndroid commented 5 years ago

@quinnliu4real I also encountered the same problem, how can you solve it?

liuyu666-thu commented 5 years ago

@hhaAndroid use this two commands: export CXXFLAGS="-std=c++11" export CFLAGS="-std=c99"