Comments (15)
We may need macOS expertise here, @simonjwright is this normal? Do Homebrew libraries require extra steps to locate headers?
from alire.
This is only available in the development version of alr
. Which one have you tried?
from alire.
% alr --version
alr 1.2.2
which was the latest version I could download the day before yesterday.
from alire.
Yes, that's the latest stable. Afraid no external support for macOS in that yet.
from alire.
Even with the nightly from https://github.com/alire-project/alire/releases the problem persists though, so I'm still looking for some kind of workaround.
from alire.
With the nightly, when exporting the HOMEBREW_PREFIX
environment variable, it is able to resolve the libgmp dependency, but still the build keeps failing with the missing header file.
from alire.
My setting (in ~/.bash_profile_common
) is
export C_INCLUDE_PATH=$HOMEBREW_PREFIX/include
export LIBRARY_PATH=$HOMEBREW_PREFIX/lib
It feels like a rather non-specific solution, and there may be better, perhaps using brew’s pkg-config
:
$ pkg-config --cflags gmp
-I/opt/homebrew/Cellar/gmp/6.2.1_1/include
$ pkg-config --libs gmp
-L/opt/homebrew/Cellar/gmp/6.2.1_1/lib -lgmp
though as you can see those pick up the currently-installed version and would have to be calculated on the fly in case of updates.
Would other distributions benefit from supporting pkg-config
? (the paths are easy to handle, I think, but there’s perhaps more variation in distribution-specific switches?)
from alire.
My setting (in
~/.bash_profile_common
) isexport C_INCLUDE_PATH=$HOMEBREW_PREFIX/include export LIBRARY_PATH=$HOMEBREW_PREFIX/lib
This works for me thanks. It might be good to at least document this somewhere?
from alire.
Thanks, @simonjwright. I wasn't aware that Homebrew required additional environment. This is something that possibly Alire could add to its environment if HOMEBREW_PREFIX is set.
At some point we want to have support for pkg-config
and the like, but if a single addition to a couple of env. vars. that can be computed at runtime is all it takes, it seems better than polluting all externals with a similar pkg-config
invocation.
And for example we're doing something similar already with msys2
on Windows, IIRC.
from alire.
I do believe that HOMEBREW_PREFIX
is no-standard. However, Homebrew generally occurs in one of two locations either /usr/local
or /opt/homebrew
from alire.
Thanks, @simonjwright. I wasn't aware that Homebrew required additional environment. This is something that possibly Alire could add to its environment if HOMEBREW_PREFIX is set.
Homebrew doesn’t require this additional environment; the trouble is that non-Apple package managers install software in non-standard locations (they pretty-much have to with System Integrity Protection, which makes the standard locations non-writable, even by root, without rebooting to disable SIP; Not Recommended).
These two env vars work (on macOS? universally?) regardless of distribution.
I’m not sure we should necessarily rely on HOMEBREW_PREFIX
; I use it to decide on the distribution (or the existence of /opt/local/bin/ports
for MacPorts), but having decided on the distribution we could export distribution-specific additional env vars (none for most distros!)
from alire.
I do believe that
HOMEBREW_PREFIX
is no-standard. However, Homebrew generally occurs in one of two locations either/usr/local
or/opt/homebrew
When I started using Homebrew, I found the command shellenv
(I don’t remember where, it doesn’t seem to be front-and-centre at brew.sh
):
$ brew help shellenv
Usage: brew shellenv [bash|csh|fish|pwsh|sh|tcsh|zsh]Print export statements. When run in a shell, this installation of Homebrew will be added to your PATH, MANPATH, and INFOPATH.
The variables HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are also exported to avoid querying them multiple times. To help guarantee idempotence, this command produces no output when Homebrew's bin and sbin directories are first and second respectively in your PATH.
Consider adding evaluation of this command's output to your dotfiles (e.g. ~/.profile, ~/.bash_profile, or ~/.zprofile) with: eval "$(brew shellenv)"The shell can be specified explicitly with a supported shell name parameter. Unknown shells will output POSIX exports.
My ~/.bash_profile_common
contains
eval $(/opt/homebrew/bin/brew shellenv)
(I had to be specific about that path, of course).
Do you think it would be better, in case users haven’t found this trick, to locate brew
on PATH
(it must be there if they’re to use it!?)
from alire.
When I started using Homebrew, I found the command shellenv (I don’t remember where, it doesn’t seem to be front-and-centre at brew.sh):
I wasn't aware of this, thanks for pointing this out. It even appears in the brew man-page, so it should be safe to depend on this.
from alire.
Related Issues (20)
- Alire trying to install msys2 on non-existent drive location on windows HOT 4
- Should the Windows install add Alire to PATH?
- Compilation failures with GCC 13.1.0 HOT 3
- alr fails on recent version of Fedora HOT 3
- exec: `--` "end of options" switch doesn't work with `--help` HOT 1
- Website: Tags not wrapping on tags page.
- Create temporary files in TMP directory. HOT 5
- Wrong configuration files in dependencies HOT 4
- Don't treat warnings as errors HOT 7
- How to locally solve dependency before checking index? HOT 3
- aws 23.0.0: broken build on Fedora HOT 5
- Boot strapping Alire on Windows not working HOT 5
- Some crates are not listed in https://alire.ada.dev/crates.html HOT 4
- MacPorts on macOS HOT 2
- Unable to build Alire due to ada_toml issue HOT 1
- CI fails in Install FSF Toolchain HOT 4
- Error if MacPorts installation not updated
- Config option to relocate the cache
- Question about OS detection in the index HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alire.