Я пытаюсь установить пакет "DistributionUtils" (на Ма c) через
install.packages("DistributionUtils")
Меня спрашивают, хочу ли я установить их из источников. Я отвечаю «Да» (обратите внимание: при ответе «нет» код не приступает к установке). Затем возникает следующая ошибка (см. Полный код ниже):
make: *** [IncompleteBessel.o] Error 1
ERROR: compilation failed for package ‘DistributionUtils’
Два вопроса:
- (Q1) Почему возникает ошибка?
- (Q2) Как я могу альтернативно установить пакет?
Любая помощь приветствуется. Пожалуйста, найдите ниже полный код выполнения:
install.packages("DistributionUtils")
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
Package which is only available in source form, and may need compilation of C/C++/Fortran:
‘DistributionUtils’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘DistributionUtils’
trying URL 'https://cran.rstudio.com/src/contrib/DistributionUtils_0.6-0.tar.gz'
Content type 'application/x-gzip' length 41231 bytes (40 KB)
==================================================
downloaded 40 KB
* installing *source* package ‘DistributionUtils’ ...
** package ‘DistributionUtils’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fPIC -Wall -g -O2 -c IncompleteBessel.f -o IncompleteBessel.o
make: gfortran: No such file or directory
make: *** [IncompleteBessel.o] Error 1
ERROR: compilation failed for package ‘DistributionUtils’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/DistributionUtils’
Warning in install.packages :
installation of package ‘DistributionUtils’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/pp/nll33qgs6w52y4bkhjdxvvdh0000gn/T/RtmpTZoRq5/downloaded_packages’
––––––––––––––––––––––
РЕДАКТИРОВАТЬ : Следуя советам Конарда Рудольфа, я установил G CC через Homebrew. Тем не менее, он по-прежнему не работает, и теперь я получаю следующую ошибку:
install.packages("DistributionUtils")
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘DistributionUtils’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘DistributionUtils’
trying URL 'https://cran.rstudio.com/src/contrib/DistributionUtils_0.6-0.tar.gz'
Content type 'application/x-gzip' length 41231 bytes (40 KB)
==================================================
downloaded 40 KB
* installing *source* package ‘DistributionUtils’ ...
** package ‘DistributionUtils’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fPIC -Wall -g -O2 -c IncompleteBessel.f -o IncompleteBessel.o
IncompleteBessel.f:117:36:
117 | subroutine GNUM(n,x,y,nu,Am,An,nmax,Cnp,GM,GN)
| 1
Warning: Unused dummy argument 'an' at (1) [-Wunused-dummy-argument]
IncompleteBessel.f:34:34:
34 | double precision BI(0:numax),BK(0:numax)
| 1
Warning: Unused variable 'bi' declared at (1) [-Wunused-variable]
IncompleteBessel.f:34:46:
34 | double precision BI(0:numax),BK(0:numax)
| 1
Warning: Unused variable 'bk' declared at (1) [-Wunused-variable]
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c init.c -o init.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o DistributionUtils.so IncompleteBessel.o init.o -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [DistributionUtils.so] Error 1
ERROR: compilation failed for package ‘DistributionUtils’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/DistributionUtils’
Warning in install.packages :
installation of package ‘DistributionUtils’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/pp/nll33qgs6w52y4bkhjdxvvdh0000gn/T/RtmpA1L5oK/downloaded_packages’