Я пытаюсь установить пакет R из https://github.com/siqixu/DaubechiesSim, но столкнулся с некоторыми ошибками (см. ниже). Я использую R версии 4.3.2 на macOS Monterey версии 12.6.5 в Rstudio версии 2023.12.1+402.
Я пробовал следовать инструкциям здесь: clang-7: ошибка: команда компоновщика не удалась с кодом выхода 1 для macOS Big Sur, но безрезультатно.
Спасибо!
> install_github("siqixu/DaubechiesSim",ref = "main")
Downloading GitHub repo siqixu/DaubechiesSim@main
Installing 1 packages: RcppArmadillo
trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/RcppArmadillo_0.12.8.0.0.tgz'
Content type 'application/x-gzip' length 1678096 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
The downloaded binary packages are in
/var/folders/8_/_g1v36_s2dq6f005fqh_2m2c0000gp/T//RtmpARZ7O2/downloaded_packages
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/private/var/folders/8_/_g1v36_s2dq6f005fqh_2m2c0000gp/T/RtmpARZ7O2/remotes5bd045d60368/siqixu-DaubechiesSim-64fb1b3/DESCRIPTION’ ...
─ preparing ‘DaubechiesSim’:
✔ checking DESCRIPTION meta-information
─ cleaning src
─ installing the package to process help pages
-----------------------------------
─ installing *source* package ‘DaubechiesSim’ ...
** using staged installation
** libs
using C++ compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using C++11
using SDK: ‘MacOSX13.1.sdk’
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include' -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -falign-functions=64 -Wall -g -O2 -Wall -pedantic -fdiagnostics-color=always -c Daubechies_Sim.cpp -o Daubechies_Sim.o
In file included from Daubechies_Sim.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/RcppCommon.h:30:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/Rcpp/r/headers.h:62:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:100:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:642:26: error: no template named 'numeric_limits'
bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:642:60: error: no template named 'numeric_limits'
bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:643:18: error: no template named 'numeric_limits'
int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:643:50: error: no template named 'numeric_limits'
int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:648:17: error: no template named 'numeric_limits'
static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorrect radix");
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:651:25: error: no template named 'numeric_limits'
return _FloatBigger ? numeric_limits<_IntT>::max() : (numeric_limits<_IntT>::max() >> _Bits << _Bits);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:651:58: error: no template named 'numeric_limits'
return _FloatBigger ? numeric_limits<_IntT>::max() : (numeric_limits<_IntT>::max() >> _Bits << _Bits);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:645:25: error: no return statement in constexpr function
_LIBCPP_CONSTEXPR _IntT __max_representable_int_for_float() _NOEXCEPT {
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:661:16: error: no template named 'numeric_limits'
using _Lim = numeric_limits<_IntT>;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:664:12: error: use of undeclared identifier '_Lim'
return _Lim::max();
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:665:21: error: use of undeclared identifier '_Lim'
} else if (__r <= _Lim::lowest()) {
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:666:12: error: use of undeclared identifier '_Lim'
return _Lim::min();
^
In file included from Daubechies_Sim.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/RcppCommon.h:30:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/Rcpp/r/headers.h:62:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:153:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/unordered_map:437:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__hash_table:16:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:653:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:490:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/search.h:15:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/iterator_traits.h:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/incrementable_traits.h:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/concepts:134:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional_base:22:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstdlib:138:9: error: target of using declaration conflicts with declaration already in scope
using ::abs _LIBCPP_USING_IF_EXISTS;
^
/usr/local/include/stdlib.h:132:6: note: target of using declaration
int abs(int) __pure2;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:338:1: note: conflicting declaration
using ::abs _LIBCPP_USING_IF_EXISTS;
^
In file included from Daubechies_Sim.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/RcppCommon.h:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:853:1: error: declaration conflicts with target of using declaration already in scope
abs(const complex<_Tp>& __c)
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:338:1: note: target of using declaration
using ::abs _LIBCPP_USING_IF_EXISTS;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:338:9: note: using declaration
using ::abs _LIBCPP_USING_IF_EXISTS;
^
In file included from Daubechies_Sim.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/RcppCommon.h:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:910:16: error: reference to unresolved using declaration
return abs(__c.real());
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:338:1: note: using declaration annotated with 'using_if_exists' here
using ::abs _LIBCPP_USING_IF_EXISTS;
^
In file included from Daubechies_Sim.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/RcppCommon.h:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:912:16: error: reference to unresolved using declaration
return abs(__c.imag());
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:338:1: note: using declaration annotated with 'using_if_exists' here
using ::abs _LIBCPP_USING_IF_EXISTS;
^
In file included from Daubechies_Sim.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/RcppCommon.h:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:969:16: error: reference to unresolved using declaration
__re = abs(__re);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:338:1: note: using declaration annotated with 'using_if_exists' here
using ::abs _LIBCPP_USING_IF_EXISTS;
^
In file included from Daubechies_Sim.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/RcppCommon.h:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:1022:29: error: reference to unresolved using declaration
return complex<_Tp>(log(abs(__x)), arg(__x));
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:338:1: note: using declaration annotated with 'using_if_exists' here
using ::abs _LIBCPP_USING_IF_EXISTS;
^
In file included from Daubechies_Sim.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include/RcppCommon.h:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:1049:23: error: reference to unresolved using declaration
return polar(sqrt(abs(__x)), arg(__x) / _Tp(2));
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:338:1: note: using declaration annotated with 'using_if_exists' here
using ::abs _LIBCPP_USING_IF_EXISTS;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Daubechies_Sim.o] Error 1
ERROR: compilation failed for package ‘DaubechiesSim’
─ removing ‘/private/var/folders/8_/_g1v36_s2dq6f005fqh_2m2c0000gp/T/RtmphfS8UF/Rinst5da93be1fd83/DaubechiesSim’
-----------------------------------
ERROR: package installation failed
Error: Failed to install 'DaubechiesSim' from GitHub:
! System command 'R' failed```
Вы используете устаревшую версию MacOS. У тебя действительно есть машина для рук?
Этот пакет не обновлялся уже два года, и его нет в CRAN. Избегай это.
@defuneste да, я установил xcode и все еще получаю подобные ошибки. К сожалению, мне нужно использовать этот пакет.
Вы также установили GNU Fortran? mac.r-project.org/tools (вторая ссылка на обязательные инструменты, остальное тоже приятно) ?





с моей машины:
R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.3.1
#[...]
Имея xcode и компилятор GNU Fortran (https://mac.r-project.org/tools/)
install.package("pak")
pak::pkg_install("siqixu/DaubechiesSim")
✔ Updated metadata database: 4.97 MB in 4 files.
✔ Updating metadata database ... done
→ Will install 1 package.
→ Will download 1 package with unknown size.
+ DaubechiesSim 1.0 😀🔧 ⬇ (GitHub: 64fb1b3)
ℹ Getting 1 pkg with unknown size
✔ Cached copy of DaubechiesSim 1.0 (source) is the latest build
✔ No downloads needed, all packages are cached
ℹ Packaging DaubechiesSim 1.0
✔ Packaged DaubechiesSim 1.0 (9.4s)
ℹ Building DaubechiesSim 1.0
✔ Built DaubechiesSim 1.0 (7.7s)
✔ Installed DaubechiesSim 1.0 (github::siqixu/DaubechiesSim@64fb1b3) (91ms)
✔ 1 pkg + 2 deps: kept 2, added 1 [26.6s]
DaubechiesSim::hello("sageeric1")
Hello, sageeric1
Спасибо за попытку! Я установил GNU Fortran и все равно получаю ошибки. Это что-нибудь значит? (Есть и другие, но это 1 пример): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:320:5: ошибка: <cmath> попробовал включить <math .h>, но не нашел заголовок <math.h> в libc++. Обычно это означает, что ваши пути поиска заголовков настроены неправильно. Пути поиска заголовков должны содержать заголовки стандартной библиотеки C++ перед любой стандартной библиотекой C, и вы, вероятно, используете флаги компилятора, которые делают это не так.
Наконец-то он заработал, следуя рекомендациям Джастина Савойя здесь https://discourse.mc-stan.org/t/compile-issue-with-rstan-on-macbook-pro-m1/33195/15. Моя MacOS уже была обновлена, поэтому я удалил Xcode и инструменты командной строки, удалил Homebrew и переустановил Xcode.
Что я сделал: Я удалил инструменты командной строки. Я обновил Sonoma до 14.1.1. Я удалил Homebrew полностью (это было радикально и не уверен, что оно было нужно, но Homebrew мне особо и не был нужен). Я установил последнюю версию обычного (не бета-версии) Xcode. Раньше я пробовал только с CLT; это не сработало. Бета-версия CLT 15.1 у меня не заработала. На самом деле все CLT у меня не сработали.
ой, так это была проблема с путем при обновлении ОС... странно Молодцы!
У вас установлен Xcode Developer.apple.com/xcode ?