1

I am installing R-4.2.2 under my $HOME path on a Red Hat 4.8.5-28 server.

When I run ./configure --prefix=$HOME/R --enable-R-shlib I found the error:

checking whether bzip2 support suffices... yes
checking for lzma_version_number in -llzma... no
configure: error: "liblzma library and headers are required"

I have install xz-5.2.2, and the headers and library have already been under $HOME/local/include and $HOME/local/lib. The path of the library has also been added to the $C_INCLUDE_PATH and $LD_LIBRARY_PATH. I am not install them to the default path by ways like yum because I do not have the permission.

GG Bond
  • 15
  • 3

1 Answers1

1

LD_LIBRARY_PATH is used by the dynamic linker at runtime. The variable plays no role for compilation (and even for runtime configuration it has serious issues and is generally best avoided).

You would normally set LDFLAGS to include the appropriate library paths. However, this should be done by the configure script, not by you. Instead, you would pass the appropriate command line flags to the configure script (something like --with-lzma=the/path), or by configuring the PKG_CONFIG_PATH.

The same is true for the C_INCLUDE_PATH environment variable, incidentally: setting it manually before invoking ./configure is rarely a good idea.

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
  • Thank you very much for your help. I added the path of .pc files (`$HOME/local/lib/pkgconfig`) to `PKG_CONFIG_PATH` and finally `ld` can found the library of lzma. Yet it still dosent works for configuring R, so I revised the configure file and added the path of librarys and head files in `$HOME/local` to the configure file, then the installation of R finally succeeded. – GG Bond Dec 16 '22 at 18:15