Error trying to install Seurat Package on MacOS

Trying to install package 'Seurat' and getting errors based on packages and a compilation error:
5 errors generated.
make: *** [annoy.o] Error 1
ERROR: compilation failed for package ‘RcppAnnoy’

  • removing ‘/usr/local/lib/R/3.6/site-library/RcppAnnoy’
    Warning in install.packages :
    installation of package ‘RcppAnnoy’ had non-zero exit status
    ERROR: dependencies ‘RcppAnnoy’, ‘dqrng’ are not available for package ‘uwot’
  • removing ‘/usr/local/lib/R/3.6/site-library/uwot’
    Warning in install.packages :
    installation of package ‘uwot’ had non-zero exit status
    ERROR: dependencies ‘RcppAnnoy’, ‘uwot’ are not available for package ‘Seurat’
  • removing ‘/usr/local/lib/R/3.6/site-library/Seurat’
    Warning in install.packages :
    installation of package ‘Seurat’ had non-zero exit status

I have tried to install these packages separately, but they keep getting compilation errors. What's happening? Thanks. Googling this error is not helping.

Full code and output:

install.packages('Seurat')
Installing package into ‘/usr/local/lib/R/3.6/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘dqrng’, ‘RcppAnnoy’, ‘uwot’

trying URL 'https://cran.rstudio.com/src/contrib/dqrng_0.2.1.tar.gz'
Content type 'application/x-gzip' length 73541 bytes (71 KB)

downloaded 71 KB

trying URL 'https://cran.rstudio.com/src/contrib/RcppAnnoy_0.0.16.tar.gz'
Content type 'application/x-gzip' length 441533 bytes (431 KB)

downloaded 431 KB

trying URL 'https://cran.rstudio.com/src/contrib/uwot_0.1.8.tar.gz'
Content type 'application/x-gzip' length 90032 bytes (87 KB)

downloaded 87 KB

trying URL 'https://cran.rstudio.com/src/contrib/Seurat_3.1.4.tar.gz'
Content type 'application/x-gzip' length 801121 bytes (782 KB)

downloaded 782 KB

  • installing source package ‘dqrng’ ...
    ** package ‘dqrng’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    clang++ -std=gnu++11 -I"/usr/local/Cellar/r/3.6.2/lib/R/include" -DNDEBUG -I../inst/include -DSTRICT_R_HEADERS -I"/usr/local/lib/R/3.6/site-library/Rcpp/include" -I"/usr/local/lib/R/3.6/site-library/BH/include" -I"/usr/local/lib/R/3.6/site-library/sitmo/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include -fPIC -g -O2 -c RcppExports.cpp -o RcppExports.o
    clang++ -std=gnu++11 -I"/usr/local/Cellar/r/3.6.2/lib/R/include" -DNDEBUG -I../inst/include -DSTRICT_R_HEADERS -I"/usr/local/lib/R/3.6/site-library/Rcpp/include" -I"/usr/local/lib/R/3.6/site-library/BH/include" -I"/usr/local/lib/R/3.6/site-library/sitmo/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include -fPIC -g -O2 -c dqrng.cpp -o dqrng.o
    In file included from dqrng.cpp:21:
    In file included from ../inst/include/dqrng_distribution.h:23:
    In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/random/uniform_real_distribution.hpp:22:
    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:658:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/gethostuuid.h:39:17: error: C++ requires a type specifier for all declarations
    int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
    ^
    In file included from dqrng.cpp:21:
    In file included from ../inst/include/dqrng_distribution.h:23:
    In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/random/uniform_real_distribution.hpp:22:
    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:665: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 dqrng.cpp:21:
    In file included from ../inst/include/dqrng_distribution.h:23:
    In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/random/uniform_real_distribution.hpp:22:
    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:667: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 dqrng.cpp:21:
    In file included from ../inst/include/dqrng_distribution.h:23:
    In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/random/uniform_real_distribution.hpp:22:
    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:730: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 dqrng.cpp:21:
    In file included from ../inst/include/dqrng_distribution.h:23:
    In file included from /usr/local/lib/R/3.6/site-library/BH/include/boost/random/uniform_real_distribution.hpp:22:
    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:732: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: *** [dqrng.o] Error 1
    ERROR: compilation failed for package ‘dqrng’
  • removing ‘/usr/local/lib/R/3.6/site-library/dqrng’
    Warning in install.packages :
    installation of package ‘dqrng’ had non-zero exit status
  • installing source package ‘RcppAnnoy’ ...
    ** package ‘RcppAnnoy’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    clang++ -std=gnu++11 -I"/usr/local/Cellar/r/3.6.2/lib/R/include" -DNDEBUG -I../inst/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 RcppExports.cpp -o RcppExports.o
    clang++ -std=gnu++11 -I"/usr/local/Cellar/r/3.6.2/lib/R/include" -DNDEBUG -I../inst/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 annoy.cpp -o annoy.o
    In file included from annoy.cpp:39:
    In file included from ../inst/include/annoylib.h:22:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:658:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/gethostuuid.h:39:17: error: C++ requires a type specifier for all declarations
    int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
    ^
    In file included from annoy.cpp:39:
    In file included from ../inst/include/annoylib.h:22:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:665: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 annoy.cpp:39:
    In file included from ../inst/include/annoylib.h:22:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:667: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 annoy.cpp:39:
    In file included from ../inst/include/annoylib.h:22:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:730: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 annoy.cpp:39:
    In file included from ../inst/include/annoylib.h:22:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:732: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: *** [annoy.o] Error 1
    ERROR: compilation failed for package ‘RcppAnnoy’
  • removing ‘/usr/local/lib/R/3.6/site-library/RcppAnnoy’
    Warning in install.packages :
    installation of package ‘RcppAnnoy’ had non-zero exit status
    ERROR: dependencies ‘RcppAnnoy’, ‘dqrng’ are not available for package ‘uwot’
  • removing ‘/usr/local/lib/R/3.6/site-library/uwot’
    Warning in install.packages :
    installation of package ‘uwot’ had non-zero exit status
    ERROR: dependencies ‘RcppAnnoy’, ‘uwot’ are not available for package ‘Seurat’
  • removing ‘/usr/local/lib/R/3.6/site-library/Seurat’
    Warning in install.packages :
    installation of package ‘Seurat’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/_m/g6gbjyxx1xn94186vvmvkb_r0000gp/T/Rtmpr9zUFo/downloaded_packages’

Today's been a double whammy for MAC OS users. There have been problems with the central CRAN repository with OSx binaries, and those problems have been propagated to many mirrors.

The other is continuing. Apple OS has a non-standard compiler. Some packages will compile successfully, many will not. If you are offered "Would you like to install from source?" by all means take it. But only once. If it doesn't work the first time it almost to a certainty won't work a second.

I don't believe I have been given that option, so that will not fix my error at the moment. I have seen that option before but not with this problem. Thanks for the reply.

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