[問題] 安裝 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