Cannot Install RSQLite

I am trying to install RSQLite on a MacOS 10.15.4 under Rstudio. I have the following error:


R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin19.3.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("RSQLite")
Installing package into ‘/usr/local/lib/R/3.6/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/RSQLite_2.2.0.tar.gz'
Content type 'application/x-gzip' length 2373785 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

* installing *source* package ‘RSQLite’ ...
** package ‘RSQLite’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang++ -std=gnu++11 -I"/usr/local/Cellar/r/3.6.3_1/lib/R/include" -DNDEBUG -I. -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR -I"/usr/local/lib/R/3.6/site-library/BH/include" -I"/usr/local/lib/R/3.6/site-library/plogr/include" -I"/usr/local/lib/R/3.6/site-library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include  -fPIC  -g -O2  -c DbColumn.cpp -o DbColumn.o
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:14:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/container/stable_vector.hpp:23:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config.hpp:57:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config/platform/macos.hpp:28:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config/detail/posix_features.hpp:18:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:655:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/gethostuuid.h:39:17: error: unknown type name 'uuid_t'
int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
                ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:14:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/container/stable_vector.hpp:23:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config.hpp:57:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config/platform/macos.hpp:28:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config/detail/posix_features.hpp:18:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:662:27: error: unknown type name 'uuid_t'; did you mean 'uid_t'?
int      getsgroups_np(int *, uuid_t);
                              ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here
typedef __darwin_uid_t        uid_t;
                              ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:14:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/container/stable_vector.hpp:23:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config.hpp:57:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config/platform/macos.hpp:28:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config/detail/posix_features.hpp:18:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:664:27: error: unknown type name 'uuid_t'; did you mean 'uid_t'?
int      getwgroups_np(int *, uuid_t);
                              ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here
typedef __darwin_uid_t        uid_t;
                              ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:14:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/container/stable_vector.hpp:23:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config.hpp:57:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config/platform/macos.hpp:28:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config/detail/posix_features.hpp:18:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:727:31: error: unknown type name 'uuid_t'; did you mean 'uid_t'?
int      setsgroups_np(int, const uuid_t);
                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here
typedef __darwin_uid_t        uid_t;
                              ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:14:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/container/stable_vector.hpp:23:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config.hpp:57:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config/platform/macos.hpp:28:
In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/config/detail/posix_features.hpp:18:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:729:31: error: unknown type name 'uuid_t'; did you mean 'uid_t'?
int      setwgroups_np(int, const uuid_t);
                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here
typedef __darwin_uid_t        uid_t;
                              ^
5 errors generated.
make: *** [DbColumn.o] Error 1
ERROR: compilation failed for package ‘RSQLite’
* removing ‘/usr/local/lib/R/3.6/site-library/RSQLite’
Warning in install.packages :
  installation of package ‘RSQLite’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/l3/g7br_rgx7m965vn322wtxky00000gn/T/RtmpiE72SB/downloaded_packages

Could someone help me please?

Thanks

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers. This answer isn't coding related and the error dump tells it all.

On macOS, packages sometimes fail to install, often with a non-zero exit status message. This is due to Apple's idiosyncratic compiler. The same packages will install on most Linux systems without trouble. Saint Simon Urbanek of the R Core Development Team takes on the brain damage required to recode the source to get around macOS's peculiar worldview for those in CRAN, but he can't bestow the same mercy on those still in development.

Some packages will successfully install through compilation from source, but many won't.

When installing if you are offered the option to install from source, it makes sense to try it once. But, if at first it doesn't succeed, in all likelihood it never will. It's usually only 7-10 days until a macOS binary is available

So, the moral of the story is to try y the first time, but if you get the non-zero exit status raspberry, just say no the next time.

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