r - 如何在 R 中安装包 simmer?(在 Mac OS X 上)
问题描述
操作系统版本:macOS Catalina 10.15.4
我试图安装 simmer 包,但我从 r studio 得到错误消息。
'''
> devtools::install_github("r-simmer/simmer")
Downloading GitHub repo r-simmer/simmer@master
✔ checking for file ‘/private/var/folders/pz/35d87wwn2_19t3h08hkv42m00000gn/T/RtmpaX72mc/remotes196b67508c78/r-simmer-simmer-e10a7dc/DESCRIPTION’ ...
─ preparing ‘simmer’:
✔ checking DESCRIPTION meta-information ...
─ cleaning src
─ installing the package to process help pages
-----------------------------------
─ installing *source* package ‘simmer’ ...
** using staged installation
** libs
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -DBOOST_NO_LONG_LONG -DBOOST_NO_AUTO_PTR -DRCPP_USE_UNWIND_PROTECT -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from ./../inst/include/simmer.h:21:
In file included from ../inst/include/simmer/common.h:32:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/container/set.hpp:15:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config.hpp:57:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config/platform/macos.hpp:28:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:655:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/gethostuuid.h:39:17: error: C++ requires a type specifier for all declarations
int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
^
In file included from RcppExports.cpp:4:
In file included from ./../inst/include/simmer.h:21:
In file included from ../inst/include/simmer/common.h:32:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/container/set.hpp:15:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config.hpp:57:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config/platform/macos.hpp:28:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:662:27: error: unknown type name 'uuid_t'; did you mean 'uid_t'?
int getsgroups_np(int *, uuid_t);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here
typedef __darwin_uid_t uid_t;
^
In file included from RcppExports.cpp:4:
In file included from ./../inst/include/simmer.h:21:
In file included from ../inst/include/simmer/common.h:32:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/container/set.hpp:15:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config.hpp:57:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config/platform/macos.hpp:28:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:664:27: error: unknown type name 'uuid_t'; did you mean 'uid_t'?
int getwgroups_np(int *, uuid_t);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here
typedef __darwin_uid_t uid_t;
^
In file included from RcppExports.cpp:4:
In file included from ./../inst/include/simmer.h:21:
In file included from ../inst/include/simmer/common.h:32:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/container/set.hpp:15:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config.hpp:57:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config/platform/macos.hpp:28:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:727:31: error: unknown type name 'uuid_t'; did you mean 'uid_t'?
int setsgroups_np(int, const uuid_t);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here
typedef __darwin_uid_t uid_t;
^
In file included from RcppExports.cpp:4:
In file included from ./../inst/include/simmer.h:21:
In file included from ../inst/include/simmer/common.h:32:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/container/set.hpp:15:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config.hpp:57:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config/platform/macos.hpp:28:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:729:31: error: unknown type name 'uuid_t'; did you mean 'uid_t'?
int setwgroups_np(int, const uuid_t);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here
typedef __darwin_uid_t uid_t;
^
5 errors generated.
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘simmer’
─ removing ‘/private/var/folders/pz/35d87wwn2_19t3h08hkv42m00000gn/T/Rtmp5agreT/Rinst19c0507f76cd/simmer’
-----------------------------------
ERROR: package installation failed
Error: Failed to install 'simmer' from GitHub:
System command error, exit status: 1, stdout + stderr (last 10 lines):
E> ^
E> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here
E> typedef __darwin_uid_t uid_t;
E> ^
E> 5 errors generated.
E> make: *** [RcppExports.o] Error 1
E> ERROR: compilation failed for package ‘simmer’
E> * removing ‘/private/var/folders/pz/35d87wwn2_19t3h08hkv42m00000gn/T/Rtmp5agreT/Rinst19c0507f76cd/simmer’
E> -----------------------------------
E> ERROR: package installation failed
'''
我从谷歌找到了一些信息。他们说这个问题是因为 macOS 而出现的,但我找不到任何解决方案。有没有其他安装包的途径?或者我该如何解决这个问题?
解决方案
试一试
install.packages("simmer")
推荐阅读
- python - Python - 有没有办法简化这段代码?
- ruby-on-rails - 如何将一个数据库的电话号码转移到rails中彼此相关的另一个数据库
- laravel - 如何使用引导程序在 VueJS 中打开模式?
- string - Scala子字符串并将其存储在DF中
- python-3.x - InvalidArgumentError:维度 0 的切片索引 5 超出范围。[Op:StridedSlice] 名称:strided_slice/
- r - 使用 facet.by 后如何更改图形的顺序
- sql - 插入零行需要 2 分钟
- reactjs - 如何使用上下文是一个不是组件的反应类
- onclick - 在 antd modal 中的 onclick 事件上调用自定义钩子 useApi 的正确方法
- c - SERCOM (USART) 驱动程序,用于 ATSAMD21 的连续读写