Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Start a new Session and Start R

Code Block
[salexan5@mblog2 ~]$ module purge
[]$ module load gcc/13.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/13.2.0/libxml2/2.10.3-5toq4pi/bin/xml2-config
...
Located parser file -I/apps/u/spack/gcc/13.2.0/libxml2/2.10.3-5toq4pi/include/libxml2 -I/apps/u/spack/gcc/13.2.0/libiconv/1.17-3dj22ny/include/parser.h
Checking for 1.8:  -I/apps/u/spack/gcc/13.2.0/libxml2/2.10.3-5toq4pi/include/libxml2 -I/apps/u/spack/gcc/13.2.0/libiconv/1.17-3dj22ny/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’
...

...

Info

We can see that the libxml2 library is available and is being picked up.

Code Block
[salexan5@mblog2 ~]$ ml
Currently Loaded Modules:
...
 15) libxml2/2.10.3              56) nghttp2/1.57.0
...

Install location: /apps/u/spack/gcc/13.2.0/libxml2/2.10.3-5toq4pi

...

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:

Code Block
[salexan5@mblog2 ~]$ module load gdal/3.7.3 geos/3.12.0 proj/9.2.1

...

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
    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:

Code Block
[salexan5@mblog2 ~]$ module purge
[]$ module load gcc/13.2.0 r/4.4.0
[salexan5@mblog2 ~]$ module load gdal/3.7.3 geos/3.12.0 proj/9.2.1 udunits/2.2.28

...