-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
[Bug] Unable to build on Mac M1 due to Homebrew's different default install path #471
Comments
Hi, can you see exactly which libpng that cmake found, if mac now comes with one version of the library by default then the homebrew version might need to be explicitly specified. As for the different install paths, it seems that homebrew has a command |
|
Here's something I tried: whenever a "file not found" error came up, I would go to the source code and prepend the faulty include with
I ran
|
I've decided to create symlinks
|
I managed to get a successful build on my M1 Mac! All it took was, without doing any aforementioned VS Code path changing:
However, this is a workaround and the symlink may need to be removed to keep things clean. |
wow, this saved me an evening of trying to figure out why make doesnt see the files that i explicitly told it to look at. thanks |
@Drewol
How could I tell CMake to use the correct version? |
This did not work for me, however: |
If you're still experiencing the above issue (even on an Intel Mac such as me) and the above didn't help, it could have been a simple case of accidentally not reading through the caveats for For example, on fish shell on my Intel Mac: ~> brew reinstall libarchive
...
==> Caveats
libarchive is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have libarchive first in your PATH, run:
echo 'fish_add_path /usr/local/opt/libarchive/bin' >> ~/.config/fish/config.fish
For compilers to find libarchive you may need to set:
set -gx LDFLAGS "-L/usr/local/opt/libarchive/lib"
set -gx CPPFLAGS "-I/usr/local/opt/libarchive/include"
... so I simply ran the commands ~> echo 'fish_add_path /usr/local/opt/libarchive/bin' >> ~/.config/fish/config.fish
~> set -gx LDFLAGS "-L/usr/local/opt/libarchive/lib"
~> set -gx CPPFLAGS "-I/usr/local/opt/libarchive/include" If you're using another shell such as bash, you can convert the fish notation to bash notation, or more easily just run After this, it compiled as normal :) |
I tried all of the above methods, but none of them worked (using M1 Mac). However, I did find my own solution. I have libarchive installed via homebrew, so it is located in Old:
New:
In hindsight, I think the alias method would have worked for me, but my libarchive directories were slightly different. |
What I think should be done is to use the |
EDIT: I made a mistake here. Please see my posts below. I just tried again using the $HOMEBREW_CELLAR variable and was able to successfully compile.
I only have access to my Mac though, so it would probably be best to get a second opinion. |
I'm not sure about
|
That doesn't work for me. Also I realize I made a small mistake in my last post. I had meant to type
And here are my variables:
There is an |
ah ok, becauseI checked However On linux |
Yep, I can confirm that those paths work.
|
the Mac build script has now been updated to use environment variables from homebrew, would be good to get confirmation from a few people that it's better now before I can close the mac build issues |
I am trying to install on my intel mac and I was in in the same state as @DaGinYus. I had tried the new I found this SO post that goes over the issue (I also have an old mono framework kicking around on my machine). Doing their quick and dirty solution of adding I don't think there's necessarily any action to be taken from this. I'm not super keen on cmake but it's not the first time i've had issues with it locating the wrong instance of a library and i think it's more of a "me" issue. I figured I'd post in case anyone else ends up in the same situation. |
I was able to build it. Everything was working very fine except the skin that I use. |
Intel MacBook Pro (2020) here. Got a successful build by manually adding This was quite a tedious process as it was trial and error... CMake is so arcane that I can't even comprehend what the way to fix it would look like. |
heeeeeeeeelp lol |
Here's a working
|
Describe the bug
Since Homebrew installs itself onto
/opt/homebrew
on Mac M1, the build script fails when trying to build on Mac M1. Even after using VS Code to replace all instances of/usr/local
with/opt/homebrew
, the build still fails but a little further down the road.To Reproduce
brew install cmake freetype libvorbis sdl2 libpng jpeg libarchive libiconv
git clone https://github.com/Drewol/unnamed-sdvx-clone
cd unnamed-sdvx-clone
git submodule update --init --recursive
/usr/local
in the project folder with/opt/homebrew
../mac-cmake.sh
make
Expected behavior
An executable appears in the bin folder.
make
log (before replacing/usr/local
)make
log (after replacing/usr/local
)System
MacBook Air 2020
M1 Apple Silicon
256 GB SSD
8 GB RAM
The text was updated successfully, but these errors were encountered: