Closed SgtPooki closed 3 years ago
Hey @SgtPooki, thanks for the Mac OS updates and also the long env setup reference.
I'm thinking of a way to reference this content on the readme as well. As you already described very well here, I think that just to reference this pull request on the readme would be nice, what do you think?
PS: I can do it myself, I just want to know if you agree this is a good option :)
I just did, thank you!
awesome :) Thanks
Hi, I just tried following this guide and I get this error
configure: error: "liblzma library and headers are required"
despite having xz installed (which has now replaced liblzma) Do you know how I would go about fixing this? Thanks!
@noahgaertner I am having the same issue, did you ever come across a solution?
@noahgaertner I am having the same issue, did you ever come across a solution?
Nope, I ended up just installing it from brew directly @Nathaniel-Haines
@noahgaertner fell upon a solution today! I think the problem was that the compiler could not locate lzma. After installing xz/lzma through:
brew install xz
the following worked for me:
R_EXTRA_CONFIGURE_OPTIONS="CFLAGS=-I/opt/homebrew/lib CPPFLAGS=-I/opt/homebrew/include LDFLAGS=-L/opt/homebrew/include --enable-R-shlib --with-cairo --with-x=no" asdf install R 4.1.0
Is it possible to let the build script actually include CFLAGS=-I/opt/homebrew/lib CPPFLAGS=-I/opt/homebrew/include LDFLAGS=-L/opt/homebrew/include
as additional paths to check for so end users do not have to dig until they end up here? @SgtPooki @taiar
@hyiltiz i imagine not. Especially not assuming homebrew is installed on every machine.
CFLAGS can vary in location by system, and it’s pretty common for compiler flags to require consumer intervention and manual config, because the locations and flags can vary widely and need customization/overriding for various reasons
Idk if there’s a good library out there for automatic CFLAG settings for users who are only using a tool and not developing it, but there might be.
A switch on os/platform/arch with some sane defaults and guiding error messages could be a good middleground 🤷
There may be a confusion here; I am asking if we should also check for those paths before setting the variables CFLAGS etc., without assuming the existence of homebrew. I think one of the problems the build system could solve is to check for the existence of libraries etc. under various highly-likely paths in the system, and set appropriate defaults. The user could still override if they so wish by mechanisms such as manual configs or environment variables etc.
I required
libxt
andcairo
to be installed, as well as modifyingPATH
,LDFLAGS
,CPPFLAGS
, andPKG_CONFIG_PATH
as all the dependencies installed by those requested. I used regex and some find and replace to generate the export statements from the brew install output, so these could be combined into single statements per environment variable: