xiumingzhang / GenRe-ShapeHD

Code and Data Release for GenRe (NeurIPS 2018) and ShapeHD (ECCV 2018)
http://genre.csail.mit.edu/
290 stars 62 forks source link

cffi.VerificationError: LinkError: command 'gcc' failed with exit status 1 #41

Closed fxy2012 closed 4 years ago

fxy2012 commented 4 years ago

Thanks for your reply. I was faced with a new problem as follows. My version is :gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) with CUDA 9.0

Traceback (most recent call last):
  File "build.py", line 43, in <module>
    ffi.build()
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 189, in build
    _build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 111, in _build_extension
    outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/api.py", line 723, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/recompiler.py", line 1527, in recompile
    compiler_verbose, debug)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: LinkError: command 'gcc' failed with exit status 1
ztzhang commented 4 years ago

Can you share the info printed when you build the Cuda kernel? Please run clean.sh before rebuild.

I think the cuda kernel compilation failed before passing to cffi, so it would be more informative if you could share the cuda compilation info.

fxy2012 commented 4 years ago
(shaperecon) fxy@ubuntu:~/GenRe-ShapeHD$ ./build_toolbox.sh
Add -gencode to match all the GPU architectures you have.
Check 'https://en.wikipedia.org/wiki/CUDA#GPUs_supported' for list of architecture.
Check 'http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html' for GPU compilation based on architecture.
setup.sh: line 23: cd: cam_bp/src: No such file or directory
nvcc -c -o back_projection_kernel.cu.o back_projection_kernel.cu -x cu -Xcompiler -fPIC -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/TH -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/THC -I /home/fxy/GenRe-ShapeHD/toolbox/calc_prob -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include        -gencode arch=compute_30,code=sm_30         -gencode arch=compute_35,code=sm_35         -gencode arch=compute_52,code=sm_52         -gencode arch=compute_61,code=sm_61
gcc: error: back_projection_kernel.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
/home/fxy/GenRe-ShapeHD
python: can't open file 'build.py': [Errno 2] No such file or directory
Add -gencode to match all the GPU architectures you have.
Check 'https://en.wikipedia.org/wiki/CUDA#GPUs_supported' for list of architecture.
Check 'http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html' for GPU compilation based on architecture.
nvcc -c -o nnd_cuda.cu.o nnd_cuda.cu -x cu -Xcompiler -fPIC -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/TH -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/THC -I /home/fxy/GenRe-ShapeHD/toolbox/nndistance/src -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include        -gencode arch=compute_30,code=sm_30         -gencode arch=compute_35,code=sm_35         -gencode arch=compute_52,code=sm_52         -gencode arch=compute_61,code=sm_61
Including CUDA code.
/home/fxy/GenRe-ShapeHD/toolbox/nndistance
generating /tmp/tmp8rx6per1/_my_lib.c
setting the current directory to '/tmp/tmp8rx6per1'
running build_ext
building '_my_lib' extension
creating home
creating home/fxy
creating home/fxy/GenRe-ShapeHD
creating home/fxy/GenRe-ShapeHD/toolbox
creating home/fxy/GenRe-ShapeHD/toolbox/nndistance
creating home/fxy/GenRe-ShapeHD/toolbox/nndistance/src
gcc -pthread -B /home/fxy/anaconda3/envs/shaperecon/compiler_compat -Wl,--sysroot=/ -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/fxy/anaconda3/envs/shaperecon/include/python3.6m -c _my_lib.c -o ./_my_lib.o -std=c99
gcc -pthread -B /home/fxy/anaconda3/envs/shaperecon/compiler_compat -Wl,--sysroot=/ -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/fxy/anaconda3/envs/shaperecon/include/python3.6m -c /home/fxy/GenRe-ShapeHD/toolbox/nndistance/src/my_lib.c -o ./home/fxy/GenRe-ShapeHD/toolbox/nndistance/src/my_lib.o -std=c99
gcc -pthread -B /home/fxy/anaconda3/envs/shaperecon/compiler_compat -Wl,--sysroot=/ -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/fxy/anaconda3/envs/shaperecon/include/python3.6m -c /home/fxy/GenRe-ShapeHD/toolbox/nndistance/src/my_lib_cuda.c -o ./home/fxy/GenRe-ShapeHD/toolbox/nndistance/src/my_lib_cuda.o -std=c99
gcc -pthread -shared -B /home/fxy/anaconda3/envs/shaperecon/compiler_compat -L/home/fxy/anaconda3/envs/shaperecon/lib -Wl,-rpath=/home/fxy/anaconda3/envs/shaperecon/lib -Wl,--no-as-needed -Wl,--sysroot=/ -std=c99 ./_my_lib.o ./home/fxy/GenRe-ShapeHD/toolbox/nndistance/src/my_lib.o ./home/fxy/GenRe-ShapeHD/toolbox/nndistance/src/my_lib_cuda.o /home/fxy/GenRe-ShapeHD/toolbox/nndistance/src/nnd_cuda.cu.o -o ./_my_lib.so
Add -gencode to match all the GPU architectures you have.
Check 'https://en.wikipedia.org/wiki/CUDA#GPUs_supported' for list of architecture.
Check 'http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html' for GPU compilation based on architecture.
nvcc -c -o back_projection_kernel.cu.o back_projection_kernel.cu -x cu -Xcompiler -fPIC -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/TH -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/THC -I /home/fxy/GenRe-ShapeHD/toolbox/cam_bp/cam_bp/src -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include        -gencode arch=compute_30,code=sm_30         -gencode arch=compute_35,code=sm_35         -gencode arch=compute_52,code=sm_52         -gencode arch=compute_61,code=sm_61
In file included from /usr/include/c++/5/type_traits:35:0,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/ATen/optional.h:19,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/ATen/Error.h:4,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/ATen/Allocator.h:6,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/TH/THAllocator.h:6,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/THC/THCGeneral.h:5,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/THC/THC.h:4,
                 from back_projection_kernel.cu:1:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
/home/fxy/GenRe-ShapeHD/toolbox/cam_bp
/home/fxy/GenRe-ShapeHD/toolbox/cam_bp
generating /tmp/tmp72m4jfq6/_cam_bp_lib.c
setting the current directory to '/tmp/tmp72m4jfq6'
running build_ext
building '_cam_bp_lib' extension
creating home
creating home/fxy
creating home/fxy/GenRe-ShapeHD
creating home/fxy/GenRe-ShapeHD/toolbox
creating home/fxy/GenRe-ShapeHD/toolbox/cam_bp
creating home/fxy/GenRe-ShapeHD/toolbox/cam_bp/cam_bp
creating home/fxy/GenRe-ShapeHD/toolbox/cam_bp/cam_bp/src
gcc -pthread -B /home/fxy/anaconda3/envs/shaperecon/compiler_compat -Wl,--sysroot=/ -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA=True -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/fxy/GenRe-ShapeHD/toolbox/cam_bp/cam_bp/src -I/home/fxy/anaconda3/envs/shaperecon/include/python3.6m -c _cam_bp_lib.c -o ./_cam_bp_lib.o -std=c99
gcc -pthread -B /home/fxy/anaconda3/envs/shaperecon/compiler_compat -Wl,--sysroot=/ -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA=True -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/fxy/GenRe-ShapeHD/toolbox/cam_bp/cam_bp/src -I/home/fxy/anaconda3/envs/shaperecon/include/python3.6m -c /home/fxy/GenRe-ShapeHD/toolbox/cam_bp/cam_bp/src/back_projection.c -o ./home/fxy/GenRe-ShapeHD/toolbox/cam_bp/cam_bp/src/back_projection.o -std=c99
gcc -pthread -shared -B /home/fxy/anaconda3/envs/shaperecon/compiler_compat -L/home/fxy/anaconda3/envs/shaperecon/lib -Wl,-rpath=/home/fxy/anaconda3/envs/shaperecon/lib -Wl,--no-as-needed -Wl,--sysroot=/ -std=c99 ./_cam_bp_lib.o ./home/fxy/GenRe-ShapeHD/toolbox/cam_bp/cam_bp/src/back_projection.o /home/fxy/GenRe-ShapeHD/toolbox/cam_bp/cam_bp/src/back_projection_kernel.cu.o -o ./_cam_bp_lib.so
gcc: error: /home/fxy/GenRe-ShapeHD/toolbox/cam_bp/cam_bp/src/back_projection_kernel.cu.o: No such file or directory
Traceback (most recent call last):
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/unixccompiler.py", line 197, in link
    self.spawn(linker + ld_args)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/spawn.py", line 36, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/home/fxy/anaconda3/envs/shaperecon/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/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
    dist.run_command('build_ext')
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/command/build_ext.py", line 558, in build_extension
    target_lang=language)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/ccompiler.py", line 717, in link_shared_object
    extra_preargs, extra_postargs, build_temp, target_lang)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/unixccompiler.py", line 199, in link
    raise LinkError(msg)
distutils.errors.LinkError: 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 43, in <module>
    ffi.build()
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 189, in build
    _build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 111, in _build_extension
    outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/api.py", line 723, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/recompiler.py", line 1527, in recompile
    compiler_verbose, debug)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: LinkError: command 'gcc' failed with exit status 1
ztzhang commented 4 years ago

Hi, can you verify the directory you are in when running the setup script? It seems that
setup.sh: line 23: cd: cam_bp/src: No such file or directory is not finding the right directory. Also, it seems that you need to manually set -std=c++11 in the nvcc command since you are using gcc 5.4. Please let me know if the problem still exists after varifying those.

fxy2012 commented 4 years ago

@ztzhang Thank you for your advice. I set export CFLAGS="-std=c++11" in build_toolbox.sh, but it didn't work. And I tried to add this command to .bashrc, error still occurred. I am not familiar to c++ command, so could you please tell me how to solve this in detail?

fxy2012 commented 4 years ago
(shaperecon) fxy@ubuntu:~/GenRe-ShapeHD$ ./build_toolbox.sh
Add -gencode to match all the GPU architectures you have.
Check 'https://en.wikipedia.org/wiki/CUDA#GPUs_supported' for list of architecture.
Check 'http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html' for GPU compilation based on architecture.
nvcc -c -o calc_prob_kernel.cu.o calc_prob_kernel.cu -x cu -Xcompiler -fPIC -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/TH -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/THC -I /home/fxy/GenRe-ShapeHD/toolbox/calc_prob/calc_prob/src         -gencode arch=compute_30,code=sm_30         -gencode arch=compute_35,code=sm_35         -gencode arch=compute_52,code=sm_52         -gencode arch=compute_61,code=sm_61
In file included from /usr/include/c++/5/type_traits:35:0,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/ATen/optional.h:19,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/ATen/Error.h:4,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/ATen/Allocator.h:6,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/TH/THAllocator.h:6,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/THC/THCGeneral.h:5,
                 from /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/THC/THC.h:4,
                 from calc_prob_kernel.cu:1:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
/home/fxy/GenRe-ShapeHD/toolbox/calc_prob
generating /tmp/tmpruwsf34t/_calc_prob_lib.c
setting the current directory to '/tmp/tmpruwsf34t'
running build_ext
building '_calc_prob_lib' extension
creating home
creating home/fxy
creating home/fxy/GenRe-ShapeHD
creating home/fxy/GenRe-ShapeHD/toolbox
creating home/fxy/GenRe-ShapeHD/toolbox/calc_prob
creating home/fxy/GenRe-ShapeHD/toolbox/calc_prob/calc_prob
creating home/fxy/GenRe-ShapeHD/toolbox/calc_prob/calc_prob/src
gcc -pthread -B /home/fxy/anaconda3/envs/shaperecon/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA=True -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/fxy/GenRe-ShapeHD/toolbox/calc_prob/calc_prob/src -I/home/fxy/anaconda3/envs/shaperecon/include/python3.6m -c _calc_prob_lib.c -o ./_calc_prob_lib.o -std=c99
gcc -pthread -B /home/fxy/anaconda3/envs/shaperecon/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA=True -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/fxy/GenRe-ShapeHD/toolbox/calc_prob/calc_prob/src -I/home/fxy/anaconda3/envs/shaperecon/include/python3.6m -c /home/fxy/GenRe-ShapeHD/toolbox/calc_prob/calc_prob/src/calc_prob.c -o ./home/fxy/GenRe-ShapeHD/toolbox/calc_prob/calc_prob/src/calc_prob.o -std=c99
gcc -pthread -shared -B /home/fxy/anaconda3/envs/shaperecon/compiler_compat -L/home/fxy/anaconda3/envs/shaperecon/lib -Wl,-rpath=/home/fxy/anaconda3/envs/shaperecon/lib -Wl,--no-as-needed -Wl,--sysroot=/ ./_calc_prob_lib.o ./home/fxy/GenRe-ShapeHD/toolbox/calc_prob/calc_prob/src/calc_prob.o /home/fxy/GenRe-ShapeHD/toolbox/calc_prob/calc_prob/src/calc_prob_kernel.cu.o -o ./_calc_prob_lib.so
gcc: error: /home/fxy/GenRe-ShapeHD/toolbox/calc_prob/calc_prob/src/calc_prob_kernel.cu.o: No such file or directory
Traceback (most recent call last):
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/unixccompiler.py", line 197, in link
    self.spawn(linker + ld_args)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/spawn.py", line 36, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/home/fxy/anaconda3/envs/shaperecon/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/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
    dist.run_command('build_ext')
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/command/build_ext.py", line 558, in build_extension
    target_lang=language)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/ccompiler.py", line 717, in link_shared_object
    extra_preargs, extra_postargs, build_temp, target_lang)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/distutils/unixccompiler.py", line 199, in link
    raise LinkError(msg)
distutils.errors.LinkError: 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 42, in <module>
    ext.build()
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 189, in build
    _build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 111, in _build_extension
    outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/api.py", line 723, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/recompiler.py", line 1527, in recompile
    compiler_verbose, debug)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: LinkError: command 'gcc' failed with exit status 1
Add -gencode to match all the GPU architectures you have.
Check 'https://en.wikipedia.org/wiki/CUDA#GPUs_supported' for list of architecture.
Check 'http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html' for GPU compilation based on architecture.
setup.sh: line 25: cd: calc_prob/src: No such file or directory
nvcc -c -o calc_prob_kernel.cu.o calc_prob_kernel.cu -x cu -Xcompiler -fPIC -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/TH -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/THC -I /home/fxy/GenRe-ShapeHD/toolbox/nndistance         -gencode arch=compute_30,code=sm_30         -gencode arch=compute_35,code=sm_35         -gencode arch=compute_52,code=sm_52         -gencode arch=compute_61,code=sm_61
gcc: error: calc_prob_kernel.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
python: can't open file 'build.py': [Errno 2] No such file or directory
Add -gencode to match all the GPU architectures you have.
Check 'https://en.wikipedia.org/wiki/CUDA#GPUs_supported' for list of architecture.
Check 'http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html' for GPU compilation based on architecture.
setup.sh: line 25: cd: calc_prob/src: No such file or directory
nvcc -c -o calc_prob_kernel.cu.o calc_prob_kernel.cu -x cu -Xcompiler -fPIC -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/TH -I /home/fxy/anaconda3/envs/shaperecon/lib/python3.6/site-packages/torch/lib/include/THC -I /home/fxy/GenRe-ShapeHD/toolbox/cam_bp         -gencode arch=compute_30,code=sm_30         -gencode arch=compute_35,code=sm_35         -gencode arch=compute_52,code=sm_52         -gencode arch=compute_61,code=sm_61
gcc: error: calc_prob_kernel.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
python: can't open file 'build.py': [Errno 2] No such file or directory
fxy2012 commented 4 years ago

@ztzhang Thank you very much! I have solved this problem.

jordgey commented 4 years ago

@ztzhang Thank you very much! I have solved this problem. Excuse me sir,how did you solve this problem, I am in the same circumstance with you.