Goal: Installing some R packages requires understanding what libraries are available on the System.
...
Start a new Session and Start R
Code Block |
---|
[salexan5@mblog2 ~]$ module purge []$ module load gcc/1314.2.0 r/4.4.0 [salexan5@mblog2 ~]$ R R version 4.4.0 (2024-04-24) -- "Puppy Cup" ... |
...
Code Block |
---|
> install.packages("XML") ... checking for xml2-config... /apps/u/spack/gcc/1314.2.0/libxml2/2.10.3-5toq4piuqxodiu/bin/xml2-config ... Located parser file -I/apps/u/spack/gcc/1314.2.0/libxml2/2.10.3-5toq4piuqxodiu/include/libxml2 -I/apps/u/spack/gcc/1314.2.0/libiconv/1.17-3dj22nymii6uj7/include/parser.h Checking for 1.8: -I/apps/u/spack/gcc/1314.2.0/libxml2/2.10.3-5toq4piuqxodiu/include/libxml2 -I/apps/u/spack/gcc/1314.2.0/libiconv/1.17-3dj22nymii6uj7/include Using libxml2.* checking for gzopen in -lz... yes checking for xmlParseFile in -lxml2... yes You are trying to use a version 2.* edition of libxml but an incompatible library. The header files and library seem to be mismatched. If you have specified LIBXML_INCDIR, make certain to also specify an appropriate LIBXML_LIBDIR if the libxml2 library is not in the default directories. ERROR: configuration failed for package ‘XML’ * removing ‘/cluster/medbow/home/salexan5<username>/R/x86_64-pc-linux-gnu-library/4.4/XML’ ... |
...
How to Resolve XML Package Issue
Info |
---|
We can see from the CRAM CRAN package XML description that from the System Requirements we require: |
Info | ||
---|---|---|
We can see that the
Install location: |
Info |
---|
Sometimes the cause of the error isn’t obvious. Try Googling to look for suggestions: Can not install XML package |
Code Block |
---|
# Withi R: > Sys.setenv(XML_CONFIG="/apps/u/spack/gcc/1314.2.0/libxml2/2.10.3-5toq4piuqxodiu/bin/xml2-config") > install.packages('XML', configure.args=c('--with-libxml2=/apps/u/spack/gcc/1314.2.0/libxml2/2.10.3-5toq4piuqxodiu/bin/xml2-config LIBXML_LIBDIR=-L/apps/u/spack/gcc/1314.2.0/libxml2/2.10.3-5toq4piuqxodiu/lib/ LIBXML_INCDIR=/apps/u/spack/gcc/1314.2.0/libxml2/2.10.3-5toq4piuqxodiu/include/libxml2/')) Installing package into ‘/cluster/medbow/home/salexan5/R/x86_64-pc-linux-gnu-library/4.4’ ... * DONE (XML) |
...
Info |
---|
Reading the CRAN sf definition page, take note of the system requirements: System Requirements: GDAL (>= 2.0.1), GEOS (>= 3.4.0), PROJ (>= 4.8.0), sqlite3 What do we already have loaded? |
Code Block |
---|
[salexan5@mblog2 ~]$ ml
Currently Loaded Modules:
...
35) sqlite/3.43.2 76) scrnsaverproto/1.2.2
... |
Info | ||
---|---|---|
We also need to manually load:
|
...
Do we have a udunits
module?
Code Block |
---|
[powersw@mblog2 ~]$ module spider udunits ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- udunits: udunits/2.2.28 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- You will need to load all module(s) on any one of the lines below before the "udunits/2.2.28" module is available to load. arcc/1.0 gcc/13.2.0 arcc/1.0 gcc/14.2.0 Help: Automated units conversion |
Code Block |
---|
[powersw@mblog2 ~]$ module load udunits/2.2.28
# Within R
> install.packages("sf")
...
* DONE (sf)
> library(sf)
Linking to GEOS 3.12.0, GDAL 3.7.3, PROJ 9.2.1; sf_use_s2() is TRUE |
Info | ||
---|---|---|
Recommendation: When ever you want to use this R package, additionally load:
|
...
previous section
...
...
Prev | Workshop Home | Next |