r-lib / xml2

Bindings to libxml2
https://xml2.r-lib.org/
Other
218 stars 83 forks source link

Build process on Linux includes shared libraries not in library path. #424

Open rbrittain opened 9 months ago

rbrittain commented 9 months ago

When building xml2 on Linux (tested with RHEL7 and R 4.1,4.2,4.3), the compile and link steps will include libraries associated with directories in $PATH, but which aren't in the library search path for anything else. For example, if conda is in use, we have /optnfs/common/miniconda3/bin in $PATH. Building xml2 finds and uses header files in /optnfs/common/miniconda3/include/ and library (.so) files in /optnfs/common/miniconda3/lib (explicitly passed to linker with -L option). The compile succeeds, but then the test load fails with a missing library. Disabling conda makes the build locate the library in one of the default places (/usr/lib64) and it works.

The first library affected in libicui18n.so, but there are many other duplicated libraries between the standard system location and private copies installed by applications.