10.12.1全新安装,升级到10.12.3。
我做了brew install unixodbc
。
然后我尝试了R CMD INSTALL RODBC_1.3-14.tar.gz
有错误:
checking for gcc... /usr/local/opt/llvm/bin/clang -fopenmp
checking whether the C compiler works... no
configure: error: in `/private/var/folders/7f/3n9kqyy13glcwlrx7h8cb5dc0000gn/T/RtmpYQnA2y/R.INSTALL354a771740af/RODBC':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘RODBC’
然后我解压缩RODBC并尝试./configure
并在日志中收到以下错误消息:
configure:2690: /usr/local/opt/llvm/bin/clang -fopenmp -v >&5
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
configure:2701: $? = 0
configure:2690: /usr/local/opt/llvm/bin/clang -fopenmp -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:2701: $? = 1
configure:2690: /usr/local/opt/llvm/bin/clang -fopenmp -qversion >&5
clang: error: unknown argument: '-qversion'
clang: error: no input files
configure:2701: $? = 1
configure:2721: checking whether the C compiler works
configure:2743: /usr/local/opt/llvm/bin/clang -fopenmp -Wall -mtune=core2 -g -O2 -I/usr/local/opt/llvm/include -I. conftest.c >&5
ld: library not found for -lomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:2747: $? = 1
configure:2785: result: no
答案 0 :(得分:1)
我遇到了同样的问题对我来说,问题是R安装程序依赖于OS X附带的clang编译器(Sierra,10.12.4),does not support openmp。
我也无法获得指定configure
工作的不同编译器的常用方法(例如示例here),因为事实证明,RODBC的配置脚本很难 - 编码为使用R安装指定的编译器和lib / include路径,这些路径描述为here。
我能够通过编辑~/.R/Makevars
来指向我通过macports(gcc
)安装的sudo port install gcc6
版本来解决问题,原因如下:
CC=/opt/local/bin/gcc-mp-6 -fopenmp
CXX=/opt/local/bin/g++-mp-6
LDFLAGS=-L/opt/local/lib -L/usr/local/opt/llvm/lib
CPPFLAGS=-I/opt/local/include -I/usr/local/opt/llvm/include
然后正常安装过程(R CMD INSTALL ./RODBC_1.3-15.tar.gz
)按预期工作。