Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure fails to find libxml (macOS toolchain issue?) #296

Closed
kevinushey opened this issue Apr 8, 2020 · 7 comments · Fixed by #297
Closed

configure fails to find libxml (macOS toolchain issue?) #296

kevinushey opened this issue Apr 8, 2020 · 7 comments · Fixed by #297

Comments

@kevinushey
Copy link
Contributor

When I try to install xml2 from sources, I'm seeing:

$ R CMD INSTALL --preclean .
* installing to library ‘/Users/kevinushey/Library/R/3.6/library’
* installing *source* package ‘xml2’ ...
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
Using PKG_LIBS=-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
 * deb: libxml2-dev (Debian, Ubuntu, etc)
 * rpm: libxml2-devel (Fedora, CentOS, RHEL)
 * csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘xml2’
* removing ‘/Users/kevinushey/Library/R/3.6/library/xml2’
* restoring previous ‘/Users/kevinushey/Library/R/3.6/library/xml2’

Note: the configure output above indicates that the flags are coming from pkg-config, but they're really coming from xml2-config in this case.

If I understand correctly, it seems like xml2-config is providing the wrong flags:

$ xml2-config --cflags && xml2-config --libs
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm

as the requisite xml2 includes aren't actually available in that directory.

FWIW, pkg-config (installed from Homebrew) seems to get it right:

kevinushey@Kevins-MBP:~/r/pkg/xml2 [master]
$ pkg-config libxml-2.0 --cflags && pkg-config libxml-2.0 --libs
-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/libxml2
-lxml2

Note: #232 (comment) is likely related.

@jimhester
Copy link
Member

Strange, my xml2-config gives the expected directory on Catalina.

> xml2-config --cflags && xml2-config --libs
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2
-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
> which xml2-config
/usr/bin/xml2-config
> xml2-config --version
2.9.4

@kevinushey
Copy link
Contributor Author

kevinushey commented Apr 9, 2020

Weird -- I have the same version of xml2-config too.

kevinushey@Kevins-MBP:~/r/pkg/renv [master]
$ which xml2-config
/usr/bin/xml2-config
kevinushey@Kevins-MBP:~/r/pkg/renv [master]
$ xml2-config --version
2.9.4

It looks like xml2-config is just a small shell script, so here's what mine looks like:

#! /bin/sh

prefix=$(xcrun -show-sdk-path)/usr
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib

usage()
{
    cat <<EOF
Usage: xml2-config [OPTION]

Known values for OPTION are:

  --prefix=DIR		change libxml prefix [default $prefix]
  --exec-prefix=DIR	change libxml exec prefix [default $exec_prefix]
  --libs		print library linking information
  --cflags		print pre-processor and compiler flags
  --modules		module support enabled
  --help		display this help and exit
  --version		output version information
EOF

    exit $1
}

if test $# -eq 0; then
    usage 1
fi

cflags=false
libs=false

while test $# -gt 0; do
    case "$1" in
    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    *) optarg= ;;
    esac

    case "$1" in
    --prefix=*)
	prefix=$optarg
	includedir=$prefix/include
	libdir=$prefix/lib
	;;

    --prefix)
	echo $prefix
	;;

    --exec-prefix=*)
      exec_prefix=$optarg
      libdir=$exec_prefix/lib
      ;;

    --exec-prefix)
      echo $exec_prefix
      ;;

    --version)
	echo 2.9.4
	exit 0
	;;

    --help)
	usage 0
	;;

    --cflags)
       	echo -I${includedir} 
       	;;

    --libtool-libs)
	if [ -r ${libdir}/libxml2.la ]
	then
	    echo ${libdir}/libxml2.la
	fi
        ;;

    --modules)
       	echo 1
       	;;

    --libs)
        if [ "`uname`" = "Linux" ]
	then
	    if [ "-L${libdir}" = "-L/usr/lib" -o "-L${libdir}" = "-L/usr/lib64" ]
	    then
		echo -lxml2 -L/usr/lib -lz   -lpthread   -licucore -lm  
	    else
		echo -L${libdir} -lxml2 -L/usr/lib -lz   -lpthread   -licucore -lm  
	    fi
	else
	    if [ "`uname`" = "Darwin" -a "-L${libdir}" = "-L/usr/lib" ]
	    then
		echo -lxml2 -lz   -lpthread   -licucore -lm   
	    else
		echo -L${libdir} -lxml2 -lz   -lpthread   -licucore -lm   
	    fi
	fi
       	;;

    *)
	usage
	exit 1
	;;
    esac
    shift
done

exit 0

and there's definitely no mention of libxml2 in the include paths. Does yours look correct?

@jimhester
Copy link
Member

yeah, it has

       	echo -I${includedir}/libxml2 

On line 70

I don't recall editing this file, and this is a new machine (in the last month). But perhaps I did at some point in the past and it was copied over when I did the time machine restore on it.

@jimhester
Copy link
Member

jimhester commented Apr 10, 2020

We also see this same failure for R-devel on macOS on the CI (https://github.com/r-lib/xml2/runs/574390230#step:9:22), but strangely not for the current release, which I don't really understand, as the compiler toolchain used on GitHub Actions should be the same between them.

In any case your PR should work for both cases, so it seems like the right fix I think.

I am still running macOS 10.15.3, could this be a change in 10.15.4?

@lcolladotor
Copy link

Hi,

After several tests, I found that if you have libxml2 installed from Homebrew and export only XML_CONFIG or use configure.vars when using install.packages() (as in Rscript -e "install.packages('XML', configure.vars='XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config')" ) then both XML and xml2 get installed. In particular for xml2, you then don't need #297. Though it'll be really useful once xml2 gets updated on CRAN =)

You can similarly use the official CRAN macOS xml2 from http://mac.r-project.org/libs-4/ (not on GHA due to an issue with tar). I tested this with R 4.1 on macOS-latest with the r-lib/actions GitHub Actions as well as on my macOS laptop 10.15.4 (Catalina).

You likely knew this, but well, since others are linking back to here, I thought it would be useful to share this info.

Best,
Leo

GitHub Actions

If you use r-lib/actions/ then something like this will work (modified from r-lib/usethis@9741c47):

 - name: Install macOS system dependencies
        if: matrix.config.os == 'macOS-latest' && needs.R-CMD-check-bioc.outputs.rversion == 'devel'
        run: |
          ## Enable installing XML & xml2 from source if needed
          brew install libxml2
          echo "::set-env name=XML_CONFIG::/usr/local/opt/libxml2/bin/xml2-config"

I tested this in leekgroup/derfinderPlot@df4938e and LieberInstitute/recount3@b7207b4. See the companion GHA logs.

Local, with homebrew

Locally, running brew install libxml2 ended up with:

==> libxml2
libxml2 is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have libxml2 first in your PATH run:
  echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.bash_profile

For compilers to find libxml2 you may need to set:
  export LDFLAGS="-L/usr/local/opt/libxml2/lib"
  export CPPFLAGS="-I/usr/local/opt/libxml2/include"

For pkg-config to find libxml2 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"

We can see that /usr/local/bin/xml2-config is actually a link.

$ ls -lh /usr/local/bin/xml2-config
lrwxr-xr-x 1 lcollado wheel 42 Apr 18 18:40 /usr/local/bin/xml2-config -> ../Cellar/libxml2/2.9.10_1/bin/xml2-config

XML log

$ Rscript -e "install.packages('XML', configure.vars='XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config')"
Loading required package: colorout
Warning: unable to access index for repository https://cran.rstudio.com/bin/macosx/contrib/4.1:
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/PACKAGES'
Package which is only available in source form, and may need
  compilation of C/C++/Fortran: ‘XML’
installing the source package ‘XML’

trying URL 'https://cran.rstudio.com/src/contrib/XML_3.99-0.3.tar.gz'
Content type 'application/x-gzip' length 968543 bytes (945 KB)
==================================================
downloaded 945 KB

Loading required package: colorout
* 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
User defined xml-config: /usr/local/opt/libxml2/bin/xml2-config, XML Version: 2, XML2: yes
USE_XML2 = yes
SED_EXTENDED_ARG: -E
Minor 9, Patch 10 for 2.9.10
Located parser file -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2/parser.h
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... yes
checking for xmlHashSize in -lxml2... yes
Using built-in xmlHashSize
Checking DTD parsing (presence of externalSubset)...
checking for xmlHashSize in -lxml2... yes
Found xmlHashSize
checking for xmlOutputBufferCreateBuffer in -lxml2... yes
have xmlOutputBufferCreateBuffer()
checking for xmlDocDumpFormatMemoryEnc in -lxml2... yes
checking libxml/xmlversion.h usability... yes
checking libxml/xmlversion.h presence... yes
checking for libxml/xmlversion.h... yes
Expat:  FALSE
Checking for return type of xmlHashScan element routine.
No return value for xmlHashScan
xmlNs has a context field
Checking for cetype_t enumeration
Using recent version of R with cetype_t enumeration type for encoding
checking for xmlsec1-config... no
nodegc default
xml-debug default
Version has XML_WITH_ZLIB
Version has xmlHasFeature()

****************************************
Configuration information:

Libxml settings

libxml include directory: -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2
libxml library directory: -L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm -lz  -lxml2
libxml 2:                 -DLIBXML2=1

Compilation flags:         -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1
Link flags:               -L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm -lz  -lxml2

****************************************
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/supports.R
config.status: creating inst/scripts/RSXML.csh
config.status: creating inst/scripts/RSXML.bsh
** libs
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c DocParse.c -o DocParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c EventParse.c -o EventParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c ExpatParse.c -o ExpatParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c HTMLParse.c -o HTMLParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c NodeGC.c -o NodeGC.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c RSDTD.c -o RSDTD.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c RUtils.c -o RUtils.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Rcatalog.c -o Rcatalog.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Utils.c -o Utils.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLEventParse.c -o XMLEventParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLHashTree.c -o XMLHashTree.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLTree.c -o XMLTree.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c fixNS.c -o fixNS.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c libxmlFeatures.c -o libxmlFeatures.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c schema.c -o schema.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xmlsecurity.c -o xmlsecurity.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xpath.c -o xpath.o
clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o XML.so DocParse.o EventParse.o ExpatParse.o HTMLParse.o NodeGC.o RSDTD.o RUtils.o Rcatalog.o Utils.o XMLEventParse.o XMLHashTree.o XMLTree.o fixNS.o libxmlFeatures.o schema.o xmlsecurity.o xpath.o -L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm -lz -lxml2 -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-XML/00new/XML/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Loading required package: colorout
Creating a generic function for ‘source’ from package ‘base’ in package ‘XML’
in method for ‘xmlAttrsToDataFrame’ with signature ‘"AsIs"’: no definition for class “AsIs”
in method for ‘readKeyValueDB’ with signature ‘"AsIs"’: no definition for class “AsIs”
in method for ‘readSolrDoc’ with signature ‘"AsIs"’: no definition for class “AsIs”
** help
*** installing help indices
** building package indices
Loading required package: colorout
** testing if installed package can be loaded from temporary location
Loading required package: colorout
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
Loading required package: colorout
** testing if installed package keeps a record of temporary installation path
* DONE (XML)

The downloaded source packages are in
	‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmpTg4Uh6/downloaded_packages’

xml2 log

$ Rscript -e "install.packages('xml2', configure.vars='XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config')"
Loading required package: colorout
Warning: unable to access index for repository https://cran.rstudio.com/bin/macosx/contrib/4.1:
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/PACKAGES'
Package which is only available in source form, and may need
  compilation of C/C++/Fortran: ‘xml2’
installing the source package ‘xml2’

trying URL 'https://cran.rstudio.com/src/contrib/xml2_1.3.1.tar.gz'
Content type 'application/x-gzip' length 271674 bytes (265 KB)
==================================================
downloaded 265 KB

Loading required package: colorout
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2
Using PKG_LIBS=-L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm
** libs
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c connection.cpp -o connection.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_doc.cpp -o xml2_doc.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_init.cpp -o xml2_init.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_namespace.cpp -o xml2_namespace.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_node.cpp -o xml2_node.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_output.cpp -o xml2_output.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_schema.cpp -o xml2_schema.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_url.cpp -o xml2_url.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_xpath.cpp -o xml2_xpath.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o xml2.so connection.o init.o xml2_doc.o xml2_init.o xml2_namespace.o xml2_node.o xml2_output.o xml2_schema.o xml2_url.o xml2_xpath.o -L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-xml2/00new/xml2/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Loading required package: colorout
** help
*** installing help indices
** building package indices
Loading required package: colorout
** installing vignettes
** testing if installed package can be loaded from temporary location
Loading required package: colorout
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
Loading required package: colorout
** testing if installed package keeps a record of temporary installation path
* DONE (xml2)

The downloaded source packages are in
	‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmpQhZhwU/downloaded_packages’

Local with CRAN tools

From http://mac.r-project.org/libs-4/ you can download http://mac.r-project.org/libs-4/xml2-2.9.10-darwin.17-x86_64.tar.gz.

The official instructions are:

curl -O http://mac.r-project.org/libs-4/xml2-2.9.10-darwin.17-x86_64.tar.gz
sudo tar fvxz xml2-2.9.10-darwin.17-x86_64.tar.gz -C /

Since I was testing with GHA and ran into errors with the tar step, I locally did:

cd ~/Downloads
curl -O http://mac.r-project.org/libs-4/xml2-2.9.10-darwin.17-x86_64.tar.gz
tar fxz xml2-2.9.10-darwin.17-x86_64.tar.gz .

XML log

$ Rscript -e "install.packages('XML', configure.vars='XML_CONFIG=${PWD}/usr/local/bin/xml2-config', type = 'source')"
Loading required package: colorout
trying URL 'https://cran.rstudio.com/src/contrib/XML_3.99-0.3.tar.gz'
Content type 'application/x-gzip' length 968543 bytes (945 KB)
==================================================
downloaded 945 KB

Loading required package: colorout
* 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
User defined xml-config: /Users/lcollado/Downloads/usr/local/bin/xml2-config, XML Version: 2, XML2: yes
USE_XML2 = yes
SED_EXTENDED_ARG: -E
Minor 9, Patch 10 for 2.9.10
Located parser file -I/usr/local/include/libxml2/parser.h
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... yes
checking for xmlHashSize in -lxml2... yes
Using built-in xmlHashSize
Checking DTD parsing (presence of externalSubset)...
checking for xmlHashSize in -lxml2... yes
Found xmlHashSize
checking for xmlOutputBufferCreateBuffer in -lxml2... yes
have xmlOutputBufferCreateBuffer()
checking for xmlDocDumpFormatMemoryEnc in -lxml2... yes
checking libxml/xmlversion.h usability... yes
checking libxml/xmlversion.h presence... yes
checking for libxml/xmlversion.h... yes
Expat:  FALSE
Checking for return type of xmlHashScan element routine.
No return value for xmlHashScan
xmlNs has a context field
Checking for cetype_t enumeration
Using recent version of R with cetype_t enumeration type for encoding
checking for xmlsec1-config... no
nodegc default
xml-debug default
Version has XML_WITH_ZLIB
Version has xmlHasFeature()

****************************************
Configuration information:

Libxml settings

libxml include directory: -I/usr/local/include/libxml2
libxml library directory: -L/usr/local/lib -lxml2 -lz -L/usr/local/lib -llzma -lpthread -liconv -lm -lz  -lxml2
libxml 2:                 -DLIBXML2=1

Compilation flags:         -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1
Link flags:               -L/usr/local/lib -lxml2 -lz -L/usr/local/lib -llzma -lpthread -liconv -lm -lz  -lxml2

****************************************
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/supports.R
config.status: creating inst/scripts/RSXML.csh
config.status: creating inst/scripts/RSXML.bsh
** libs
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c DocParse.c -o DocParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c EventParse.c -o EventParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c ExpatParse.c -o ExpatParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c HTMLParse.c -o HTMLParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c NodeGC.c -o NodeGC.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c RSDTD.c -o RSDTD.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c RUtils.c -o RUtils.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Rcatalog.c -o Rcatalog.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Utils.c -o Utils.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLEventParse.c -o XMLEventParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLHashTree.c -o XMLHashTree.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLTree.c -o XMLTree.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c fixNS.c -o fixNS.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c libxmlFeatures.c -o libxmlFeatures.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c schema.c -o schema.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xmlsecurity.c -o xmlsecurity.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xpath.c -o xpath.o
clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o XML.so DocParse.o EventParse.o ExpatParse.o HTMLParse.o NodeGC.o RSDTD.o RUtils.o Rcatalog.o Utils.o XMLEventParse.o XMLHashTree.o XMLTree.o fixNS.o libxmlFeatures.o schema.o xmlsecurity.o xpath.o -L/usr/local/lib -lxml2 -lz -L/usr/local/lib -llzma -lpthread -liconv -lm -lz -lxml2 -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-XML/00new/XML/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Loading required package: colorout
Creating a generic function for ‘source’ from package ‘base’ in package ‘XML’
in method for ‘xmlAttrsToDataFrame’ with signature ‘"AsIs"’: no definition for class “AsIs”
in method for ‘readKeyValueDB’ with signature ‘"AsIs"’: no definition for class “AsIs”
in method for ‘readSolrDoc’ with signature ‘"AsIs"’: no definition for class “AsIs”
** help
*** installing help indices
** building package indices
Loading required package: colorout
** testing if installed package can be loaded from temporary location
Loading required package: colorout
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
Loading required package: colorout
** testing if installed package keeps a record of temporary installation path
* DONE (XML)

The downloaded source packages are in
	‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmphYrKri/downloaded_packages’

xml2 log

$ Rscript -e "install.packages('xml2', configure.vars='XML_CONFIG=${PWD}/usr/local/bin/xml2-config', type = 'source')"
Loading required package: colorout
trying URL 'https://cran.rstudio.com/src/contrib/xml2_1.3.1.tar.gz'
Content type 'application/x-gzip' length 271674 bytes (265 KB)
==================================================
downloaded 265 KB

Loading required package: colorout
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2
Using PKG_LIBS=-L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm
** libs
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c connection.cpp -o connection.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_doc.cpp -o xml2_doc.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_init.cpp -o xml2_init.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_namespace.cpp -o xml2_namespace.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_node.cpp -o xml2_node.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_output.cpp -o xml2_output.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_schema.cpp -o xml2_schema.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_url.cpp -o xml2_url.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_xpath.cpp -o xml2_xpath.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o xml2.so connection.o init.o xml2_doc.o xml2_init.o xml2_namespace.o xml2_node.o xml2_output.o xml2_schema.o xml2_url.o xml2_xpath.o -L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-xml2/00new/xml2/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Loading required package: colorout
** help
*** installing help indices
** building package indices
Loading required package: colorout
** installing vignettes
** testing if installed package can be loaded from temporary location
Loading required package: colorout
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
Loading required package: colorout
** testing if installed package keeps a record of temporary installation path
* DONE (xml2)

The downloaded source packages are in
	‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/Rtmp6TigKX/downloaded_packages’

Local R 4.1 session info

$ R --vanilla

R Under development (unstable) (2020-04-18 r78249) -- "Unsuffered Consequences"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library('xml2')
> library('XML')
> library('sessioninfo')
> options(width = 120)
> session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R Under development (unstable) (2020-04-18 r78249)
 os       macOS Catalina 10.15.4
 system   x86_64, darwin17.0
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/New_York
 date     2020-04-19Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version  date       lib source
 assertthat    0.2.1    2019-03-21 [1] CRAN (R 4.1.0)
 cli           2.0.2    2020-02-28 [1] CRAN (R 4.1.0)
 crayon        1.3.4    2017-09-16 [1] CRAN (R 4.1.0)
 fansi         0.4.1    2020-01-08 [1] CRAN (R 4.1.0)
 glue          1.4.0    2020-04-03 [1] CRAN (R 4.1.0)
 sessioninfo * 1.1.1    2018-11-05 [1] CRAN (R 4.1.0)
 withr         2.1.2    2018-03-15 [1] CRAN (R 4.1.0)
 XML         * 3.99-0.3 2020-01-20 [1] CRAN (R 4.1.0)
 xml2        * 1.3.1    2020-04-09 [1] CRAN (R 4.1.0)

[1] /Library/Frameworks/R.framework/Versions/4.1/Resources/library

@lcolladotor
Copy link

As I re-read my above logs, it seems like the local R installation for xml2 still uses the brew files instead of the CRAN macOS tools. Oh well... 🤷🏽‍♂️

lcolladotor added a commit to leekgroup/derfinderHelper that referenced this issue Apr 19, 2020
lcolladotor added a commit to leekgroup/derfinderPlot that referenced this issue Apr 19, 2020
lcolladotor added a commit to LieberInstitute/recount3 that referenced this issue Apr 19, 2020
lcolladotor added a commit to leekgroup/regionReport that referenced this issue Apr 19, 2020
lcolladotor added a commit to leekgroup/derfinderData that referenced this issue Apr 19, 2020
lcolladotor added a commit to lcolladotor/derfinder that referenced this issue Apr 19, 2020
lcolladotor added a commit to lcolladotor/biocthis that referenced this issue May 9, 2020
Created both an introductory and a developer's notes vignette, updated README
and docs with examples, added a second biocViews term, fixed some small
bugs/typos.

Related links (as many as I could remember):

* https://rstd.io/tidytools19
* https://twitter.com/CVWickham
* https://twitter.com/hadleywickham
* https://www.rstudio.com/products/rstudio/download
* https://comunidadbioinfo.github.io/post/building-tidy-tools-cdsb-runconf-2019/#.XrbLMxNKiu4
* http://bioconductor.org/
* https://lcolladotor.github.io/pkgs/
* https://stat.ethz.ch/pipermail/bioc-devel/2020-March/016365.html
* https://www.bioconductor.org/help/docker/
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016532.html
* https://github.com/features/actions
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016650.html
* r-lib/actions#84
* r-lib/usethis#1108
* r-lib/styler#636
* Bioconductor/BiocCheck#57
* Bioconductor/bioconductor.org#54
* http://bioconductor.org/developers/how-to/coding-style/
* https://style.tidyverse.org/
* https://twitter.com/lorenzwalthert
* https://twitter.com/mt_morgan
* https://docs.travis-ci.com/user/languages/r/
* r-lib/pkgdown#1206
* r-lib/pkgdown#1230
* https://twitter.com/jimhester_
* https://www.jimhester.com/talk/2020-rsc-github-actions/
* https://github.com/Bioconductor/BBS
* https://github.com/Bioconductor/packagebuilder
* https://www.appveyor.com/
* r-hub/rhub#52
* r-hub/rhub#38
* https://www.tidyverse.org/blog/2020/04/usethis-1-6-0/
* https://github.com/r-lib/actions/tree/master/examples
* https://yihui.org/en/2018/03/second-pull-request/
* https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
* https://help.github.com/en/actions
* https://ropenscilabs.github.io/actions_sandbox/
* https://twitter.com/seandavis12
* https://github.com/seandavi/BiocActions/blob/master/.github/workflows/main.yml
* https://twitter.com/CSoneson
* https://github.com/csoneson/dreval/blob/master/.github/workflows/R-CMD-check.yaml
* https://bioc-community.herokuapp.com/
* https://github.com/leekgroup/derfinderPlot/blob/master/.github/workflows/check-bioc.yml
* https://github.com/LieberInstitute/recount3/blob/master/.github/workflows/check-bioc.yml
* https://github.com/hpages
* r-lib/actions#68
* r-lib/actions#85
* https://twitter.com/opencpu
* https://community.rstudio.com/u/const-ae
* https://community.rstudio.com/t/compiler-support-fo-c-14-features-on-windows/57284/4
* r-lib/xml2#296
* r-lib/xml2#302
* https://github.com/r-lib/usethis/blob/master/.github/workflows/R-CMD-check.yaml
* https://github.com/r-lib/usethis/commits/master/.github/workflows/R-CMD-check.yaml
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016703.html
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/thread.html
* r-lib/remotes#296
* r-lib/actions#86
* r-lib/covr#427
* https://github.com/r-lib/actions/blob/master/examples/pr-commands.yaml
* https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-18-04
* r-lib/actions#50
* actions/checkout#238
* https://github.com/rocker-org/rocker-versioned2/blob/master/dockerfiles/Dockerfile_rstudio_4.0.0-ubuntu18.04
* https://twitter.com/niteshturaga
* https://twitter.com/cboettig
* rocker-org/rocker-versioned#208
* https://github.saobby.my.eu.orgmunity/t5/GitHub-Actions/bd-p/actions
* https://www.r-consortium.org/blog/2020/03/18/cdsb-diversity-and-outreach-hotspot-in-mexico
* https://github.com/maxheld83
* r-lib/actions#87
* https://github.com/yutannihilation
@yvesmango
Copy link

Hi,

After several tests, I found that if you have libxml2 installed from Homebrew and export only XML_CONFIG or use configure.vars when using install.packages() (as in Rscript -e "install.packages('XML', configure.vars='XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config')" ) then both XML and xml2 get installed. In particular for xml2, you then don't need #297. Though it'll be really useful once xml2 gets updated on CRAN =)

You can similarly use the official CRAN macOS xml2 from http://mac.r-project.org/libs-4/ (not on GHA due to an issue with tar). I tested this with R 4.1 on macOS-latest with the r-lib/actions GitHub Actions as well as on my macOS laptop 10.15.4 (Catalina).

You likely knew this, but well, since others are linking back to here, I thought it would be useful to share this info.

Best, Leo

GitHub Actions

If you use r-lib/actions/ then something like this will work (modified from r-lib/usethis@9741c47):

 - name: Install macOS system dependencies
        if: matrix.config.os == 'macOS-latest' && needs.R-CMD-check-bioc.outputs.rversion == 'devel'
        run: |
          ## Enable installing XML & xml2 from source if needed
          brew install libxml2
          echo "::set-env name=XML_CONFIG::/usr/local/opt/libxml2/bin/xml2-config"

I tested this in leekgroup/derfinderPlot@df4938e and LieberInstitute/recount3@b7207b4. See the companion GHA logs.

Local, with homebrew

Locally, running brew install libxml2 ended up with:

==> libxml2
libxml2 is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have libxml2 first in your PATH run:
  echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.bash_profile

For compilers to find libxml2 you may need to set:
  export LDFLAGS="-L/usr/local/opt/libxml2/lib"
  export CPPFLAGS="-I/usr/local/opt/libxml2/include"

For pkg-config to find libxml2 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"

We can see that /usr/local/bin/xml2-config is actually a link.

$ ls -lh /usr/local/bin/xml2-config
lrwxr-xr-x 1 lcollado wheel 42 Apr 18 18:40 /usr/local/bin/xml2-config -> ../Cellar/libxml2/2.9.10_1/bin/xml2-config

XML log

$ Rscript -e "install.packages('XML', configure.vars='XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config')"
Loading required package: colorout
Warning: unable to access index for repository https://cran.rstudio.com/bin/macosx/contrib/4.1:
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/PACKAGES'
Package which is only available in source form, and may need
  compilation of C/C++/Fortran: ‘XML’
installing the source package ‘XML’

trying URL 'https://cran.rstudio.com/src/contrib/XML_3.99-0.3.tar.gz'
Content type 'application/x-gzip' length 968543 bytes (945 KB)
==================================================
downloaded 945 KB

Loading required package: colorout
* 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
User defined xml-config: /usr/local/opt/libxml2/bin/xml2-config, XML Version: 2, XML2: yes
USE_XML2 = yes
SED_EXTENDED_ARG: -E
Minor 9, Patch 10 for 2.9.10
Located parser file -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2/parser.h
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... yes
checking for xmlHashSize in -lxml2... yes
Using built-in xmlHashSize
Checking DTD parsing (presence of externalSubset)...
checking for xmlHashSize in -lxml2... yes
Found xmlHashSize
checking for xmlOutputBufferCreateBuffer in -lxml2... yes
have xmlOutputBufferCreateBuffer()
checking for xmlDocDumpFormatMemoryEnc in -lxml2... yes
checking libxml/xmlversion.h usability... yes
checking libxml/xmlversion.h presence... yes
checking for libxml/xmlversion.h... yes
Expat:  FALSE
Checking for return type of xmlHashScan element routine.
No return value for xmlHashScan
xmlNs has a context field
Checking for cetype_t enumeration
Using recent version of R with cetype_t enumeration type for encoding
checking for xmlsec1-config... no
nodegc default
xml-debug default
Version has XML_WITH_ZLIB
Version has xmlHasFeature()

****************************************
Configuration information:

Libxml settings

libxml include directory: -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2
libxml library directory: -L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm -lz  -lxml2
libxml 2:                 -DLIBXML2=1

Compilation flags:         -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1
Link flags:               -L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm -lz  -lxml2

****************************************
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/supports.R
config.status: creating inst/scripts/RSXML.csh
config.status: creating inst/scripts/RSXML.bsh
** libs
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c DocParse.c -o DocParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c EventParse.c -o EventParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c ExpatParse.c -o ExpatParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c HTMLParse.c -o HTMLParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c NodeGC.c -o NodeGC.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c RSDTD.c -o RSDTD.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c RUtils.c -o RUtils.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Rcatalog.c -o Rcatalog.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Utils.c -o Utils.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLEventParse.c -o XMLEventParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLHashTree.c -o XMLHashTree.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLTree.c -o XMLTree.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c fixNS.c -o fixNS.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c libxmlFeatures.c -o libxmlFeatures.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c schema.c -o schema.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xmlsecurity.c -o xmlsecurity.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xpath.c -o xpath.o
clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o XML.so DocParse.o EventParse.o ExpatParse.o HTMLParse.o NodeGC.o RSDTD.o RUtils.o Rcatalog.o Utils.o XMLEventParse.o XMLHashTree.o XMLTree.o fixNS.o libxmlFeatures.o schema.o xmlsecurity.o xpath.o -L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm -lz -lxml2 -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-XML/00new/XML/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Loading required package: colorout
Creating a generic function for ‘source’ from package ‘base’ in package ‘XML’
in method for ‘xmlAttrsToDataFrame’ with signature ‘"AsIs"’: no definition for class “AsIs”
in method for ‘readKeyValueDB’ with signature ‘"AsIs"’: no definition for class “AsIs”
in method for ‘readSolrDoc’ with signature ‘"AsIs"’: no definition for class “AsIs”
** help
*** installing help indices
** building package indices
Loading required package: colorout
** testing if installed package can be loaded from temporary location
Loading required package: colorout
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
Loading required package: colorout
** testing if installed package keeps a record of temporary installation path
* DONE (XML)

The downloaded source packages are in
	‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmpTg4Uh6/downloaded_packages’

xml2 log

$ Rscript -e "install.packages('xml2', configure.vars='XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config')"
Loading required package: colorout
Warning: unable to access index for repository https://cran.rstudio.com/bin/macosx/contrib/4.1:
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/PACKAGES'
Package which is only available in source form, and may need
  compilation of C/C++/Fortran: ‘xml2’
installing the source package ‘xml2’

trying URL 'https://cran.rstudio.com/src/contrib/xml2_1.3.1.tar.gz'
Content type 'application/x-gzip' length 271674 bytes (265 KB)
==================================================
downloaded 265 KB

Loading required package: colorout
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2
Using PKG_LIBS=-L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm
** libs
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c connection.cpp -o connection.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_doc.cpp -o xml2_doc.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_init.cpp -o xml2_init.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_namespace.cpp -o xml2_namespace.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_node.cpp -o xml2_node.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_output.cpp -o xml2_output.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_schema.cpp -o xml2_schema.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_url.cpp -o xml2_url.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_xpath.cpp -o xml2_xpath.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o xml2.so connection.o init.o xml2_doc.o xml2_init.o xml2_namespace.o xml2_node.o xml2_output.o xml2_schema.o xml2_url.o xml2_xpath.o -L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-xml2/00new/xml2/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Loading required package: colorout
** help
*** installing help indices
** building package indices
Loading required package: colorout
** installing vignettes
** testing if installed package can be loaded from temporary location
Loading required package: colorout
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
Loading required package: colorout
** testing if installed package keeps a record of temporary installation path
* DONE (xml2)

The downloaded source packages are in
	‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmpQhZhwU/downloaded_packages’

Local with CRAN tools

From http://mac.r-project.org/libs-4/ you can download http://mac.r-project.org/libs-4/xml2-2.9.10-darwin.17-x86_64.tar.gz.

The official instructions are:

curl -O http://mac.r-project.org/libs-4/xml2-2.9.10-darwin.17-x86_64.tar.gz
sudo tar fvxz xml2-2.9.10-darwin.17-x86_64.tar.gz -C /

Since I was testing with GHA and ran into errors with the tar step, I locally did:

cd ~/Downloads
curl -O http://mac.r-project.org/libs-4/xml2-2.9.10-darwin.17-x86_64.tar.gz
tar fxz xml2-2.9.10-darwin.17-x86_64.tar.gz .

XML log

$ Rscript -e "install.packages('XML', configure.vars='XML_CONFIG=${PWD}/usr/local/bin/xml2-config', type = 'source')"
Loading required package: colorout
trying URL 'https://cran.rstudio.com/src/contrib/XML_3.99-0.3.tar.gz'
Content type 'application/x-gzip' length 968543 bytes (945 KB)
==================================================
downloaded 945 KB

Loading required package: colorout
* 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
User defined xml-config: /Users/lcollado/Downloads/usr/local/bin/xml2-config, XML Version: 2, XML2: yes
USE_XML2 = yes
SED_EXTENDED_ARG: -E
Minor 9, Patch 10 for 2.9.10
Located parser file -I/usr/local/include/libxml2/parser.h
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... yes
checking for xmlHashSize in -lxml2... yes
Using built-in xmlHashSize
Checking DTD parsing (presence of externalSubset)...
checking for xmlHashSize in -lxml2... yes
Found xmlHashSize
checking for xmlOutputBufferCreateBuffer in -lxml2... yes
have xmlOutputBufferCreateBuffer()
checking for xmlDocDumpFormatMemoryEnc in -lxml2... yes
checking libxml/xmlversion.h usability... yes
checking libxml/xmlversion.h presence... yes
checking for libxml/xmlversion.h... yes
Expat:  FALSE
Checking for return type of xmlHashScan element routine.
No return value for xmlHashScan
xmlNs has a context field
Checking for cetype_t enumeration
Using recent version of R with cetype_t enumeration type for encoding
checking for xmlsec1-config... no
nodegc default
xml-debug default
Version has XML_WITH_ZLIB
Version has xmlHasFeature()

****************************************
Configuration information:

Libxml settings

libxml include directory: -I/usr/local/include/libxml2
libxml library directory: -L/usr/local/lib -lxml2 -lz -L/usr/local/lib -llzma -lpthread -liconv -lm -lz  -lxml2
libxml 2:                 -DLIBXML2=1

Compilation flags:         -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1
Link flags:               -L/usr/local/lib -lxml2 -lz -L/usr/local/lib -llzma -lpthread -liconv -lm -lz  -lxml2

****************************************
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/supports.R
config.status: creating inst/scripts/RSXML.csh
config.status: creating inst/scripts/RSXML.bsh
** libs
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c DocParse.c -o DocParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c EventParse.c -o EventParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c ExpatParse.c -o ExpatParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c HTMLParse.c -o HTMLParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c NodeGC.c -o NodeGC.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c RSDTD.c -o RSDTD.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c RUtils.c -o RUtils.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Rcatalog.c -o Rcatalog.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Utils.c -o Utils.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLEventParse.c -o XMLEventParse.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLHashTree.c -o XMLHashTree.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c XMLTree.c -o XMLTree.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c fixNS.c -o fixNS.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c libxmlFeatures.c -o libxmlFeatures.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c schema.c -o schema.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xmlsecurity.c -o xmlsecurity.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DLIBXML -I/usr/local/include/libxml2 -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DDUMP_WITH_ENCODING=1 -DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1 -DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1  -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1  -I. -DLIBXML2=1  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xpath.c -o xpath.o
clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o XML.so DocParse.o EventParse.o ExpatParse.o HTMLParse.o NodeGC.o RSDTD.o RUtils.o Rcatalog.o Utils.o XMLEventParse.o XMLHashTree.o XMLTree.o fixNS.o libxmlFeatures.o schema.o xmlsecurity.o xpath.o -L/usr/local/lib -lxml2 -lz -L/usr/local/lib -llzma -lpthread -liconv -lm -lz -lxml2 -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-XML/00new/XML/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Loading required package: colorout
Creating a generic function for ‘source’ from package ‘base’ in package ‘XML’
in method for ‘xmlAttrsToDataFrame’ with signature ‘"AsIs"’: no definition for class “AsIs”
in method for ‘readKeyValueDB’ with signature ‘"AsIs"’: no definition for class “AsIs”
in method for ‘readSolrDoc’ with signature ‘"AsIs"’: no definition for class “AsIs”
** help
*** installing help indices
** building package indices
Loading required package: colorout
** testing if installed package can be loaded from temporary location
Loading required package: colorout
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
Loading required package: colorout
** testing if installed package keeps a record of temporary installation path
* DONE (XML)

The downloaded source packages are in
	‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmphYrKri/downloaded_packages’

xml2 log

$ Rscript -e "install.packages('xml2', configure.vars='XML_CONFIG=${PWD}/usr/local/bin/xml2-config', type = 'source')"
Loading required package: colorout
trying URL 'https://cran.rstudio.com/src/contrib/xml2_1.3.1.tar.gz'
Content type 'application/x-gzip' length 271674 bytes (265 KB)
==================================================
downloaded 265 KB

Loading required package: colorout
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2
Using PKG_LIBS=-L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm
** libs
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c connection.cpp -o connection.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_doc.cpp -o xml2_doc.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_init.cpp -o xml2_init.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_namespace.cpp -o xml2_namespace.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_node.cpp -o xml2_node.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_output.cpp -o xml2_output.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_schema.cpp -o xml2_schema.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_url.cpp -o xml2_url.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -DUCHAR_TYPE=wchar_t  -I/usr/local/include   -fPIC  -Wall -g -O2  -c xml2_xpath.cpp -o xml2_xpath.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o xml2.so connection.o init.o xml2_doc.o xml2_init.o xml2_namespace.o xml2_node.o xml2_output.o xml2_schema.o xml2_url.o xml2_xpath.o -L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-xml2/00new/xml2/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Loading required package: colorout
** help
*** installing help indices
** building package indices
Loading required package: colorout
** installing vignettes
** testing if installed package can be loaded from temporary location
Loading required package: colorout
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
Loading required package: colorout
** testing if installed package keeps a record of temporary installation path
* DONE (xml2)

The downloaded source packages are in
	‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/Rtmp6TigKX/downloaded_packages’

Local R 4.1 session info

$ R --vanilla

R Under development (unstable) (2020-04-18 r78249) -- "Unsuffered Consequences"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library('xml2')
> library('XML')
> library('sessioninfo')
> options(width = 120)
> session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R Under development (unstable) (2020-04-18 r78249)
 os       macOS Catalina 10.15.4
 system   x86_64, darwin17.0
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/New_York
 date     2020-04-19Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version  date       lib source
 assertthat    0.2.1    2019-03-21 [1] CRAN (R 4.1.0)
 cli           2.0.2    2020-02-28 [1] CRAN (R 4.1.0)
 crayon        1.3.4    2017-09-16 [1] CRAN (R 4.1.0)
 fansi         0.4.1    2020-01-08 [1] CRAN (R 4.1.0)
 glue          1.4.0    2020-04-03 [1] CRAN (R 4.1.0)
 sessioninfo * 1.1.1    2018-11-05 [1] CRAN (R 4.1.0)
 withr         2.1.2    2018-03-15 [1] CRAN (R 4.1.0)
 XML         * 3.99-0.3 2020-01-20 [1] CRAN (R 4.1.0)
 xml2        * 1.3.1    2020-04-09 [1] CRAN (R 4.1.0)

[1] /Library/Frameworks/R.framework/Versions/4.1/Resources/library

yeah i realized this is already closed... but i was wondering if you could help me troubleshoot my similar problem? when i try the section on Loading CRAN tools, I get unsupported file format in my terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants