Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md for mac osx users #2

Merged
merged 1 commit into from
Apr 16, 2021
Merged

Conversation

SgtPooki
Copy link

I required libxt and cairo to be installed, as well as modifying PATH, LDFLAGS, CPPFLAGS, and PKG_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:

export PATH="/usr/local/opt/expat/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/expat/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/expat/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/expat/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export LDFLAGS="-L/usr/local/opt/expat/lib"
export CPPFLAGS="-I/usr/local/opt/expat/include"
export PKG_CONFIG_PATH="/usr/local/opt/expat/lib/pkgconfig"
export C_INCLUDE_PATH="/opt/X11/include:${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export LDFLAGS="-L/usr/local/opt/libffi/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/libffi/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/sqlite/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/sqlite/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/sqlite/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/python@3.8/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"
export LDFLAGS="-L/usr/local/opt/icu4c/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/icu4c/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export LDFLAGS="-L/usr/local/opt/libffi/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/libffi/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/sqlite/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/sqlite/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/sqlite/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/python@3.8/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"
export LDFLAGS="-L/usr/local/opt/icu4c/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/icu4c/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"

I required `libxt` and `cairo` to be installed, as well as modifying `PATH`, `LDFLAGS`, `CPPFLAGS`, and `PKG_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:

```
export PATH="/usr/local/opt/expat/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/expat/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/expat/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/expat/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export LDFLAGS="-L/usr/local/opt/expat/lib"
export CPPFLAGS="-I/usr/local/opt/expat/include"
export PKG_CONFIG_PATH="/usr/local/opt/expat/lib/pkgconfig"
export C_INCLUDE_PATH="/opt/X11/include:${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export LDFLAGS="-L/usr/local/opt/libffi/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/libffi/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/sqlite/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/sqlite/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/sqlite/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/python@3.8/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"
export LDFLAGS="-L/usr/local/opt/icu4c/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/icu4c/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export LDFLAGS="-L/usr/local/opt/libffi/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/libffi/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/sqlite/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/sqlite/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/sqlite/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/python@3.8/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"
export LDFLAGS="-L/usr/local/opt/icu4c/lib${LDFLAGS:+ }${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/icu4c/include${CPPFLAGS:+ }${CPPFLAGS}"
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}"
```
@taiar
Copy link
Member

taiar commented Apr 15, 2021

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 :)

@taiar taiar merged commit ee466be into asdf-community:master Apr 16, 2021
@taiar
Copy link
Member

taiar commented Apr 16, 2021

I just did, thank you!

@SgtPooki
Copy link
Author

awesome :) Thanks

@SgtPooki SgtPooki deleted the patch-1 branch April 20, 2021 05:03
@noahgaertner
Copy link

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!

@Nathaniel-Haines
Copy link

@noahgaertner I am having the same issue, did you ever come across a solution?

@noahgaertner
Copy link

noahgaertner commented Sep 28, 2021

@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

@Nathaniel-Haines
Copy link

@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

@hyiltiz
Copy link

hyiltiz commented Mar 7, 2023

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

@SgtPooki
Copy link
Author

SgtPooki commented Apr 2, 2023

@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 🤷

@hyiltiz
Copy link

hyiltiz commented Apr 5, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants