xgboost: While installing on OSX Sierra via gcc-6, keep having "FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!" error
Environment info
Operating System: macOS 10.12.2 (16C68)
Compiler: gcc-6
Steps to reproduce
I’ve installed gcc-6 and modified config.mk as required into
export CC = gcc-6
export CXX = g++-6
But keep having this error:
g++-6 -c -std=c++0x -Wall -Wno-unknown-pragmas -Iinclude -Idmlc-core/include -Irabit/include -O3 -funroll-loops -msse2 -fPIC -fopenmp src/learner.cc -o build/learner.o
FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!
What have you tried?
- Reinstall
XCode - Reinstall
gcc - Run
make clean_all && make -4j
But still went wrong. Any idea?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16
@Marswang92 @jialinzou @mcneale What about the version of
as? You can check it byas -v. Maybe your terminal display something likeGNU Assembler.And I think the correct
asis like:The reason is the system use a different path of
as(be overrided). Please attention the error log you met/opt/local/bin/../libexec/as/x86_64/as, the correctasshould be/usr/bin/as. You can check it bycd /usr/bin ; ./as -v.My solution is
export PATH=/usr/bin:$PATH. I helped my friend resolve the problem. And I think that can help you.I found that MacPorts was putting /opt/local/bin ahead of /usr/bin in the $PATH chain via these lines in .profile:
[hash] MacPorts Installer addition on 2018-03-01_at_16:21:35: adding an appropriate PATH variable for use with MacPorts. export PATH=“/opt/local/bin:/opt/local/sbin:$PATH” [hash] Finished adapting your PATH environment variable for use with MacPorts.
So “as” was being found in /opt/local/bin/…/libexec/as/x86_64/as before the preferred (working) version in /usr/bin
Took these lines out of .profile and restarted terminal. My test file hello world.f is now compiling
Late coming to the party… but…
The following worked for me. This solution is independent of system path gyrations.
$ cd /opt/local/bin $ sudo mv ./as ./as-broken $ sudo ln -s /usr/bin/as ./as
Here’s a test that shows that it works:
$ mkdir ~/gcctest $ cd ~/gcctest $ echo ‘int main(){return -1;}’ > conftest.c $ /opt/local/bin/gcc -o conftest conftest.c FATAL:/opt/local/bin/…/libexec/as/x86_64/as: I don’t understand ‘m’ flag! $ cd /opt/local/bin $ sudo mv ./as ./as-broken $ sudo ln -s /usr/bin/as ./as $ cd - $ /opt/local/bin/gcc -o conftest conftest.c $ ./conftest; echo $? 255
Hooray! solution seems to be to remove /opt/local/bin from one’s path. @fcbruce thank you!
How you do this depends on your shell, @fcbruce assumes sh or bash I think. Under tcsh setenv PATH /usr/local/bin for example, might do the trick.