El paquete data.table muestra una advertencia en Mac OS (2020) que dice que sólo puede usar un hilo de ejecución porque no se usó OpenMP para la compilación del paquete.
Para conseguir recuperar todos los núcleos basta con realizar estos pasos:
- xcode-select --install
- brew update && brew install llvm
- brew install pkg-config
- remove.packages("data.table")
- install.packages("data.table")
- Añadir las líneas indicadas al final de este post al fichero ~/.R/Makevars (crearlo si no existe)
- install.packages("data.table", type="source")
Más información en: https://github.com/Rdatatable/data.table/wiki/Installation
# 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
# Newly installed Homebrew is located in # - /opt/homebrew for ARM Macs (M1 and its successors) # - /usr/local for Intel Macs HOMEBREW_LOC=/opt/homebrew # If you downloaded llvm manually above, replace with your chosen NEW_PATH/clang LLVM_LOC=$(HOMEBREW_LOC)/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$(HOMEBREW_LOC)/opt/gettext/lib -L$(LLVM_LOC)/lib -Wl,-rpath,$(LLVM_LOC)/lib CPPFLAGS=-I$(HOMEBREW_LOC)/opt/gettext/include -I$(LLVM_LOC)/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
No hay comentarios:
Publicar un comentario