Mac OS X R error “ld: warning: directory not found for option”

前端 未结 7 1501
梦毁少年i
梦毁少年i 2020-12-01 04:38

I am trying to install an R package from source, but getting an error:

* installing *source* package ‘mclust’ ...
** package ‘mclust’ successfully unpacked a         


        
7条回答
  •  囚心锁ツ
    2020-12-01 05:14

    Incorporating previous solutions with additional help from the comments, the following solution has worked for me on Mac OS X High Sierra.

    Create/edit ~/.R/Makevars with the following contents:

    VER=-8
    CC=gcc$(VER)
    CXX=g++$(VER)
    CXX11=g++$(VER)
    CXX14=g++$(VER)
    CXX17=g++$(VER)
    CFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
    CXXFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
    FLIBS=-L/usr/local/Cellar/gcc/8.2.0/lib/gcc/8
    

    Note, I am using homebrew and have gcc version 8.2.0 installed.

提交回复
热议问题