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

macOS compilation failures (brew, macports, and cmake) #3180

Open
2 tasks done
ReenigneArcher opened this issue Sep 13, 2024 · 68 comments
Open
2 tasks done

macOS compilation failures (brew, macports, and cmake) #3180

ReenigneArcher opened this issue Sep 13, 2024 · 68 comments
Labels
help wanted Extra attention is needed os:macOS OS is macOS

Comments

@ReenigneArcher
Copy link
Member

ReenigneArcher commented Sep 13, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

Several reports of macOS build failures. Consolidating into one issue.

Expected Behavior

No response

Additional Context

  1. For brew, this may be resolved by clearing brew's cache. See Brew install sunshine but "CMake Generate step failed." #2369 (comment)

    stable

    sudo rm -rf "$(brew --cache --build-from-source sunshine-beta)"

    beta

    sudo rm -rf "$(brew --cache --build-from-source sunshine)"
  2. Then install the beta version (v0.23.1 is unlikely to compile at this point without patches)

    brew install sunshine-beta

Host Operating System

macOS

Operating System Version

12+

Architecture

arm

Sunshine commit or version

v0.23.1+

Package

n/a

GPU Type

Apple Silicon

GPU Model

GPU Driver/Mesa Version

Capture Method

AVCaptureScreen (macOS)

Config

-

Apps

No response

Relevant log output

-
@Pheggas
Copy link

Pheggas commented Sep 13, 2024

Mac M3 Air - sadly, clearing brew's cache didn't help. It did alter the log a bit though.

@ReenigneArcher

This comment was marked as resolved.

@ReenigneArcher ReenigneArcher added the help wanted Extra attention is needed label Sep 13, 2024
@Pheggas

This comment was marked as off-topic.

@ReenigneArcher

This comment was marked as off-topic.

@quejoo

This comment was marked as duplicate.

@Pheggas

This comment was marked as off-topic.

@Lucascuibu

This comment was marked as resolved.

@gibbyb
Copy link

gibbyb commented Sep 17, 2024

@Pheggas brew install sunshine-beta seems to work

@lanyangyin

This comment was marked as outdated.

@ReenigneArcher

This comment was marked as outdated.

@lanyangyin

This comment was marked as resolved.

@haveamission
Copy link

@Pheggas brew install sunshine-beta seems to work

For whatever reason, this is still not working for me

@iMonZ

This comment was marked as resolved.

@RaafatAkkad

This comment was marked as resolved.

@iMonZ
Copy link

iMonZ commented Sep 22, 2024

Warning: No available formula with the name "sunshine-beta". Did you mean sunshine? ==> Searching for similarly named formulae and casks... ==> Formulae realqhc/homebrew/sunshine

@iMonZ There is now an official homebrew tap, You can replace the realqhc/homebrew tap with https://github.com/LizardByte/homebrew-homebrew

sunshine-beta installed & worked for me on macOS 15.0 (24A335)

Thanks!
I switched now the tap and get this:

brew install sunshine-beta
==> Downloading https://formulae.brew.sh/api/formula.jws.json
#################################################################################################################################################################################################################### 100.0%
Warning: Failed to set filetime 1727010808 on
Warning: '/Users/user/Library/Caches/Homebrew/api/formula.jws.json': No such
Warning: file or directory
==> Downloading https://formulae.brew.sh/api/formula.jws.json
#################################################################################################################################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
#################################################################################################################################################################################################################### 100.0%
==> Fetching lizardbyte/homebrew/sunshine-beta
==> Cloning https://github.com/LizardByte/Sunshine.git
Updating /Users/user/Library/Caches/Homebrew/sunshine-beta--git
==> Checking out tag v2024.922.10353
HEAD is now at 68eb8d2f ci(l10n): fix pr title for babel updates (#3216)
HEAD is now at 68eb8d2f ci(l10n): fix pr title for babel updates (#3216)
Entering 'packaging/linux/flatpak/deps/shared-modules'
Entering 'third-party/Simple-Web-Server'
Entering 'third-party/TPCircularBuffer'
Entering 'third-party/ViGEmClient'
Entering 'third-party/build-deps'
Entering 'third-party/doxyconfig'
Synchronizing submodule url for 'doxygen-awesome-css'
Entering 'third-party/doxyconfig/doxygen-awesome-css'
Entering 'third-party/googletest'
Entering 'third-party/inputtino'
Entering 'third-party/moonlight-common-c'
Synchronizing submodule url for 'enet'
Entering 'third-party/moonlight-common-c/enet'
Entering 'third-party/nanors'
Entering 'third-party/nv-codec-headers'
Entering 'third-party/nvapi-open-source-sdk'
Entering 'third-party/tray'
Synchronizing submodule url for 'third-party/doxyconfig'
Synchronizing submodule url for 'third-party/googletest'
Entering 'third-party/tray/third-party/doxyconfig'
Synchronizing submodule url for 'doxygen-awesome-css'
Entering 'third-party/tray/third-party/doxyconfig/doxygen-awesome-css'
Entering 'third-party/tray/third-party/googletest'
Entering 'third-party/wayland-protocols'
Entering 'third-party/wlr-protocols'
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/packaging/linux/flatpak/deps/shared-modules
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/Simple-Web-Server
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/TPCircularBuffer
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/ViGEmClient
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/build-deps
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/doxyconfig
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/doxyconfig/doxygen-awesome-css
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/googletest
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/inputtino
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/moonlight-common-c
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/moonlight-common-c/enet
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/nanors
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/nv-codec-headers
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/nvapi-open-source-sdk
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/tray
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/tray/third-party/doxyconfig
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/tray/third-party/doxyconfig/doxygen-awesome-css
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/tray/third-party/googletest
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/wayland-protocols
/Users/user/Library/Caches/Homebrew/sunshine-beta--git/third-party/wlr-protocols
==> Installing sunshine-beta from lizardbyte/homebrew
==> Building docs: enabled
==> Statically linking Boost libraries
==> Linking against ICU libraries at: /opt/homebrew/opt/icu4c/lib
==> cmake -S . -B build -DBUILD_WERROR=ON -DHOMEBREW_ALLOW_FETCHCONTENT=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@3 -DSUNSHINE_ASSETS_DIR=sunshine/assets -DSUNSHINE_BUILD_HOMEBREW=ON -DSUNSHINE_ENABLE_TRAY=OFF -DS
==> make
Last 15 lines from /Users/user/Library/Logs/Homebrew/sunshine-beta/02.make:
Patching output file 1047/1056
Patching output file 1048/1056
Patching output file 1049/1056
Patching output file 1050/1056
Patching output file 1051/1056
Patching output file 1052/1056
Patching output file 1053/1056
Patching output file 1054/1056
Patching output file 1055/1056
Patching output file 1056/1056
type lookup cache used 6356/65536 hits=15127 misses=7868
symbol lookup cache used 4964/65536 hits=28115 misses=4964
finished...
[100%] Built target docs
make: *** [all] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
 https://github.com/lizardbyte/homebrew-homebrew/issues

@sern19
Copy link

sern19 commented Sep 24, 2024

I have the same problem, full log indicates issue in gtest.h file:

/tmp/sunshine-beta-20240925-79083-jfmynu/third-party/googletest/googletest/include/gtest/gtest.h:52:10: fatal error: 'cstddef' file not found
   52 | #include <cstddef>
      |          ^~~~~~~~~

Full log: 02.make.txt

@Lucascuibu
Copy link

Switched to tap and failed again
截屏2024-09-25 22 27 33

@marco3181
Copy link

For everyone with the include problem, you have to reinstall Xcode command line tool the hard way. You have to do:
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
And then make an update.
The beta version will complete then. My Mac is a MacMini M1 with Sequoia.

@ReenigneArcher
Copy link
Member Author

FYI, for those still on macOS-12: #3236

@sern19
Copy link

sern19 commented Sep 30, 2024

For everyone with the include problem, you have to reinstall Xcode command line tool the hard way. You have to do: sudo rm -rf /Library/Developer/CommandLineTools xcode-select --install And then make an update. The beta version will complete then. My Mac is a MacMini M1 with Sequoia.

This fixed my issue

@XiaoDcs
Copy link

XiaoDcs commented Oct 2, 2024

I am using homebrew on my m2 pro mac. For the first time I received "can't turn off malloc stack logging because it was not enabled". Then I shut down the terminal and try again and met following: ==> Installing sunshine from lizardbyte/homebrew ==> cmake -S . -B build -DBUILD_WERROR=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/o ==> make -j Last 15 lines from /Users/lucas/Library/Logs/Homebrew/sunshine/02.make: ../../../../build/assets/web/assets/Navbar-48ec9d0d.css 0.07 kB │ gzip: 0.09 kB ../../../../build/assets/web/assets/_plugin-vue_export-helper-cff45802.css 327.59 kB │ gzip: 54.06 kB ../../../../build/assets/web/assets/password-41ebda5b.js 0.63 kB │ gzip: 0.41 kB ../../../../build/assets/web/assets/welcome-6454da3a.js 0.66 kB │ gzip: 0.42 kB ../../../../build/assets/web/assets/pin-677ef343.js 0.81 kB │ gzip: 0.43 kB ../../../../build/assets/web/assets/troubleshooting-76080e6f.js 1.36 kB │ gzip: 0.59 kB ../../../../build/assets/web/assets/ResourceCard-ea4a7cba.js 1.67 kB │ gzip: 0.64 kB ../../../../build/assets/web/assets/index-1d511c0f.js 2.06 kB │ gzip: 0.90 kB ../../../../build/assets/web/assets/Navbar-dbaf0800.js 2.16 kB │ gzip: 0.94 kB ../../../../build/assets/web/assets/config-f4fb6dcb.js 4.97 kB │ gzip: 2.10 kB ../../../../build/assets/web/assets/apps-966a1e70.js 85.57 kB │ gzip: 25.93 kB ../../../../build/assets/web/assets/_plugin-vue_export-helper-fe085d29.js 327.84 kB │ gzip: 111.98 kB ✓ built in 867ms [ 96%] Built target web-ui make: *** [all] Error 2

Still failed;(

My error is the same as yours, Stuck in "target web ui", and update xcode did not work for me, macbook m3 with Sequoia 15.0

@iMonZ
Copy link

iMonZ commented Oct 8, 2024

Is it possible to release formula Bottles for this Tool?
Recompiling after every update is very resource hungry and takes time

@ReenigneArcher
Copy link
Member Author

I think it's possible. I would need some guidance on how to publish them.

@0x346e3730
Copy link

Tried clearing cache and reinstalling xcode, still cannot install with brew install sunshine-beta. Mac Pro M1 with Seqoia

Seeing "Undefined symbols for architecture arm64" in the logs
Full 02.make :
02.make.txt

@ReenigneArcher
Copy link
Member Author

Use beta

@coryblische
Copy link

I have followed along here and tried all of the described workarounds, but sunshine and sunshine-beta are both failing to install on my M2 MacBook Air running macOS 15.1

ld: symbol(s) not found for architecture arm64

Full log attached.

log - 02.make.txt

@le0-VV
Copy link

le0-VV commented Nov 3, 2024

issue seems to be X509 of openssl's arm64 version isnt linked correctly, specificly X509_verify_cert_error_string. But running nm -gU /opt/homebrew/opt/openssl@3/lib/libcrypto.dylib | grep X509_verify_cert_error_string shows that X509_verify_cert_error_string is present and running lipo -info /opt/homebrew/opt/openssl@3/lib/libcrypto.dylib shows the installed version of openssl is arm64. idk if this helps

@churipputori
Copy link

churipputori commented Nov 8, 2024

For me on Intel macOS 15.1, brew install sunshine-beta results in

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libcurl'
--   Package 'ldap', required by 'libcurl', not found
CMake Error at /usr/local/Cellar/cmake/3.31.0/share/cmake/Modules/FindPkgConfig.cmake:645 (message):
  The following required packages were not found:

   - libcurl

Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.31.0/share/cmake/Modules/FindPkgConfig.cmake:873 (_pkg_check_modules_internal)
  cmake/dependencies/common.cmake:19 (pkg_check_modules)
  CMakeLists.txt:54 (include)


-- Configuring incomplete, errors occurred!

A cursory google search seems to reveal not even a single result, and my best guess installing openldap (along with all the previously mentioned prerequisites of course) did not change the outcome.

@noobnooc
Copy link

noobnooc commented Nov 8, 2024

For me on Intel macOS 15.1, brew install sunshine-beta results in

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libcurl'
--   Package 'ldap', required by 'libcurl', not found
CMake Error at /usr/local/Cellar/cmake/3.31.0/share/cmake/Modules/FindPkgConfig.cmake:645 (message):
  The following required packages were not found:

   - libcurl

Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.31.0/share/cmake/Modules/FindPkgConfig.cmake:873 (_pkg_check_modules_internal)
  cmake/dependencies/common.cmake:19 (pkg_check_modules)
  CMakeLists.txt:54 (include)


-- Configuring incomplete, errors occurred!

A cursory google search seems to reveal not even a single result, and my best guess installing openldap (along with all the previously mentioned prerequisites of course) did not change the outcome.

I have the same issue reported on my M1 MacBook with macOS 15.1, have you found any resolution for this issue?

@MichaelinVic

This comment was marked as duplicate.

@Benjamin-Dobell
Copy link

Benjamin-Dobell commented Nov 9, 2024

To resolve the libcurl (ldap) issue you'll want to run:

ln -s /opt/homebrew/Cellar/openldap/2.6.8/lib/pkgconfig/* /opt/homebrew/lib/pkgconfig/

You'll probably then be hit by another similar issue for Kerberos. Which is resolved similarly with:

ln -s /opt/homebrew/Cellar/krb5/1.21.3/lib/pkgconfig/* /opt/homebrew/lib/pkgconfig/

Why were these not already linked? No clue.

@ReenigneArcher
Copy link
Member Author

For me on Intel macOS 15.1, brew install sunshine-beta results in

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libcurl'
--   Package 'ldap', required by 'libcurl', not found
CMake Error at /usr/local/Cellar/cmake/3.31.0/share/cmake/Modules/FindPkgConfig.cmake:645 (message):
  The following required packages were not found:

   - libcurl

Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.31.0/share/cmake/Modules/FindPkgConfig.cmake:873 (_pkg_check_modules_internal)
  cmake/dependencies/common.cmake:19 (pkg_check_modules)
  CMakeLists.txt:54 (include)


-- Configuring incomplete, errors occurred!

A cursory google search seems to reveal not even a single result, and my best guess installing openldap (along with all the previously mentioned prerequisites of course) did not change the outcome.

This is now reproduceable in our CI on macOS-13, but interestingly not macOS-14.

@ReenigneArcher
Copy link
Member Author

The libcurl/ldap issue "should" be fixed in homebrew now,

@ThePokeX
Copy link

To resolve the libcurl (ldap) issue you'll want to run:

ln -s /opt/homebrew/Cellar/openldap/2.6.8/lib/pkgconfig/* /opt/homebrew/lib/pkgconfig/

You'll probably then be hit by another similar issue for Kerberos. Which is resolved similarly with:

ln -s /opt/homebrew/Cellar/krb5/1.21.3/lib/pkgconfig/* /opt/homebrew/lib/pkgconfig/

Why were these not already linked? No clue.

For anyone else on a fresh install like I was, before running that second command I had to run:

brew install krb5

Thanks for the help everyone, really appreciate it!

@mingliao1994
Copy link

mingliao1994 commented Nov 12, 2024

-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libcurl'
-- Package 'mit-krb5-gssapi', required by 'libcurl', not found
CMake Error at /opt/homebrew/opt/cmake/share/cmake/Modules/FindPkgConfig.cmake:645 (message):
The following required packages were not found:

  • libcurl

Call Stack (most recent call first):
/opt/homebrew/opt/cmake/share/cmake/Modules/FindPkgConfig.cmake:873 (_pkg_check_modules_internal)
cmake/dependencies/common.cmake:19 (pkg_check_modules)
CMakeLists.txt:54 (include)

-- Configuring incomplete, errors occurred!

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
https://github.com/lizardbyte/homebrew-homebrew/issues

-------------------------------------- UPDATE --------------------------------------

After executing the following commands:

brew update
brew upgrade
brew install sunshine-beta

Sunshine was successfully installed.
-------------------------------------- UPDATE --------------------------------------

@ReenigneArcher
Copy link
Member Author

ReenigneArcher commented Nov 15, 2024

@mingliao1994 did you have to install any additional packages or simply doing the brew update/upgrade was enough?

Edit: I tested this in CI and it appears when using brew update/upgrade you do not need to install any extra dependencies. I have update the documentation around this as well.

@NeverBeLazyG

This comment was marked as abuse.

@ReenigneArcher
Copy link
Member Author

Please act professionally here. First and only warning.

@NeverBeLazyG

This comment was marked as abuse.

@le0-VV
Copy link

le0-VV commented Nov 18, 2024

why the hell there is not a simply normal install pkg or easier way ? wtf is that ? wasting time of ppl here. my god, i followed every instruction here, and nothing works. its just frustrating. sometimes i want to go to windows, i am sick of this stupid time waste all the time with compiling n "sh*t". lifetime waste

> username is "NeverBeLazy"
> has the audacity to ask developers of a free 20k star repo for a lazy 1-click solution
> *checks bio* is an AI bro

lol

@le0-VV
Copy link

le0-VV commented Nov 18, 2024

btw just wanna ask, is the ARM version for Apple Silicon support HEVC hardware encode? if so is it supposed to have 70% GPU util on M1? running the x64 version because ARM version of the beta still isn't compiling for me and everytime im streaming its using 70% GPU and has noticable input lag, probably due to the translation layer

@ReenigneArcher
Copy link
Member Author

is the ARM version for Apple Silicon support HEVC hardware encode?

As far as I know, it should. If you're emulating a different architecture it makes sense to consume more resources.

Did you try this? #3180 (comment)

@le0-VV
Copy link

le0-VV commented Nov 18, 2024

Did you try this? #3180 (comment)

Haven't, will do later today, thx for the tip

@le0-VV
Copy link

le0-VV commented Nov 18, 2024

is the ARM version for Apple Silicon support HEVC hardware encode?

As far as I know, it should. If you're emulating a different architecture it makes sense to consume more resources.

Did you try this? #3180 (comment)

Still got an error, i will open an issue at https://github.com/lizardbyte/homebrew-homebrew/issues, error is different from #3180 (comment)

Nvm your homebrew repo doesn't have an issue section. Error is as follows, i don't know how to get more detailed make log

Last 15 lines from /Users/user/Library/Logs/Homebrew/sunshine-beta/02.make:
  "_X509_set_version", referenced from:
      crypto::gen_creds(std::__1::basic_string_view<char, std::__1::char_traits<char>> const&, unsigned int) in crypto.cpp.o
  "_X509_sign", referenced from:
      crypto::gen_creds(std::__1::basic_string_view<char, std::__1::char_traits<char>> const&, unsigned int) in crypto.cpp.o
  "_X509_verify_cert", referenced from:
      crypto::cert_chain_t::verify(x509_st*) in crypto.cpp.o
  "_X509_verify_cert_error_string", referenced from:
      crypto::cert_chain_t::verify(x509_st*) in crypto.cpp.o
      crypto::cert_chain_t::verify(x509_st*) in crypto.cpp.o
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
libboost_log-mt.dylib /opt/homebrew/lib/libboost_program_options-mt.dylib /opt/homebrew/lib/libboost_system-mt.dylib /usr/local/opt/openssl/lib/libssl.dylib /usr/local/opt/openssl/lib/libcrypto.dylib ../lib/libgtest.a /opt/homebrew/lib/libboost_filesystem-mt.dylib /opt/homebrew/lib/libboost_atomic-mt.dylib /opt/homebrew/lib/libboost_chrono-mt.dylib /opt/homebrew/lib/libboost_thread-mt.dylib
make[2]: *** [tests/test_sunshine] Error 1
make[1]: *** [tests/CMakeFiles/test_sunshine.dir/all] Error 2
make: *** [all] Error 2

@ReenigneArcher
Copy link
Member Author

No need to open an issue in that repo since it will need to be fixed here

@rogerogden
Copy link

I'm also getting @le0-VV's error after trying the various proposed solutions in this thread.

I'm running macOS Sequoia 15.2 Beta (24C5079e), in case that's helpful.

@00Dchapellebot
Copy link

@le0-VV, @rogerogden :

I recently upgraded Sequoia from Mac Sonoma. Homebrew had installed formulas into an 'alternative directories' instead of /usr/local/Cellar

What ended up solving 'Exactly' the issue... Was uninstalling Hombrew with :

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

as per :https://mac.install.guide/homebrew/5.

then the few other files/ terminal suggests

Then reinstalling homebrew

and sunshine-beta .... :

sudo rm -rf "$(brew --cache --build-from-source sunshine-beta)"
brew tap LizardByte/homebrew
brew install sunshine-beta

THEn Sunshine-beta builds Again with CMake...

@le0-VV
Copy link

le0-VV commented Nov 24, 2024

Yeah that makes sense. ARM version of homebrew is installed to somewhere in /opt. I have x64 version of homebrew installed to /usr/local, maybe that’s why I can get sunshine installed in my x64 environment.

But having to reinstall homebrew twice and change all their paths and whatnot is a pretty massive operation tho…

@00Dchapellebot
Copy link

This discussion on HOMEbrew git provided some insight.
How does one "move HOMEBREW_CELLAR to /usr/local/Cellar" ? #3316

https://github.com/orgs/Homebrew/discussions/3316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed os:macOS OS is macOS
Projects
None yet
Development

No branches or pull requests