Thanks for getting back to me.
Please note that the partially log at the bottom of my original message is from a successful compilation on a Mac where ‘install.packages(“XML”) works. It includes references to the CommandLineTools/SDK but that was completely without my doing. I tried it explicitly in various forms, though, when I thought this is the right way. Thanks for clarifying it is not.
Now, on the Mac where I still have trouble, the output from ‘install.packages(“XML”) is (rather brief):
> install.packages("XML")
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘XML’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘XML’
Content type 'application/x-gzip' length 968563 bytes (945 KB)
==================================================
downloaded 945 KB
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for sed... /usr/bin/sed
checking for pkg-config... /usr/local/bin/pkg-config
checking for xml2-config... /usr/bin/xml2-config
USE_XML2 = yes
SED_EXTENDED_ARG: -E
Minor 9, Patch 4 for 2.9.4
Located parser file -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/parser.h
Checking for 1.8: -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
Using libxml2.*
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... yes
You are trying to use a version 2.* edition of libxml
but an incompatible library. The header files and library seem to be
mismatched. If you have specified LIBXML_INCDIR, make certain to also
specify an appropriate LIBXML_LIBDIR if the libxml2 library is not in the default
directories.
ERROR: configuration failed for package ‘XML’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/XML’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/XML’
The downloaded source packages are in
‘/private/var/folders/j8/1gn6jwcx4bv8td2h83ghk1hh0000gp/T/RtmpXuYoas/downloaded_packages’
Warning message:
In install.packages("XML") :
installation of package ‘XML’ had non-zero exit status
>