question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

g++: error: unrecognized command line option ‘-R’

See original GitHub issue

Hello, 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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
moskomulecommented, Oct 16, 2017

@hvy Thank you.

Finally, I found that the latest Python 3.6.3 (3.6.3-hc9025b9_1) can successfully install cupy without downgrading.

2reactions
kaniblucommented, Oct 12, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

g++: error: unrecognized command line option '-R' #706 - GitHub
After replacing '-R' with '-Wl,-rpath=', the g++ command can be successfully run. You just copy the above wrong command and replace '-R' with...
Read more >
g++-4.6.real: error: unrecognized option '-R' - Stack Overflow
I am trying to compile phpcompiler from source using this configure command. So, for this unrecognized option '-R' error, many -lboost_regex ...
Read more >
unrecognized command line option -fstack-protector-strong
Hello, Trying to upgrade bioconductor hit a problem with vsn. gcc: error: unrecognized command line option -fstack-protector-strong. It seems that "fstack- ...
Read more >
g++: error: unrecognized command line option '-std=gnu++17'
It works just fine if I use "g++ -std=gnu++11." The remote build machine on the ssh server supports gnu++17, I directly ran the...
Read more >
Error in installing R pakages - General - RStudio Community
Hey guys , I'm new to R. I tried to install ggplot2 packages and I faced like ... -o dotsElt.o cc1: error: unrecognized...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found