R 4.0 以降、data.table は、CRAN からバイナリとしてインストールされた場合、OpenMP を使用できなくなりました。パッケージをロードする際のメッセージは次のとおりです。
ただし、 https://github.com/Rdatatable/data.table/wiki/Installationで提供されているガイドに従ってソースからインストールすることは可能です。ガイドに従ったところ、コンパイルは成功しましたが、以下のタイプのコンパイラ警告が大量に生成されました。
> install.packages("data.table", type = "source")
trying URL 'https://mirror.ibcp.fr/pub/CRAN/src/contrib/data.table_1.12.8.tar.gz'
Content type 'application/x-gzip' length 4948391 bytes (4.7 MB)
==================================================
downloaded 4.7 MB
* installing *source* package ‘data.table’ ...
** package ‘data.table’ successfully unpacked and MD5 sums checked
** using staged installation
*** pkg-config is not installed.
*** Compilation will now be attempted and if it works you can ignore this message. However,
*** if compilation fails, try 'locate zlib.h zconf.h' and ensure the zlib development library
*** is installed :
*** deb: zlib1g-dev (Debian, Ubuntu, ...)
*** rpm: zlib-devel (Fedora, EPEL, ...)
*** brew: zlib (OSX)
*** Note that zlib is required to compile R itself so you may find the advice in the R-admin
*** guide helpful regarding zlib. On Debian/Ubuntu, zlib1g-dev is a dependency of r-base as
*** shown by 'apt-cache showsrc r-base | grep ^Build-Depends | grep zlib', and therefore
*** 'sudo apt-get build-dep r-base' should be sufficient too.
*** To silence this message, please ensure that :
*** 1) 'pkg-config --exists zlib' succeeds (i.e. $? -eq 0)
*** 2) 'pkg-config --libs zlib' contains -lz
*** Compilation will now be attempted ...
** libs
/usr/local/bin/clang -fopenmp -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c assign.c -o assign.o
In file included from assign.c:1:
In file included from ./data.table.h:1:
In file included from ./dt_stdio.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:137:9: warning: type nullability specifier '_Nullable' is a Clang extension [-Wnullability-extension]
int (* _Nullable _close)(void *);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:93:16: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
unsigned char *_base;
^
...
...
...
212 warnings generated.
ld: warning: directory not found for option '-L/usr/local/opt/gettext/lib'
installing to /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-data.table/00new/data.table/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (data.table)
私は IT スペシャリストではありません。指示に従ってソースから標準的にコンパイルすることは私の限界であり、残りは私をはるかに超えています。コンパイルの完全な出力は、このリンクの下にあります。
そこで、次のことを理解したいと思います。
これらの警告は重要ですか? これらすべての警告はパッケージのパフォーマンスに影響しますか?
明確にしてくれてありがとう。
sessionInfo() は以下のとおりです。
sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.5
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] compiler_4.0.2 tools_4.0.2