r-在mac catalina上从源代码安装rdatable



我"一丝不苟"地遵循了rdatable的mac安装wiki。我也试着跟随这篇博客文章,通过自制软件安装r,然后从源代码安装软件包。

然而,似乎有一个问题我自己无法解决。你能帮我一下吗?我最近把我的mac从大苏尔降级为卡塔琳娜。我能够在Big Sur和以前的Catalina上安装源代码包。

install.packages("data.table", type = "source", repos = "https://Rdatatable.gitlab.io/data.table")
#> Warning in install.packages("data.table", type = "source", repos = "https://
#> Rdatatable.gitlab.io/data.table"): installation of package 'data.table' had non-
#> zero exit status
char    *cgetcap(char *, const char *, int);
^
_Nullable
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:281:34: note: insert '_Nonnull' if the pointer should never be null
char    *cgetcap(char *, const char *, int);
^
_Nonnull
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:281:6: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
char    *cgetcap(char *, const char *, int);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:281:6: note: insert '_Nullable' if the pointer may be null
char    *cgetcap(char *, const char *, int);
^
_Nullable 
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:281:6: note: insert '_Nonnull' if the pointer should never be null
char    *cgetcap(char *, const char *, int);
^
_Nonnull 
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:283:19: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
int      cgetent(char **, char **, const char *);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:283:19: note: insert '_Nullable' if the pointer may be null
int      cgetent(char **, char **, const char *);
^
_Nullable
.
.
.
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:328:57: note: insert '_Nullable' if the pointer may be null
int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
^

^
_Nonnull 
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:359:13: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
extern char *suboptarg;         /* getsubopt(3) external variable */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:359:13: note: insert '_Nullable' if the pointer may be null
extern char *suboptarg;         /* getsubopt(3) external variable */
^
_Nullable 
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:359:13: note: insert '_Nonnull' if the pointer should never be null
extern char *suboptarg;         /* getsubopt(3) external variable */
^
_Nonnull 
215 warnings and 2 errors generated.
make: *** [assign.o] Error 1
ERROR: compilation failed for package ‘data.table’

由reprex软件包(v1.0.0(于2021-03-28创建

会话信息
sessionInfo()
#> R version 4.0.4 (2021-02-15)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Catalina 10.15.7
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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] digest_0.6.27     assertthat_0.2.1  magrittr_2.0.1    reprex_1.0.0     
#>  [5] evaluate_0.14     highr_0.8         rlang_0.4.10      stringi_1.5.3    
#>  [9] cli_2.3.1         fs_1.5.0          rmarkdown_2.7     tools_4.0.4      
#> [13] stringr_1.4.0     glue_1.4.2        xfun_0.22         yaml_2.2.1       
#> [17] compiler_4.0.4    htmltools_0.5.1.1 knitr_1.31

安装使用gcc!注释了clang编译器选项,并尝试使用gcc,并从支持openmp的源代码安装了data.table。

# # if you downloaded llvm manually above, replace with your chosen NEW_PATH/clang
# LLVM_LOC = /usr/local/opt/llvm
# CC=$(LLVM_LOC)/bin/clang -fopenmp
# CXX=$(LLVM_LOC)/bin/clang++ -fopenmp
# # -O3 should be faster than -O2 (default) level optimisation ..
# CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
# CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
# LDFLAGS=-L/usr/local/opt/gettext/lib -L$(LLVM_LOC)/lib -Wl,-rpath,$(LLVM_LOC)/lib
# CPPFLAGS=-I/usr/local/opt/gettext/include -I$(LLVM_LOC)/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
# GCC (Official GNU fortran) ver
LOC = /usr/local/gfortran
CC=$(LOC)/bin/gcc -fopenmp
CXX=$(LOC)/bin/g++ -fopenmp
CXX11 = $(LOC)/bin/g++ -fopenmp # for fst package

CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
LDFLAGS=-L$(LOC)/lib -Wl,-rpath,-I$(LOC)/lib
CPPFLAGS=-I$(LOC)/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include

最新更新