Not able to install Rcmdr because of datatable.so (shared object)

library("car", lib.loc="/Library/Frameworks/R.framework/Versions/3.6/Resources/library")
Error: package or namespace load failed for ‘car’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘data.table’
install.packages("data.table")

There is a binary version available but the source version is later:
binary source needs_compilation
data.table 1.12.8 1.13.0 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source package ‘data.table’

trying URL 'https://cran.rstudio.com/src/contrib/data.table_1.13.0.tar.gz'
Content type 'application/x-gzip' length 5273400 bytes (5.0 MB)

downloaded 5.0 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
    clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c assign.c -o assign.o
    ...
    clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c transpose.c -o transpose.o
    clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c types.c -o types.o
    clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c uniqlist.c -o uniqlist.o
    clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c utils.c -o utils.o
    clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c vecseq.c -o vecseq.o
    clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c wrappers.c -o wrappers.o
    clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/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 -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
    installing to /Library/Frameworks/R.framework/Versions/3.6/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
    Error: package or namespace load failed for ‘data.table’ in library.dynam(lib, package, package.lib):
    shared object ‘datatable.so’ not found
    Error: loading failed
    Execution halted
    ERROR: loading failed
  • removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/data.table’
    Warning in install.packages :
    installation of package ‘data.table’ had non-zero exit status

I've tried to uninstall and install both R and R Studio but have the same results. "car" and "data.table" cannot be successfully installed. So, I tried to install "data.table" to have "car" installed but have an error saying that

shared object 'databtable.so' not found

I don't know where I can find this datatable.so...

Always say no. If the package doesn’t compile from source the first time, it almost certainly not the second

Thank you so much! I can't believe that was the answer that would solve this.

Can I ask, why does it ask us this question? What's the purpose/function of this question? Is it just a "block" to give the system a breather, in case it has to load a lot of things?

1 Like

From the time a package is released until a binary version can be prepared may be 10-14 days. Some macOS users may wish to use the version before then, and this feature allows that.

However, macOS is not Linux. Its compiler doesn’t work identically and manual changes to the installation details are often needed to get source code to install. In addition, base macOS does not include the compiler in the first place. It has to be installed.

Thanks for the explanation!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.