asdf-community / asdf-r

R plugin for the asdf version manager
https://github.com/asdf-vm/asdf
GNU General Public License v2.0
28 stars 5 forks source link

Installation failures on Mac os M1 #14

Open nileshtrivedi opened 3 months ago

nileshtrivedi commented 3 months ago

Provide environment information

OS:
Darwin workbox.local 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64

SHELL:
zsh 5.9 (x86_64-apple-darwin23.0)

BASH VERSION:
3.2.57(1)-release

ASDF VERSION:
v0.13.1-0586b37

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/mac/.asdf
ASDF_DIR=/Users/mac/.asdf
ASDF_CONFIG_FILE=/Users/mac/.asdfrc

ASDF INSTALLED PLUGINS:
bun                          https://github.com/cometkim/asdf-bun.git main e503786
crystal                      https://github.com/asdf-community/asdf-crystal.git master 6b5c52a
elixir                       https://github.com/asdf-vm/asdf-elixir.git master a4c42e1
erlang                       https://github.com/asdf-vm/asdf-erlang.git master ef8f04b
golang                       https://github.com/asdf-community/asdf-golang.git master 33b1f6d
java                         https://github.com/halcyon/asdf-java.git master f4d7233
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master c5b7c40
postgres                     https://github.com/smashedtoatoms/asdf-postgres.git master 4592b64
python                       https://github.com/danhper/asdf-python.git master 5e277e2
r                            https://github.com/asdf-community/asdf-r.git master dda1807
redis                        https://github.com/smashedtoatoms/asdf-redis.git master d5a67c5
ruby                         https://github.com/asdf-vm/asdf-ruby.git master dfa79d3
rust                         https://github.com/code-lever/asdf-rust.git master 95acf4f
zig                          https://github.com/cheetah/asdf-zig.git master 2133fc0

To Reproduce

brew install gcc xz libxt cairo pcre2
asdf install r latest

Describe the Bug

First I got this error:

configure: error: --with-x=yes (default) and X11 headers/libs are not available

This was not documented in README.md but I could resolve this with brew install xquartz --cask.

Then retrying it led to this error:

configure: error: "liblzma library and headers are required"

The library and headers seem to be present:

% brew list xz
/opt/homebrew/Cellar/xz/5.6.1/bin/lzcat
/opt/homebrew/Cellar/xz/5.6.1/bin/lzcmp
/opt/homebrew/Cellar/xz/5.6.1/bin/lzdiff
/opt/homebrew/Cellar/xz/5.6.1/bin/lzegrep
/opt/homebrew/Cellar/xz/5.6.1/bin/lzfgrep
/opt/homebrew/Cellar/xz/5.6.1/bin/lzgrep
/opt/homebrew/Cellar/xz/5.6.1/bin/lzless
/opt/homebrew/Cellar/xz/5.6.1/bin/lzma
/opt/homebrew/Cellar/xz/5.6.1/bin/lzmadec
/opt/homebrew/Cellar/xz/5.6.1/bin/lzmainfo
/opt/homebrew/Cellar/xz/5.6.1/bin/lzmore
/opt/homebrew/Cellar/xz/5.6.1/bin/unlzma
/opt/homebrew/Cellar/xz/5.6.1/bin/unxz
/opt/homebrew/Cellar/xz/5.6.1/bin/xz
/opt/homebrew/Cellar/xz/5.6.1/bin/xzcat
/opt/homebrew/Cellar/xz/5.6.1/bin/xzcmp
/opt/homebrew/Cellar/xz/5.6.1/bin/xzdec
/opt/homebrew/Cellar/xz/5.6.1/bin/xzdiff
/opt/homebrew/Cellar/xz/5.6.1/bin/xzegrep
/opt/homebrew/Cellar/xz/5.6.1/bin/xzfgrep
/opt/homebrew/Cellar/xz/5.6.1/bin/xzgrep
/opt/homebrew/Cellar/xz/5.6.1/bin/xzless
/opt/homebrew/Cellar/xz/5.6.1/bin/xzmore
/opt/homebrew/Cellar/xz/5.6.1/include/lzma/ (14 files)
/opt/homebrew/Cellar/xz/5.6.1/include/lzma.h
/opt/homebrew/Cellar/xz/5.6.1/lib/liblzma.5.dylib
/opt/homebrew/Cellar/xz/5.6.1/lib/pkgconfig/liblzma.pc
/opt/homebrew/Cellar/xz/5.6.1/lib/ (2 other files)
/opt/homebrew/Cellar/xz/5.6.1/share/doc/ (88 files)
/opt/homebrew/Cellar/xz/5.6.1/share/man/ (23 files)
% ls /opt/homebrew/lib/liblzma*
/opt/homebrew/lib/liblzma.5.dylib   /opt/homebrew/lib/liblzma.a     /opt/homebrew/lib/liblzma.dylib
% brew --prefix             
/opt/homebrew

It was not clear to me how I can get asdf install r latest to pick up this library/headers. I ran export CPPFLAGS="-I/opt/homebrew/Cellar/xz/5.6.1/include" and retried which made progress but then it failed with:

making localecharset.d from localecharset.c
grep.c:75:10: fatal error: 'pcre2.h' file not found
# include<pcre2.h>
         ^~~~~~~~~
1 error generated.
making logic.d from logic.c
make[2]: *** [grep.d] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [R] Error 1
make: *** [R] Error 1

I noticed that this repository has not seen any commits in last 2 years.

Expected Behaviour

R should install successfully on mac os M1 using asdf

nileshtrivedi commented 3 months ago

It seems to work after I ran:

export CPPFLAGS="-I/opt/homebrew/Cellar/xz/5.6.1/include -I/opt/homebrew/Cellar/pcre2/10.43/include/"
asdf install r latest
jmurphy-dev commented 3 months ago

I ran into this exact same issue on my m1 mac.