There are several potential issues here.
For one, I would stick to the Apple compilers, instead of using gcc from brew. That is not tested, and may very well fail, especially for older R versions.
Two, the CRAN binary packages were moved to a different server, so if you want to install a binary package, CRAN actually has a binary for readxl 1.3.1:
install.packages(
"readxl",
repos = "https://cran-archive.r-project.org",
type = "binary"
)
Three, I can install readxl 1.4.2 fine from source on R 3.6.3:
❯ install.packages("readxl", type = "source")
Installing package into ‘/Users/gaborcsardi/Library/R/3.6/library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/readxl_1.4.2.tar.gz'
Content type 'application/x-gzip' length 2091835 bytes (2.0 MB)
==================================================
downloaded 2.0 MB
- installing source package ‘readxl’ ...
** package ‘readxl’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c cpp11.cpp -o cpp11.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c XlsWorkBook.cpp -o XlsWorkBook.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c XlsxWorkBook.cpp -o XlsxWorkBook.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c zip.cpp -o zip.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c Read.cpp -o Read.o
clang -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c cran.c -o cran.o
clang -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c libxls/xlstool.c -o libxls/xlstool.o
clang -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c libxls/endian.c -o libxls/endian.o
clang -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c libxls/ole.c -o libxls/ole.o
clang -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c libxls/xls.c -o libxls/xls.o
clang -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/include" -DNDEBUG -Iunix -I. -I"/Users/gaborcsardi/Library/R/3.6/library/cpp11/include" -I"/Users/gaborcsardi/Library/R/3.6/library/progress/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c libxls/locale.c -o libxls/locale.o
clang++ -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Versions/3.6/Resources/lib -L/usr/local/lib -o readxl.so cpp11.o XlsWorkBook.o XlsxWorkBook.o zip.o Read.o cran.o libxls/xlstool.o libxls/endian.o libxls/ole.o libxls/xls.o libxls/locale.o -F/Library/Frameworks/R.framework/Versions/3.6 -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Users/gaborcsardi/Library/R/3.6/library/00LOCK-readxl/00new/readxl/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
- DONE (readxl)
The downloaded source packages are in
‘/private/var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpDwT8zG/downloaded_packages’
So I would try removing the custom Makevars
, unless you really need to use it for some reason.
Btw. I can also install readxl 1.3.1 from source:
install.packages(
"https://cran.r-project.org/src/contrib/Archive/readxl/readxl_1.3.1.tar.gz",
repos = NULL,
type = "source"
)
❯ clang --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin