[R-SIG-Mac] configure: error: "liblzma library and headers are required"

Marius Hofert m@r|u@@ho|ert @end|ng |rom uw@ter|oo@c@
Sat Jun 11 15:52:39 CEST 2022


I'd like to install R from source on a MacBook Pro 14 (M1 Pro Max) and do that
for the first time under Apple Silicon.  I could install all preliminaries from
source as I normally did under Intel Macs (even tcl and tk, gsl, gmp, mpfr, etc.).
However, the configure step of R fails with:

checking for lzma_version_number in -llzma... yes
checking for lzma.h... no
configure: error: "liblzma library and headers are required"

Related to this problem, I found the references below. However, none of the
suggested solutions worked for me.

The problem seems to be the installation of xz (and, as the references suggest, a similar
problem will arise from pcre2). The header file lzma.h is not found.

Here are the things I tried:

1) A plain 'brew install xz'.

2) Adding the directories where lzma.h is found to PATH:

3) Following https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Native-builds:
3.1) Creating /opt/R/arm64
3.2) Downloading xz-5.2.5-darwin.20-arm64.tar.xz from https://mac.r-project.org/bin/darwin20/arm64/
and unpacking it to /opt/R/arm64
3.3) Adding /opt/R/arm64 to PATH

How can xz be installed in Apple Silicon so that configure finds it including headers?

Let me know if you need more information.

Thanks & cheers,


More information about the R-SIG-Mac mailing list