自 Xcode 命令行工具更新后无法安装 stringi
Cannot install stringi since Xcode Command Line Tools update
- 系统:macOS Sierra 10.12.6
- Xcode: 9.2 (2347)
- R: 3.4.0
- RStudio: 1.1.383
我正在尝试安装最新版本的 stringi (1.1.6)。这是不可能的,因为 Xcode 最近更新了。收到的错误是 configure: error: C compiler cannot create executables
,这里有完整的输出:
Installing package into ‘/usr/local/lib/R/3.4/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/stringi_1.1.6.tar.gz'
Content type 'application/x-gzip' length 3647049 bytes (3.5 MB)
==================================================
downloaded 3.5 MB
* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
checking for local ICUDT_DIR... icu55/data
checking for R_HOME... /usr/local/Cellar/r/3.4.0_1/R.framework/Resources
checking for R... /usr/local/Cellar/r/3.4.0_1/R.framework/Resources/bin/R
checking for R >= 3.1.0 for C++11 use... yes
checking for R < 3.4.0 for CXX1X flag use... no
checking for cat... /bin/cat
checking for gcc... /usr/local/opt/llvm/bin/clang -fopenmp
checking whether the C compiler works... no
configure: error: in `/private/var/folders/wd/vzwq4t9d54jb_w8m3twn7mzh0000gp/T/Rtmpu6QgYM/R.INSTALL1566d417bcdad/stringi':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/usr/local/lib/R/3.4/site-library/stringi’
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status
经过搜索,我在 RStudio 中尝试过:
> install.packages("stringi", type = "mac.binary")
package ‘stringi’ is available as a source package but not as a binary
> install.packages("stringi", type = "mac.binary.mavericks")
package ‘stringi’ is available as a source package but not as a binary
> install.packages("stringi", repos="http://cran.rstudio.com/", dependencies = TRUE)
configure: error: C compiler cannot create executables
> options(install.packages.check.source = "no")
> install.packages("stringi", repos="http://cran.rstudio.com/", dependencies = TRUE)
configure: error: C compiler cannot create executables
> install.packages('stringi', configure.args='--disable-cxx11')
configure: error: C compiler cannot create executables
然后,在终端我试过:
正在验证 Xcode 是否已安装:
> xcode-select --version
xcode-select version 2347.
> /usr/bin/clang --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
正在尝试在 R 控制台中安装:
> R
> devtools::install_github("Rexamine/stringi")
configure: error: C compiler cannot create executables
Uninstalling/reinstalling R 和 GFortran:
> brew uninstall --force r
从 here
安装 GFortran
> brew install r
> brew link --overwrite gcc
这在尝试安装 stringi 时没有改变行为。
会话信息:
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin16.5.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] httr_1.3.1 compiler_3.4.0 R6_2.2.2 DBI_0.7 tools_3.4.0
[6] withr_2.0.0 RPresto_1.3.0.9000 curl_2.8.1 yaml_2.1.14 memoise_1.1.0
[11] Rcpp_0.12.15 git2r_0.19.0 digest_0.6.12 devtools_1.12.0.9000
问题已通过删除 ~/.R/Makevars
解决。
采取的具体步骤:
- 关闭 RStudio 的所有实例
- 运行 在终端中:
mv ~/.R/Makevars ~/.R/old_Makevars
(请注意,文件已重命名而不是删除,以防需要恢复)
- Re-open RStudio.
- 使用
install.packages("stringi")
正常安装 stringi
可能有助于发现 ~/.R/Makevars.
的 contents/purpose
- 系统:macOS Sierra 10.12.6
- Xcode: 9.2 (2347)
- R: 3.4.0
- RStudio: 1.1.383
我正在尝试安装最新版本的 stringi (1.1.6)。这是不可能的,因为 Xcode 最近更新了。收到的错误是 configure: error: C compiler cannot create executables
,这里有完整的输出:
Installing package into ‘/usr/local/lib/R/3.4/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/stringi_1.1.6.tar.gz'
Content type 'application/x-gzip' length 3647049 bytes (3.5 MB)
==================================================
downloaded 3.5 MB
* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
checking for local ICUDT_DIR... icu55/data
checking for R_HOME... /usr/local/Cellar/r/3.4.0_1/R.framework/Resources
checking for R... /usr/local/Cellar/r/3.4.0_1/R.framework/Resources/bin/R
checking for R >= 3.1.0 for C++11 use... yes
checking for R < 3.4.0 for CXX1X flag use... no
checking for cat... /bin/cat
checking for gcc... /usr/local/opt/llvm/bin/clang -fopenmp
checking whether the C compiler works... no
configure: error: in `/private/var/folders/wd/vzwq4t9d54jb_w8m3twn7mzh0000gp/T/Rtmpu6QgYM/R.INSTALL1566d417bcdad/stringi':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/usr/local/lib/R/3.4/site-library/stringi’
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status
经过搜索,我在 RStudio 中尝试过:
> install.packages("stringi", type = "mac.binary")
package ‘stringi’ is available as a source package but not as a binary
> install.packages("stringi", type = "mac.binary.mavericks")
package ‘stringi’ is available as a source package but not as a binary
> install.packages("stringi", repos="http://cran.rstudio.com/", dependencies = TRUE)
configure: error: C compiler cannot create executables
> options(install.packages.check.source = "no")
> install.packages("stringi", repos="http://cran.rstudio.com/", dependencies = TRUE)
configure: error: C compiler cannot create executables
> install.packages('stringi', configure.args='--disable-cxx11')
configure: error: C compiler cannot create executables
然后,在终端我试过:
正在验证 Xcode 是否已安装:
> xcode-select --version
xcode-select version 2347.
> /usr/bin/clang --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
正在尝试在 R 控制台中安装:
> R
> devtools::install_github("Rexamine/stringi")
configure: error: C compiler cannot create executables
Uninstalling/reinstalling R 和 GFortran:
> brew uninstall --force r
从 here
安装 GFortran> brew install r
> brew link --overwrite gcc
这在尝试安装 stringi 时没有改变行为。
会话信息:
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin16.5.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] httr_1.3.1 compiler_3.4.0 R6_2.2.2 DBI_0.7 tools_3.4.0
[6] withr_2.0.0 RPresto_1.3.0.9000 curl_2.8.1 yaml_2.1.14 memoise_1.1.0
[11] Rcpp_0.12.15 git2r_0.19.0 digest_0.6.12 devtools_1.12.0.9000
问题已通过删除 ~/.R/Makevars
解决。
采取的具体步骤:
- 关闭 RStudio 的所有实例
- 运行 在终端中:
mv ~/.R/Makevars ~/.R/old_Makevars
(请注意,文件已重命名而不是删除,以防需要恢复) - Re-open RStudio.
- 使用
install.packages("stringi")
正常安装 stringi