【问题标题】:Install RODBC Mac OS Sierra 10.12.3安装 RODBC Mac OS Sierra 10.12.3
【发布时间】:2017-02-07 19:11:50
【问题描述】:

在 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

【问题讨论】:

  • 我收到一个找不到 lomp 的错误,但我认为 clang 3.9.1 有 openmp 库。 "/usr/bin/ld" -demangle -lto_library /usr/local/Cellar/llvm/3.9.1/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.12.0 -o a.out /var/folders/ 7f/3n9kqyy13glcwlrx7h8cb5dc0000gn/T/conftest-c7544c.o -lomp -lSystem /usr/local/Cellar/llvm/3.9.1/bin/../lib/clang/3.9.1/lib/darwin/libclang_rt.osx.a ld: 找不到 -lomp 的库

标签: r macos rodbc


【解决方案1】:

我有同样的问题对我来说,问题是 R 安装程序依赖于 OS X(Sierra,10.12.4)附带的 clang 编译器,does not support openmp

我也无法使用任何通常的方法来为configure 指定一个不同的编译器来工作(例如示例here),因为事实证明,RODBC 的配置脚本是硬编码的,可以使用R 安装指定的编译器和 lib/include 路径,描述为here

我能够通过编辑~/.R/Makevars 指向我通过macport (sudo port install gcc6) 安装的gcc 版本来解决问题,如下所示:

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)按预期工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-06-02
    • 1970-01-01
    • 2017-08-30
    • 2017-06-19
    • 1970-01-01
    • 1970-01-01
    • 2017-02-23
    • 2017-05-02
    相关资源
    最近更新 更多