Skip to content

Instantly share code, notes, and snippets.

@remlapmot
Last active December 7, 2022 13:17
Show Gist options
  • Save remlapmot/a4a39f691bd38afac217262d9dac6dd8 to your computer and use it in GitHub Desktop.
Save remlapmot/a4a39f691bd38afac217262d9dac6dd8 to your computer and use it in GitHub Desktop.
Install XML package from source on Windows 10 assuming Rtool40 installed
# In Rtools 4.0 run
# pacman -Syu
# pacman -S mingw-w64-{i686,x86_64}-libxml2
Sys.setenv(LOCAL_CPPFLAGS = "-I/mingw$(WIN)/include/libxml2")
Sys.setenv(LIB_XML = "$(MINGW_PREFIX)")
install.packages("XML")
@remlapmot
Copy link
Author

remlapmot commented Dec 7, 2022

On an Apple Silicon Mac this is

In a shell

brew install libxml2

Then in R

Sys.setenv(LOCAL_CPPFLAGS = "-I/opt/homebrew/opt/libxml2/include")
Sys.setenv(LOCAL_LDFLAGS = "-I/opt/homebrew/opt/libxml2/lib")
install.packages("XML")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment