[R] data.table installation on intel macOS Ventura 13.6

Carlos Ortega co|or|e @end|ng |rom gm@||@com
Tue Sep 26 16:23:11 CEST 2023


Hi,

This is the Makevars I used to compile sucessfully the latest version of
data.table in a x86_64 machine.

#----------
#--- https://github.com/Rdatatable/data.table/wiki/Installation
#---------
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,$(LOC)/lib
CPPFLAGS=-I$(LOC)/include
-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
#----------

I had to install "gfortran" which has a link in that installation page.
Having "gfortran" was key to make it run multithread.

Thanks,
Carlos.

On Tue, Sep 26, 2023 at 11:49 AM Naresh Gurbuxani <
naresh_gurbuxani using hotmail.com> wrote:

> > Sys.info()
>
>                        sysname
>
>                       "Darwin"
>
>                        release
>
>                       "22.6.0"
>
>                        version
> "Darwin Kernel Version 22.6.0: Fri Sep 15 13:39:52 PDT 2023;
> root:xnu-8796.141.3.700.8~1/RELEASE_X86_64"
>
>                     nodename
>
>  [deleted]
>
>                        machine
>
>                       "x86_64"
>
>                          login
>
>              [deleted]
>
>                           user
>
>              [deleted]
>
>                 effective_user
>
>              [deleted]
>
> My Makevars file:
> CPPFLAGS += -Xclang -fopenmp
> LDFLAGS += -lomp
>
> Using brew, I installed libomp
>
> data.table is not installed on my machine.  In fresh R session:
> > install.packages("data.table", repos = "https://cran.r-project.org")
> Installing package into ‘/usr/local/lib/R/4.3/site-library’
> (as ‘lib’ is unspecified)
> trying URL '
> https://cran.r-project.org/src/contrib/data.table_1.14.8.tar.gz'
> Content type 'application/x-gzip' length 5338582 bytes (5.1 MB)
> ==================================================
> downloaded 5.1 MB
>
> * installing *source* package ‘data.table’ ...
> ** package ‘data.table’ successfully unpacked and MD5 sums checked
> ** using staged installation
> zlib 1.2.11 is available ok
> *** OpenMP not supported! data.table uses OpenMP to automatically
> ***   parallelize operations like sorting, grouping, file reading, etc.
> *** For details on how to install the necessary toolchains on your OS see:
> ***   https://github.com/Rdatatable/data.table/wiki/Installation
> *** Continuing installation without OpenMP support...
> ** libs
> using C compiler: ‘Homebrew clang version 17.0.1’
> using SDK: ‘’
> clang -I"/usr/local/Cellar/r/4.3.1/lib/R/include" -DNDEBUG
>  -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include
> -I/usr/local/opt/xz/include -I/usr/local/include -Xclang -fopenmp    -fPIC
> -g -O2  -c assign.c -o assign.o
> [several lines deleted]
> clang -dynamiclib -Wl,-headerpad_max_install_names -undefined
> dynamic_lookup -single_module -multiply_defined suppress
> -L/usr/local/Cellar/r/4.3.1/lib/R/lib -L/usr/local/opt/gettext/lib
> -L/usr/local/opt/readline/lib -L/usr/local/opt/xz/lib -L/usr/local/lib
> -lomp -o data.table.so assign.o between.o bmerge.o chmatch.o cj.o
> coalesce.o dogroups.o fastmean.o fcast.o fifelse.o fmelt.o forder.o frank.o
> fread.o freadR.o froll.o frollR.o frolladaptive.o fsort.o fwrite.o
> fwriteR.o gsumm.o ijoin.o init.o inrange.o nafill.o nqrecreateindices.o
> openmp-utils.o quickselect.o rbindlist.o reorder.o shift.o snprintf.o
> subset.o transpose.o types.o uniqlist.o utils.o vecseq.o wrappers.o -lz
> -L/usr/local/Cellar/r/4.3.1/lib/R/lib -lR -lintl -Wl,-framework
> -Wl,CoreFoundation
> ld: warning: -single_module is obsolete
> ld: warning: -multiply_defined is obsolete
> ld: warning: -single_module is obsolete
> ld: warning: -multiply_defined is obsolete
> ld: library 'omp' not found
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make: *** [data.table.so] Error 1
> ERROR: compilation failed for package ‘data.table’
> * removing ‘/usr/local/lib/R/4.3/site-library/data.table’
>
> The downloaded source packages are in
>
> ‘/private/var/folders/97/5377j5_d207fshvjz_pz7szw0000gn/T/RtmpjZgIo0/downloaded_packages’
> Warning message:
> In install.packages("data.table", repos = "https://cran.r-project.org") :
>   installation of package ‘data.table’ had non-zero exit status
>
> I delete above two lines from my Makevars fiie, which is now empty.  Now
> reinstall data.table.
>
> > install.packages("data.table", repos = "https://cran.r-project.org")
> Installing package into ‘/usr/local/lib/R/4.3/site-library’
> (as ‘lib’ is unspecified)
> trying URL '
> https://cran.r-project.org/src/contrib/data.table_1.14.8.tar.gz'
> Content type 'application/x-gzip' length 5338582 bytes (5.1 MB)
> ==================================================
> downloaded 5.1 MB
>
> * installing *source* package ‘data.table’ ...
> ** package ‘data.table’ successfully unpacked and MD5 sums checked
> ** using staged installation
> zlib 1.2.11 is available ok
> R CMD SHLIB supports OpenMP without any extra hint
> ** libs
> using C compiler: ‘Homebrew clang version 17.0.1’
> using SDK: ‘’
> clang -I"/usr/local/Cellar/r/4.3.1/lib/R/include" -DNDEBUG
>  -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include
> -I/usr/local/opt/xz/include -I/usr/local/include     -fPIC  -g -O2  -c
> assign.c -o assign.o
> [several lines deleted]
> clang -dynamiclib -Wl,-headerpad_max_install_names -undefined
> dynamic_lookup -single_module -multiply_defined suppress
> -L/usr/local/Cellar/r/4.3.1/lib/R/lib -L/usr/local/opt/gettext/lib
> -L/usr/local/opt/readline/lib -L/usr/local/opt/xz/lib -L/usr/local/lib -o
> data.table.so assign.o between.o bmerge.o chmatch.o cj.o coalesce.o
> dogroups.o fastmean.o fcast.o fifelse.o fmelt.o forder.o frank.o fread.o
> freadR.o froll.o frollR.o frolladaptive.o fsort.o fwrite.o fwriteR.o
> gsumm.o ijoin.o init.o inrange.o nafill.o nqrecreateindices.o
> openmp-utils.o quickselect.o rbindlist.o reorder.o shift.o snprintf.o
> subset.o transpose.o types.o uniqlist.o utils.o vecseq.o wrappers.o -lz
> -L/usr/local/Cellar/r/4.3.1/lib/R/lib -lR -lintl -Wl,-framework
> -Wl,CoreFoundation
> ld: warning: -single_module is obsolete
> ld: warning: -multiply_defined is obsolete
> ld: warning: -single_module is obsolete
> ld: warning: -multiply_defined is obsolete
> PKG_CFLAGS =
> PKG_LIBS = -lz
> if [ "data.table.so" != "data_table.so" ]; then mv data.table.so
> data_table.so; fi
> if [ "" != "Windows_NT" ] && [ `uname -s` = 'Darwin' ]; then
> install_name_tool -id data_table.so data_table.so; fi
> installing to
> /usr/local/lib/R/4.3/site-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)
> > library(data.table)
> data.table 1.14.8 using 1 threads (see ?getDTthreads).  Latest news:
> r-datatable.com
> **********
> This installation of data.table has not detected OpenMP support. It should
> still work but in single-threaded mode.
> This is a Mac. Please read https://mac.r-project.org/openmp/. Please
> engage with Apple and ask them for support. Check r-datatable.com for
> updates, and our Mac instructions here:
> https://github.com/Rdatatable/data.table/wiki/Installation. After several
> years of many reports of installation problems on Mac, it's time to
> gingerly point out that there have been no similar problems on Windows or
> Linux.
> **********
>
>
>
> > On Sep 25, 2023, at 4:06 AM, Carlos Ortega <coforfe using gmail.com> wrote:
> >
> > Hi,
> >
> > Yes, on Mac, it takes a while to even get the build to allow data.table
> to be used on multithread.
> >
> > See this installation guide which has sections specially dedicated for
> Mac.
> >     • https://github.com/Rdatatable/data.table/wiki/Installation
> >
> > You will see that you will most likely have to modify the "Makevars"
> file to include the paths of different compilers.
> >
> > Thank you,
> > Carlos.
> >
> > On Mon, Sep 25, 2023 at 9:41 AM Ivan Krylov <krylov.r00t using gmail.com>
> wrote:
> > On Sun, 24 Sep 2023 23:42:14 +0000
> > Naresh Gurbuxani <naresh_gurbuxani using hotmail.com> wrote:
> >
> > > Instruction on this site do not apply to Ventura 13.6
> >
> > What happens whey you try to follow them?
> >
> > The data.table maintainers have prepared the following guide:
> > <https://github.com/Rdatatable/data.table/wiki/Support>. In particular,
> > in order to help us help you, you need to include your actions, their
> > expected and actual results. Without that, you're effectively asking
> > someone to write a personal tutorial for you, which is not a good use
> > of anyone's time.
> >
> > If you don't get an answer here and don't find anything useful on
> > StackOverflow when searching for [data.table], try
> > R-SIG-Mac using r-project.org.
> >
> > --
> > Best regards,
> > Ivan
> >
> > ______________________________________________
> > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list