[问题] 安装 OpenMP 与套件 stringi

楼主: MiddleRe (可口曼尼綠)   2021-07-20 01:09:42
[问题类型]:
程式咨询(我想用R 做某件事情,但是我不知道要怎么用R 写出来)
[软件熟悉度]:
入门(写过其他程式,只是对语法不熟悉)
[问题叙述]:
如题,我现在遇到两个困难。
一、OpenMP
想要安装套件 data.table,但此套件需要 OpenMP。
参考网站 https://mac.r-project.org/openmp/ 给出的提示,
我在 terminal 输入指令
curl -O https://mac.r-project.org/openmp/openmp-11.0.1-darwin20-Release.tar.gz
sudo tar fvx openmp-11.0.1-darwin20-Release.tar.gz -C /
输入第二个指令后,却得到以下的错误资讯,似乎是没有解压缩成功?
x usr/: Can't restore time
x usr/local/: Can't restore time
x usr/local/include/
x usr/local/lib/
x usr/local/lib/libomp.dylib
x usr/local/include/ompt.h
x usr/local/include/omp.h
x usr/local/include/omp-tools.h
tar: Error exit delayed from previous errors.
此步骤失败,导致不晓得怎么安装下去了QQ
二、stringi
因为平常有使用 R Markdown 与 bookdown 的习惯,因此需要此套件。
更新 R 为 4.1 版以后,在 Installing Packages 之处,输入 stringi 却会报错,如:
> install.packages("stringi")
There is a binary version available but the source version is later:
binary source needs_compilation
stringi 1.6.2 1.7.3 TRUE
Do you want to install from sources the package which needs compilation?
(Yes/no/cancel) yes
installing the source package ‘stringi’
trying URL 'https://cran.rstudio.com/src/contrib/stringi_1.7.3.tar.gz'
Content type 'application/x-gzip' length 7599615 bytes (7.2 MB)
==================================================
downloaded 7.2 MB
* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
** using staged installation
checking for R_HOME... /Library/Frameworks/R.framework/Resources
checking for R... /Library/Frameworks/R.framework/Resources/bin/R
checking for endianness... little
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 local ICUDT_DIR... icu69/data
checking for gcc... /usr/local/gfortran/bin/gcc -fopenmp
checking whether the C compiler works... no
configure: error: in
`/private/var/folders/r0/thwpnv9d5bjc5gvqkwdg3_2w0000gn/T/Rtmpfh2bgB/R.INSTALL4ac22864b91a/stringi':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘
/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/stringi’
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status
The downloaded source packages are in

/private/var/folders/r0/thwpnv9d5bjc5gvqkwdg3_2w0000gn/T/RtmpMoOgNU/downloaded_packages

[环境叙述]
R version 4.1.0 Patched (2021-07-16 r80639)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.1
Matrix products: default
LAPACK:
/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.1.0 htmltools_0.5.1.1 tools_4.1.0 yaml_2.2.1
rmarkdown_2.9
[6] knitr_1.33 xfun_0.24 digest_0.6.27 rlang_0.4.11
evaluate_0.14
感谢各位板友!
楼主: MiddleRe (可口曼尼綠)   2021-07-20 01:26:00
已经自行解决stringi的问题了,是arm的问题烦请各位板友协助OpenMP的问题了QQ

Links booklink

Contact Us: admin [ a t ] ucptt.com