longcw / yolo2-pytorch

YOLOv2 in PyTorch
1.55k stars 420 forks source link

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

Open happyjin opened 6 years ago

happyjin commented 6 years ago

Hi all: When I try to execute: ./make.sh Then there is an error: Traceback (most recent call last): File "build.py", line 34, in ffi.build() File "/Users/lijin/miniconda3/envs/myenv/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 167, in build _build_extension(ffi, cffi_wrapper_name, target_dir, verbose) File "/Users/lijin/miniconda3/envs/myenv/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 103, in _build_extension ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname) File "/Users/lijin/miniconda3/envs/myenv/lib/python3.6/site-packages/cffi/api.py", line 690, in compile compiler_verbose=verbose, debug=debug, **kwds) File "/Users/lijin/miniconda3/envs/myenv/lib/python3.6/site-packages/cffi/recompiler.py", line 1515, in recompile compiler_verbose, debug) File "/Users/lijin/miniconda3/envs/myenv/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile outputfilename = _build(tmpdir, ext, compiler_verbose, debug) File "/Users/lijin/miniconda3/envs/myenv/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build raise VerificationError('%s: %s' % (e.class.name, e)) cffi.error.VerificationError: LinkError: command 'gcc' failed with exit status 1

Could anyone tell me what is wrong with this? And could you also please tell me how to deal with this error? Thanks in advance!

lxy598951 commented 6 years ago

I met the same problem, and I don't know how to fix it!

elebebit commented 6 years ago

I met the problem in other project. cffi.error.VerificationError: LinkError: command 'clang' failed with exit status 1

happyjin commented 6 years ago

Do you guys has idea how to fix the error?

liketheflower commented 6 years ago

same problem. no solution yet

wahrheit-git commented 6 years ago

any solutions? i am facing same trouble

liketheflower commented 6 years ago

I was using the faster rcnn pytorch and got the same problem. The suggested solution is: install anaconda instead of miniconda. I haven't tried yet as my server got some problem. Will let you know if it works.

https://github.com/jwyang/faster-rcnn.pytorch/issues/102

songdejia commented 6 years ago

conda install gcc ~ may help you

wtliao commented 6 years ago

I have also encountered the same issue. After trying tons of the possible solutions, I fixed it this simple way: create a symbolic link to the cuda directory that you want to use (below is my example) sudo ln -s /usr/local/cuda-8.0-cudnn-7 /usr/local/cuda I guess it a bug in pytorch. It seems that pytorch only recognize the cuda path as /usr/local/cuda. Even through I obvisously define the cuda path in .bashrc file or the make.sh as /usr/local/cuda-8.0-cudnn-7, it does not work. It may help you.

CF2220160244 commented 6 years ago

your pytorch version is high,just downgrade your torch0.4.1 to 0.4.0

DNXie commented 6 years ago

@songdejia After tried your method, the problem solved. However, it seems that I cannot import torch anymore.
Here is the error:
libgomp.so.1: version 'GOMP_4.0' not found

hixiaye commented 5 years ago

try to modify the make.sh, and add the following codes at the starting. (the website: https://blog.csdn.net/shang_jia/article/details/82929983 ) export CUDA_PATH=/usr/local/cuda/ 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}}