R: Unable to load data.table due to missing _omp_set_num_threads character

I have an R package with an import list and never had problems downloading the latest version. I just added data.tableto the list and now I can not download the package.

OS : macOS Sierra 10.12.5 / 6

gcc :

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin16.7.0
Thread model: posix

Import

aws.s3,
data.table,
googledrive,
httr,
jsonlite,
lubridate,
plyr
RMixpanel,
rmongodb,
RPresto,
stringi,
stringr,
uuid

Mistakes

openmp-utils.c:50:5: warning: implicit declaration of function 'omp_set_num_threads' is invalid in C99 [-Wimplicit-function-declaration]
omp_set_num_threads(1);
^
1 warning generated.

...

Error: package or namespace load failed for ‘data.table’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/local/lib/R/3.4/site-library/data.table/libs/datatable.so':
dlopen(/usr/local/lib/R/3.4/site-library/data.table/libs/datatable.so, 6): Symbol not found: _omp_set_num_threads

Referenced from: /usr/local/lib/R/3.4/site-library/data.table/libs/datatable.so

Expected in: flat namespace in /usr/local/lib/R/3.4/site-library/data.table/libs/datatable.so

Error: loading failed

I also tried moving plyrhigher than data.table, but getting the same error. Any ideas for something that I am missing?

+4
source share
2 answers

I fixed my mistake and pressed 1.10.4-2 on CRAN.

  • OpenMP MacOS CRAN CRANs Mac. v1.10.4-1 MacOS , OpenMP , # 2409. @fupangpangpang . , OpenMP .

, .

+2

, googling data.table, ~./R/Makevars.

macports gcc7. macports gcc-mp-7 g++ - mp-7

, clang macOS, ~./R/Makevars. :

CC = gcc-mp-7 -fopenmp
  CXX = g++ - mp-7 -fopenmp

clang, gcc-mp-7 clang-omp ( - , ) -fopenmp .

+2

Source: https://habr.com/ru/post/1687263/


All Articles