That error
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/unistd.h:667:27: error: unknown type name 'uuid_t'; did you mean 'uid_t'?
int getwgroups_np(int *, uuid_t)
is almost certainly due to the problem with osMAC's compiler and environment.
Here's what it looks like on sf, which I can't install from source, but can from binary.
There is a binary version available but the source version is later:
binary source needs_compilation
sf 0.8-1 0.9-1 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel)
When I respond yes, I get a long list of compilation steps ending in
ERROR: configuration failed for package ‘sf’
But when I choose no
There is a binary version available but the source version is later:
binary source needs_compilation
sf 0.8-1 0.9-1 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) no
trying URL 'https://ftp.osuosl.org/pub/cran/bin/macosx/el-capitan/contrib/3.6/sf_0.8-1.tgz'
Content type 'application/x-gzip' length 64283240 bytes (61.3 MB)
==================================================
downloaded 61.3 MB
The downloaded binary packages are in
/var/folders/vw/p54wdfm95lq9wf8jkwxg_qpw0000gp/T//RtmpS0cOMY/downloaded_packages
> library(sf)
Linking to GEOS 3.7.2, GDAL 2.4.2, PROJ 5.2.0
>
bliss ensues.
Are you certain you can't install from binary?