感谢您点击。我已经尝试解决这个问题几个小时但似乎没有任何效果。
我的操作系统:MacOS sierra OS版本:10.12.3 R版本:3.3.3
我已按照此处的data.table下载说明进行操作:https://github.com/Rdatatable/data.table/wiki/Installation 但它仍然无法正常工作
错误信息如下:
*> install.packages("data.table", type = "source",
+ repos = "http://Rdatatable.github.io/data.table")
嘗試 URL 'http://Rdatatable.github.io/data.table/src/contrib/data.table_1.10.5.tar.gz'
Content type 'application/octet-stream' length 2843331 bytes (2.7 MB)
==================================================
downloaded 2.7 MB
* installing *source* package ‘data.table’ ...
** libs
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c assign.c -o assign.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c between.c -o between.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c bmerge.c -o bmerge.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c chmatch.c -o chmatch.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c dogroups.c -o dogroups.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c fastmean.c -o fastmean.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c fcast.c -o fcast.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c fmelt.c -o fmelt.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c forder.c -o forder.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c frank.c -o frank.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c fread.c -o fread.o
fread.c:64:19: warning: unused variable 'TypeName' [-Wunused-const-variable]
static const char TypeName[NUMTYPE][10] = {"LGL","INT","INT64","REAL","STR","NULL"}; // for messages and errors
^
1 warning generated.
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c fsort.c -o fsort.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c fwrite.c -o fwrite.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c gsumm.c -o gsumm.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c ijoin.c -o ijoin.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c init.c -o init.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c inrange.c -o inrange.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c openmp-utils.c -o openmp-utils.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c quickselect.c -o quickselect.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c rbindlist.c -o rbindlist.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c reorder.c -o reorder.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c shift.c -o shift.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c subset.c -o subset.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c transpose.c -o transpose.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c uniqlist.c -o uniqlist.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c vecseq.c -o vecseq.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -Wall -mtune=core2 -g -O2 -c wrappers.c -o wrappers.o
/usr/local/opt/llvm/bin/clang -fopenmp -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/llvm/lib -o data.table.so assign.o between.o bmerge.o chmatch.o dogroups.o fastmean.o fcast.o fmelt.o forder.o frank.o fread.o fsort.o fwrite.o gsumm.o ijoin.o init.o inrange.o openmp-utils.o quickselect.o rbindlist.o reorder.o shift.o subset.o transpose.o uniqlist.o vecseq.o wrappers.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
mv data.table.so datatable.so
if [ "" != "Windows_NT" ] && [ `uname -s` = 'Darwin' ]; then install_name_tool -id datatable.so datatable.so; fi
installing to /Library/Frameworks/R.framework/Versions/3.3/Resources/library/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
Error in dyn.load(file, DLLpath = DLLpath, ...) :
無法載入共享物件 '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.table/libs/datatable.so' :
dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.table/libs/datatable.so, 6): Library not loaded: @rpath/libomp.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.table/libs/datatable.so
Reason: image not found
錯誤: loading failed
停止執行
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.table’
Warning in install.packages :
installation of package ‘data.table’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/n3/4f7rv1dj4ys_1z2hwh95z79h0000gn/T/RtmplcaPNQ/downloaded_packages’*
答案 0 :(得分:1)
第一个是关于几天前不再使用的变量的警告,因为您正在安装最新的开发版本(这很好):
fread.c:64:19: warning: unused variable 'TypeName' [-Wunused-const-variable]
static const char TypeName[NUMTYPE][10]
这是一个正确的警告,我将删除该变量。
第二个是错误:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
無法載入共享物件 '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.table/libs/datatable.so' :
dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.table/libs/datatable.so, 6):
Library not loaded: @rpath/libomp.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.table/libs/datatable.so
Reason: image not found
其他人也在MacOS上发现这一点,并且使用gcc而不是clang似乎在使用解决方案here取得了一些成功。这些问题似乎在MacOS上铿锵作响,而不是data.table。在Linux或Windows上没有报告任何问题。