Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xiamenwcy opened this issue Oct 17, 2017 · 10 comments
Open

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

xiamenwcy opened this issue Oct 17, 2017 · 10 comments

Comments

@xiamenwcy
Copy link

hi,when I‘m ’building the Cython modules,

cd $FRCN_ROOT/lib
make

there is always a error occured.

My gcc is 4.8.2,But I guess it does not matter with gcc version! who can help me ?

@xiamenwcy
Copy link
Author

xiamenwcy commented Oct 17, 2017

Actually, '-R' should be replace with '-Wl,-rpath=' . After replacing '-R' with '-Wl,-rpath=', the g++ command can be successfully run. You just copy the above wrong command and replace '-R' with '-Wl,-rpath=' or '-Wl,-R' (this is also ok) and run again.

@zgq91
Copy link

zgq91 commented Oct 20, 2017

@xiamenwcy I have the same mistake, In that file will -R changed to -Wl,-rpath=

@SophieZhou
Copy link

SophieZhou commented Oct 23, 2017

Hi,
@xiamenwcy
@zgq91
In which file should I changed? I have met the same problem. Thanks very much.

@SophieZhou
Copy link

After reading the docs of Cython and setup file in lib. I have solved the problem yet. You should modified the files in numpy/distutils which is named by unixcompiler.py. In this file changed '-R' to '-Wl,-rpath='

@UUZYWEI
Copy link

UUZYWEI commented Oct 24, 2017

@SophieZhou thank you~~I have solved it.

@zhoupan9109
Copy link

@SophieZhou I can find the file numpy/distutils/unixcompiler.py, but i can't find '-R'. Can you show me the code or where is the '-R'? Thank you very much!

@UUZYWEI
Copy link

UUZYWEI commented Oct 26, 2017

@zhoupan9109 in my computer:
if self._is_gcc(compiler):
# gcc on non-GNU systems does not need -Wl, but can
# use it anyway. Since distutils has always passed in
# -Wl whenever gcc was used in the past it is probably
# safest to keep doing so.
if sysconfig.get_config_var("GNULD") == "yes":
# GNU ld needs an extra option to get a RUNPATH
# instead of just an RPATH.
return "-Wl,--enable-new-dtags,-R" + dir
else:
return "-Wl,-rpath" + dir
else:
# No idea how --enable-new-dtags would be passed on to
# ld if this system was using GNU ld. Don't know if a
# system like this even exists.
-R return "-Wl,-rpath=" + dir

here is the -R,line in 255

@zhoupan9109
Copy link

@UUZYWEI Can you give me the absolute path of the file unixcompiler.py?

@UUZYWEI
Copy link

UUZYWEI commented Oct 26, 2017

@zhoupan9109 ...../anaconda3/lib/python3.6/distutils/unixcompiler.py, in your now python path/distutils/unixcompiler.py

@zhoupan9109
Copy link

@UUZYWEI Thank you very much! I have solved it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants