g++: error: unrecognized command line option ‘-R’
See original GitHub issueHello, while installing cupy using `pip install cupy --no-cache-dir ’ I encounter a problem.
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ g++ -pthread -shared -B /home/gin/anaconda2/compiler_compat -L/home/gin/anaconda2/lib -Wl,-rpath=/home/gin/anaconda2/lib,–no-as-needed -Wl,-rpath build/temp.linux-x86_64-2.7/cupy/core/core.o -L/usr/local/cuda-8.0/lib64 -L/home/gin/anaconda2/lib -R/usr/local/cuda-8.0/lib64 -lcublas -lcuda -lcudart -lcurand -lnvToolsExt -lpython2.7 -o build/lib.linux-x86_64-2.7/cupy/core/core.so g++: error: unrecognized command line option ‘-R’ error: command ‘g++’ failed with exit status 1
Actually, ‘-R’ should be replace with ‘-Wl,-rpath’ . After replacing ‘-R’ with ‘-Wl,-rpath’, the g++ command can be successfully run.
I don’t know how to change the comman using setuptool.
Here is the whole log.
Collecting cupy Using cached cupy-1.0.3.tar.gz Requirement already satisfied: nose in /home/gin/anaconda2/lib/python2.7/site-packages (from cupy) Requirement already satisfied: numpy>=1.9.0 in /home/gin/anaconda2/lib/python2.7/site-packages (from cupy) Requirement already satisfied: six>=1.9.0 in /home/gin/anaconda2/lib/python2.7/site-packages (from cupy) Building wheels for collected packages: cupy Running setup.py bdist_wheel for cupy … error Complete output from command /home/gin/anaconda2/bin/python -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-quN8AE/cupy/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” bdist_wheel -d /tmp/tmpEY2Cgapip-wheel- --python-tag cp27: Options: {‘profile’: False, ‘annotate’: False, ‘linetrace’: False, ‘no_cuda’: False} Include directories: [‘/usr/local/cuda-8.0/include’] Library directories: [‘/usr/local/cuda-8.0/lib64’] cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ Include directories: [‘/usr/local/cuda-8.0/include’] Library directories: [‘/usr/local/cuda-8.0/lib64’] cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
*** WARNING: Unsupported cuDNN version: 7003 *** WARNING: cuDNN v4<= and <=v6 is required
Include directories: [‘/usr/local/cuda-8.0/include’] Library directories: [‘/usr/local/cuda-8.0/lib64’] cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ Include directories: [‘/usr/local/cuda-8.0/include’] Library directories: [‘/usr/local/cuda-8.0/lib64’] cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ Include directories: [‘/usr/local/cuda-8.0/include’] Library directories: [‘/usr/local/cuda-8.0/lib64’] cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/cupy copying cupy/init.py -> build/lib.linux-x86_64-2.7/cupy copying cupy/cudnn.py -> build/lib.linux-x86_64-2.7/cupy copying cupy/internal.py -> build/lib.linux-x86_64-2.7/cupy creating build/lib.linux-x86_64-2.7/cupy/binary … running build_ext building ‘cupy.core.core’ extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/cupy creating build/temp.linux-x86_64-2.7/cupy/core gcc -pthread -B /home/gin/anaconda2/compiler_compat -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -D_FORCE_INLINES=1 -I/usr/local/cuda-8.0/include -I/home/gin/anaconda2/include/python2.7 -c cupy/core/core.cpp -o build/temp.linux-x86_64-2.7/cupy/core/core.o cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ g++ -pthread -shared -B /home/gin/anaconda2/compiler_compat -L/home/gin/anaconda2/lib -Wl,-rpath=/home/gin/anaconda2/lib,–no-as-needed -Wl,-rpath build/temp.linux-x86_64-2.7/cupy/core/core.o -L/usr/local/cuda-8.0/lib64 -L/home/gin/anaconda2/lib -R/usr/local/cuda-8.0/lib64 -lcublas -lcuda -lcudart -lcurand -lnvToolsExt -lpython2.7 -o build/lib.linux-x86_64-2.7/cupy/core/core.so g++: error: unrecognized command line option ‘-R’ error: command ‘g++’ failed with exit status 1
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:12 (6 by maintainers)
Top GitHub Comments
@hvy Thank you.
Finally, I found that the latest Python 3.6.3 (3.6.3-hc9025b9_1) can successfully install
cupy
without downgrading.After dozens of testing, I figured out that compatibility libraries provided by Anaconda 3 is the culprit. Unfortunately, anaconda-flavored libraries causing havocs has happened many times before, such as this and this. I tried to update gcc and other binaries but it didn’t work either. I suggest everyone to just use plain python installations or virtualenvs not based on conda to work around the problem.