tidyverse/readxl

Installation fails

Closed this issue · 2 comments

ramay commented

Hi,
I am trying to install readxl from github

devtools::install_github("hadley/readxl")

This is the error I get:


Downloading GitHub repo hadley/readxl@master
✔  checking for file ‘/private/var/folders/jn/zp890ymn4vn6wb76rf0hpz7c0000gn/T/Rtmpzgy9Z0/remotesf1137e51a17f/tidyverse-readxl-4572ade/DESCRIPTION’ ...
─  preparing ‘readxl’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘readxl_1.3.1.9000.tar.gz’
   
* installing *source* package ‘readxl’ ...
** libs
g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Iunix -I. -DRCPP_DEFAULT_INCLUDE_CALL=false -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -mtune=native -g -O2 -Wall -pedantic -Wconversion -c RcppExports.cpp -o RcppExports.o
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat.h:40,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/RcppCommon.h:70,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp.h:27,
                 from RcppExports.cpp:4:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h:928:21: warning: conversion from 'long unsigned int' to 'int' may change value [-Wconversion]
 detail::FormatListN<sizeof...(Args)> makeFormatList(const Args&... args)
                     ^~~~~~~~~~~~~~~
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h: In function 'tinyformat::detail::FormatListN<sizeof... (Args)> tinyformat::makeFormatList(const Args& ...)':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h:930:32: warning: conversion from 'long unsigned int' to 'int' may change value [-Wconversion]
     return detail::FormatListN<sizeof...(args)>(args...);
                                ^~~~~~~~~~~~~~~
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/Vector.h:69,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp.h:40,
                 from RcppExports.cpp:4:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/String.h: In member function 'SEXPREC* Rcpp::String::get_sexp_impl() const':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/String.h:376:62: warning: conversion from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
             return Rf_mkCharLenCE(buffer.c_str(), buffer.size(), enc);
                                                   ~~~~~~~~~~~^~
g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Iunix -I. -DRCPP_DEFAULT_INCLUDE_CALL=false -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -mtune=native -g -O2 -Wall -pedantic -Wconversion -c XlsWorkBook.cpp -o XlsWorkBook.o
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat.h:40,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/RcppCommon.h:70,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp.h:27,
                 from XlsWorkBook.cpp:1:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h:928:21: warning: conversion from 'long unsigned int' to 'int' may change value [-Wconversion]
 detail::FormatListN<sizeof...(Args)> makeFormatList(const Args&... args)
                     ^~~~~~~~~~~~~~~
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h: In function 'tinyformat::detail::FormatListN<sizeof... (Args)> tinyformat::makeFormatList(const Args& ...)':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h:930:32: warning: conversion from 'long unsigned int' to 'int' may change value [-Wconversion]
     return detail::FormatListN<sizeof...(args)>(args...);
                                ^~~~~~~~~~~~~~~
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/Vector.h:69,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp.h:40,
                 from XlsWorkBook.cpp:1:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/String.h: In member function 'SEXPREC* Rcpp::String::get_sexp_impl() const':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/String.h:376:62: warning: conversion from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
             return Rf_mkCharLenCE(buffer.c_str(), buffer.size(), enc);
                                                   ~~~~~~~~~~~^~
In file included from XlsWorkBook.h:6,
                 from XlsWorkBook.cpp:3:
ColSpec.h: In function 'Rcpp::List removeSkippedColumns(Rcpp::List, Rcpp::CharacterVector, std::vector<ColType>)':
ColSpec.h:258:20: warning: conversion from 'R_xlen_t' {aka 'long int'} to 'int' may change value [-Wconversion]
   int p = cols.size();
           ~~~~~~~~~^~
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/Vector.h:52,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp.h:40,
                 from XlsWorkBook.cpp:1:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h: In instantiation of 'Rcpp::Vector<RTYPE, StoragePolicy>::const_iterator Rcpp::Vector<RTYPE, StoragePolicy>::end() const [with int RTYPE = 16; StoragePolicy = Rcpp::PreserveStorage; Rcpp::Vector<RTYPE, StoragePolicy>::const_iterator = Rcpp::internal::Proxy_Iterator<Rcpp::internal::const_string_proxy<16> >]':
StringSet.h:20:74:   required from here
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h:335:65: warning: conversion from 'R_xlen_t' {aka 'long int'} to 'Rcpp::internal::Proxy_Iterator<Rcpp::internal::const_string_proxy<16> >::difference_type' {aka 'int'} may change value [-Wconversion]
     inline const_iterator end() const{ return cache.get_const() + size() ; }
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h: In instantiation of 'Rcpp::Vector<RTYPE, StoragePolicy>::iterator Rcpp::Vector<RTYPE, StoragePolicy>::end() [with int RTYPE = 16; StoragePolicy = Rcpp::PreserveStorage; Rcpp::Vector<RTYPE, StoragePolicy>::iterator = Rcpp::internal::Proxy_Iterator<Rcpp::internal::string_proxy<16> >]':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h:1115:18:   required from 'void Rcpp::Vector<RTYPE, StoragePolicy>::fill__dispatch(Rcpp::traits::true_type, const U&) [with U = SEXPREC*; int RTYPE = 16; StoragePolicy = Rcpp::PreserveStorage; Rcpp::traits::true_type = Rcpp::traits::integral_constant<bool, true>]'
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h:329:9:   required from 'void Rcpp::Vector<RTYPE, StoragePolicy>::fill(const U&) [with U = SEXPREC*; int RTYPE = 16; StoragePolicy = Rcpp::PreserveStorage]'
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h:97:9:   required from 'Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const int&, const stored_type&) [with int RTYPE = 16; StoragePolicy = Rcpp::PreserveStorage; Rcpp::Vector<RTYPE, StoragePolicy>::stored_type = SEXPREC*]'
ColSpec.h:247:46:   required from here
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h:333:48: warning: conversion from 'R_xlen_t' {aka 'long int'} to 'Rcpp::internal::Proxy_Iterator<Rcpp::internal::string_proxy<16> >::difference_type' {aka 'int'} may change value [-Wconversion]
     inline iterator end() { return cache.get() + size() ; }
g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Iunix -I. -DRCPP_DEFAULT_INCLUDE_CALL=false -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -mtune=native -g -O2 -Wall -pedantic -Wconversion -c XlsWorkSheet.cpp -o XlsWorkSheet.o
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat.h:40,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/RcppCommon.h:70,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp.h:27,
                 from XlsWorkSheet.cpp:1:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h:928:21: warning: conversion from 'long unsigned int' to 'int' may change value [-Wconversion]
 detail::FormatListN<sizeof...(Args)> makeFormatList(const Args&... args)
                     ^~~~~~~~~~~~~~~
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h: In function 'tinyformat::detail::FormatListN<sizeof... (Args)> tinyformat::makeFormatList(const Args& ...)':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h:930:32: warning: conversion from 'long unsigned int' to 'int' may change value [-Wconversion]
     return detail::FormatListN<sizeof...(args)>(args...);
                                ^~~~~~~~~~~~~~~
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/Vector.h:69,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp.h:40,
                 from XlsWorkSheet.cpp:1:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/String.h: In member function 'SEXPREC* Rcpp::String::get_sexp_impl() const':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/String.h:376:62: warning: conversion from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
             return Rf_mkCharLenCE(buffer.c_str(), buffer.size(), enc);
                                                   ~~~~~~~~~~~^~
In file included from XlsWorkSheet.cpp:2:
ColSpec.h: In function 'Rcpp::List removeSkippedColumns(Rcpp::List, Rcpp::CharacterVector, std::vector<ColType>)':
ColSpec.h:258:20: warning: conversion from 'R_xlen_t' {aka 'long int'} to 'int' may change value [-Wconversion]
   int p = cols.size();
           ~~~~~~~~~^~
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:72,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:6,
                 from Spinner.h:4,
                 from XlsWorkSheet.h:7,
                 from XlsWorkSheet.cpp:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/unistd.h: At global scope:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/unistd.h:208:40: error: 'gid_t' has not been declared
 int fchownat(int, const char *, uid_t, gid_t, int) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
                                        ^~~~~
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:6,
                 from Spinner.h:4,
                 from XlsWorkSheet.h:7,
                 from XlsWorkSheet.cpp:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:434:33: error: 'gid_t' has not been declared
 int  chown(const char *, uid_t, gid_t);
                                 ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:449:1: error: 'gid_t' does not name a type; did you mean 'uid_t'?
 gid_t  getegid(void);
 ^~~~~
 uid_t
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:451:1: error: 'gid_t' does not name a type; did you mean 'uid_t'?
 gid_t  getgid(void);
 ^~~~~
 uid_t
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:455:21: error: 'gid_t' has not been declared
 int  getgroups(int, gid_t []);
                     ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:474:13: error: 'gid_t' was not declared in this scope
 int  setgid(gid_t);
             ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:474:13: note: suggested alternative:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:109,
                 from ./libxls/xlstypes.h:40,
                 from ./libxls/xls.h:42,
                 from ColSpec.h:5,
                 from XlsWorkSheet.cpp:2:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h:31:24: note:   'xls::gid_t'
 typedef __darwin_gid_t gid_t;
                        ^~~~~
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:6,
                 from Spinner.h:4,
                 from XlsWorkSheet.h:7,
                 from XlsWorkSheet.cpp:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:570:34: error: 'gid_t' has not been declared
 int  lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown);
                                  ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:596:15: error: 'gid_t' was not declared in this scope
 int  setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid);
               ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:596:15: note: suggested alternative:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:109,
                 from ./libxls/xlstypes.h:40,
                 from ./libxls/xls.h:42,
                 from ColSpec.h:5,
                 from XlsWorkSheet.cpp:2:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h:31:24: note:   'xls::gid_t'
 typedef __darwin_gid_t gid_t;
                        ^~~~~
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:6,
                 from Spinner.h:4,
                 from XlsWorkSheet.h:7,
                 from XlsWorkSheet.cpp:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:596:22: error: 'gid_t' was not declared in this scope
 int  setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid);
                      ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:596:22: note: suggested alternative:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:109,
                 from ./libxls/xlstypes.h:40,
                 from ./libxls/xls.h:42,
                 from ColSpec.h:5,
                 from XlsWorkSheet.cpp:2:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h:31:24: note:   'xls::gid_t'
 typedef __darwin_gid_t gid_t;
                        ^~~~~
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:6,
                 from Spinner.h:4,
                 from XlsWorkSheet.h:7,
                 from XlsWorkSheet.cpp:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:596:27: error: expression list treated as compound expression in initializer [-fpermissive]
 int  setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid);
                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:603:1: error: 'useconds_t' does not name a type; did you mean 'user_off_t'?
 useconds_t  ualarm(useconds_t, useconds_t);
 ^~~~~~~~~~
 user_off_t
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:604:13: error: 'useconds_t' was not declared in this scope
 int  usleep(useconds_t) __DARWIN_ALIAS_C(usleep);
             ^~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:604:13: note: suggested alternative:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:167,
                 from ./libxls/xlstypes.h:40,
                 from ./libxls/xls.h:42,
                 from ColSpec.h:5,
                 from XlsWorkSheet.cpp:2:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h:31:29: note:   'xls::useconds_t'
 typedef __darwin_useconds_t useconds_t;
                             ^~~~~~~~~~
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:6,
                 from Spinner.h:4,
                 from XlsWorkSheet.h:7,
                 from XlsWorkSheet.cpp:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:624:25: error: 'gid_t' has not been declared
 int  fchown(int, uid_t, gid_t);
                         ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:627:14: error: 'gid_t' was not declared in this scope
 int  setegid(gid_t);
              ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:627:14: note: suggested alternative:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:109,
                 from ./libxls/xlstypes.h:40,
                 from ./libxls/xls.h:42,
                 from ColSpec.h:5,
                 from XlsWorkSheet.cpp:2:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h:31:24: note:   'xls::gid_t'
 typedef __darwin_gid_t gid_t;
                        ^~~~~
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:638,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:6,
                 from Spinner.h:4,
                 from XlsWorkSheet.h:7,
                 from XlsWorkSheet.cpp:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/select.h:114:19: error: 'fd_set' has not been declared
 int  pselect(int, fd_set * __restrict, fd_set * __restrict,
                   ^~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/select.h:114:40: error: 'fd_set' has not been declared
 int  pselect(int, fd_set * __restrict, fd_set * __restrict,
                                        ^~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/select.h:115:3: error: 'fd_set' has not been declared
   fd_set * __restrict, const struct timespec * __restrict,
   ^~~~~~
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/select.h:129,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:638,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:6,
                 from Spinner.h:4,
                 from XlsWorkSheet.h:7,
                 from XlsWorkSheet.cpp:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_select.h:39:18: error: 'fd_set' has not been declared
 int  select(int, fd_set * __restrict, fd_set * __restrict,
                  ^~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_select.h:39:39: error: 'fd_set' has not been declared
 int  select(int, fd_set * __restrict, fd_set * __restrict,
                                       ^~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_select.h:40:3: error: 'fd_set' has not been declared
   fd_set * __restrict, struct timeval * __restrict)
   ^~~~~~
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:6,
                 from Spinner.h:4,
                 from XlsWorkSheet.h:7,
                 from XlsWorkSheet.cpp:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:664:31: error: 'gid_t' has not been declared
 int  getpeereid(int, uid_t *, gid_t *);
                               ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:702:32: error: 'gid_t' has not been declared
 int  pthread_setugid_np(uid_t, gid_t);
                                ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:703:35: error: 'gid_t' has not been declared
 int  pthread_getugid_np( uid_t *, gid_t *);
                                   ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:718:27: error: 'gid_t' does not name a type; did you mean 'uid_t'?
 int  setgroups(int, const gid_t *);
                           ^~~~~
                           uid_t
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:728:14: error: 'gid_t' was not declared in this scope
 int  setrgid(gid_t);
              ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:728:14: note: suggested alternative:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:109,
                 from ./libxls/xlstypes.h:40,
                 from ./libxls/xls.h:42,
                 from ColSpec.h:5,
                 from XlsWorkSheet.cpp:2:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h:31:24: note:   'xls::gid_t'
 typedef __darwin_gid_t gid_t;
                        ^~~~~
In file included from Spinner.h:4,
                 from XlsWorkSheet.h:7,
                 from XlsWorkSheet.cpp:3:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h: In member function 'void RProgress::RProgress::render()':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:176:45: warning: conversion from 'long int' to 'double' may change value [-Wconversion]
     double complete_len = round(bar_width * ratio_now);
                                             ^~~~~~~~~
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h: In static member function 'static double RProgress::RProgress::time_now()':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:313:16: warning: conversion from '__darwin_time_t' {aka 'long int'} to 'double' may change value [-Wconversion]
     return now.tv_sec + now.tv_usec / 1000000.0;
            ~~~~^~~~~~
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h: In static member function 'static std::__cxx11::string RProgress::RProgress::pretty_bytes(long int)':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:365:16: warning: conversion from 'long int' to 'double' may change value [-Wconversion]
     if (idx >= num_units) { idx = num_units - 1; }
                ^~~~~~~~~
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:365:45: warning: conversion from 'long int' to 'double' may change value [-Wconversion]
     if (idx >= num_units) { idx = num_units - 1; }
                                   ~~~~~~~~~~^~~
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include/RProgress.h:367:52: warning: conversion from 'long int' to 'double' may change value [-Wconversion]
     double res = round(bytes / std::pow(1000.0, idx) * 100.0) / 100.0;
                                                    ^
In file included from XlsWorkSheet.cpp:3:
XlsWorkSheet.h: In member function 'Rcpp::List XlsWorkSheet::readCols(Rcpp::CharacterVector, const std::vector<ColType>&, const StringSet&, bool, bool)':
XlsWorkSheet.h:197:38: warning: choosing 'Rcpp::internal::generic_proxy<RTYPE, StoragePolicy>::operator U() const [with U = Rcpp::RObject_Impl<Rcpp::PreserveStorage>; int RTYPE = 19; StoragePolicy = Rcpp::PreserveStorage]' over 'Rcpp::RObject_Impl<StoragePolicy>::RObject_Impl(const Rcpp::GenericProxy<Proxy>&) [with Proxy = Rcpp::internal::generic_proxy<19>; StoragePolicy = Rcpp::PreserveStorage]' [-Wconversion]
       Rcpp::RObject column = cols[col];
                                      ^
XlsWorkSheet.h:197:38: warning:   for conversion from 'Rcpp::Vector<19>::Proxy' {aka 'Rcpp::internal::generic_proxy<19>'} to 'Rcpp::RObject' {aka 'Rcpp::RObject_Impl<Rcpp::PreserveStorage>'} [-Wconversion]
XlsWorkSheet.h:197:38: note:   because conversion sequence for the argument is better
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/Vector.h:52,
                 from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp.h:40,
                 from XlsWorkSheet.cpp:1:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h: In instantiation of 'Rcpp::Vector<RTYPE, StoragePolicy>::const_iterator Rcpp::Vector<RTYPE, StoragePolicy>::end() const [with int RTYPE = 16; StoragePolicy = Rcpp::PreserveStorage; Rcpp::Vector<RTYPE, StoragePolicy>::const_iterator = Rcpp::internal::Proxy_Iterator<Rcpp::internal::const_string_proxy<16> >]':
StringSet.h:20:74:   required from here
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h:335:65: warning: conversion from 'R_xlen_t' {aka 'long int'} to 'Rcpp::internal::Proxy_Iterator<Rcpp::internal::const_string_proxy<16> >::difference_type' {aka 'int'} may change value [-Wconversion]
     inline const_iterator end() const{ return cache.get_const() + size() ; }
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h: In instantiation of 'Rcpp::Vector<RTYPE, StoragePolicy>::iterator Rcpp::Vector<RTYPE, StoragePolicy>::end() [with int RTYPE = 16; StoragePolicy = Rcpp::PreserveStorage; Rcpp::Vector<RTYPE, StoragePolicy>::iterator = Rcpp::internal::Proxy_Iterator<Rcpp::internal::string_proxy<16> >]':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h:1115:18:   required from 'void Rcpp::Vector<RTYPE, StoragePolicy>::fill__dispatch(Rcpp::traits::true_type, const U&) [with U = SEXPREC*; int RTYPE = 16; StoragePolicy = Rcpp::PreserveStorage; Rcpp::traits::true_type = Rcpp::traits::integral_constant<bool, true>]'
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h:329:9:   required from 'void Rcpp::Vector<RTYPE, StoragePolicy>::fill(const U&) [with U = SEXPREC*; int RTYPE = 16; StoragePolicy = Rcpp::PreserveStorage]'
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h:97:9:   required from 'Rcpp::Vector<RTYPE, StoragePolicy>::Vector(const int&, const stored_type&) [with int RTYPE = 16; StoragePolicy = Rcpp::PreserveStorage; Rcpp::Vector<RTYPE, StoragePolicy>::stored_type = SEXPREC*]'
ColSpec.h:247:46:   required from here
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/vector/Vector.h:333:48: warning: conversion from 'R_xlen_t' {aka 'long int'} to 'Rcpp::internal::Proxy_Iterator<Rcpp::internal::string_proxy<16> >::difference_type' {aka 'int'} may change value [-Wconversion]
     inline iterator end() { return cache.get() + size() ; }
make: *** [XlsWorkSheet.o] Error 1
ERROR: compilation failed for package ‘readxl’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/readxl’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/readxl’
Error in i.p(...) : 
  (converted from warning) installation of package ‘/var/folders/jn/zp890ymn4vn6wb76rf0hpz7c0000gn/T//Rtmpzgy9Z0/filef1133bb11b73/readxl_1.3.1.9000.tar.gz’ had non-zero exit status

Please guide on how to fix this. I have installed the latest version of Rcpp from github.

I can build it successfully right now on macOS. FWIW I am using clang++ from Xcode command line tools.

Can you build the current CRAN version from source? With Rcpp from CRAN? That would be a good test to see if there is some problem with your dev setup. Are you successfully building other R packages w/ both C and C++ in them from source?

ramay commented

Thanks @jennybc for you reply. My problem was in .R/Makevars files where the right compilers were not being used. I updated it to
F77 = /usr/local/bin/gfortran
FC = $F77
CXX = /usr/local/opt/llvm/bin/clang++ -Wall
LDFLAGS=-L/usr/local/opt/llvm/lib/clang/7.0.1/lib/
CC= /usr/local/opt/llvm/bin/clang
SHLIB_CXXLD=/usr/local/opt/llvm/bin/clang++
CXX11 = /usr/local/opt/llvm/bin/clang++
CXX98 = /usr/local/opt/llvm/bin/clang++
CXX14 = /usr/local/opt/llvm/bin/clang++

Also for Mojave, I had to install header files. RcppCore/Rcpp#922

The package has been installed now!