Emulator Issues #12720
closed[Latest git] Failure to Build on macOS Monterey 12.0.1 [M1 Mac mini]
0%
Description
macOS Monterey 12.0.1 [M1 Mac mini]
Xcode 13.1
HomeBrew installed and fully up to date.
[My brew packages shown at end of issue description]
What's the problem? Describe what went wrong.
Following error while trying to build [via command lien] on macOS.
[Description here]
Set-up:
export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/qt@5/lib"
export CPPFLAGS="-I/opt/homebrew/opt/qt@5/include"
git pull
git submodule
mkdir build && cd build && cmake ..
make -j8
Error:
[100%] Linking CXX executable ../../../Binaries/Dolphin.app/Contents/MacOS/Dolphin
ld: warning: dylib (/opt/homebrew/lib/libhidapi.dylib) was built for newer macOS version (12.0) than being linked (11.0)
-- Fixing up application bundle: /Users/silvan/Build/Games/Dolphin/dolphin/build/Binaries/Dolphin.app
CMake Error at /Users/silvan/Build/Games/Dolphin/dolphin/CMake/DolphinPostprocessBundle.cmake:40 (_message):
otool -l failed: 1
error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool-classic:
can't open file: @rpath/hidapi.framework/Versions/A/hidapi (No such file or
directory)
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.21.3_1/share/cmake/Modules/BundleUtilities.cmake:458 (message)
/opt/homebrew/Cellar/cmake/3.21.3_1/share/cmake/Modules/BundleUtilities.cmake:527 (get_item_rpaths)
/opt/homebrew/Cellar/cmake/3.21.3_1/share/cmake/Modules/BundleUtilities.cmake:649 (set_bundle_key_values)
/opt/homebrew/Cellar/cmake/3.21.3_1/share/cmake/Modules/BundleUtilities.cmake:934 (get_bundle_keys)
/Users/silvan/Build/Games/Dolphin/dolphin/CMake/DolphinPostprocessBundle.cmake:46 (fixup_bundle)
make[2]: *** [Binaries/Dolphin.app/Contents/MacOS/Dolphin] Error 1
make[2]: *** Deleting file `Binaries/Dolphin.app/Contents/MacOS/Dolphin'
make[1]: *** [Source/Core/DolphinQt/CMakeFiles/dolphin-emu.dir/all] Error 2
make: *** [all] Error 2
Installed Homebrew packages:
% brew list
==> Formulae
assimp gettext jasper mpdecimal sdl
boost glew jpeg ninja sdl2
brotli glfw jsoncpp openssl@1.1 sdl2_gfx
ca-certificates glib libb2 pcre sdl2_net
cmake glm libffi pcre2 sqlite
dbus gmp libpng python@3.9 webp
double-conversion hidapi libtiff qt xz
freetype hunspell md4c qt@5 zstd
gdbm icu4c meson readline
Updated by JosJuice about 3 years ago
- Milestone set to Current
- Relates to maintainability changed from No to Yes
- Operating system OS X added
- Operating system deleted (
N/A)
Updated by keegandent almost 3 years ago
Can you try this instead without the other env variables?
git pull && git submodule update --init --recursive
mkdir build && cd build
Qt5_DIR=/opt/homebrew/opt/qt@5/lib/cmake/Qt5 cmake ..
make -j8
This worked on my M1 mini
Updated by merry almost 3 years ago
Locally I do not get this error when using the vendored hidapi in Externals/.
I attempted to reproduce this by installing the macbrew hidapi package with a fresh checkout, as you have done, but was similarly unable to reprooduce this error.
I note however that I do not have a hdiapi.framework framework on my system. If using a framework version of the library is intentional, you would likely have to specify the directory in which this framework can be found to fixup_bundle -- it should be it's 3rd parameter.
Updated by marshmand almost 3 years ago
merry wrote:
Locally I do not get this error when using the vendored hidapi in Externals/.
I attempted to reproduce this by installing the macbrew hidapi package with a fresh checkout, as you have done, but was similarly unable to reprooduce this error.I note however that I do not have a hdiapi.framework framework on my system. If using a framework version of the library is intentional, you would likely have to specify the directory in which this framework can be found to fixup_bundle -- it should be it's 3rd parameter.
Thanks both for your replies..
I was finally able to get it build correctly.
The strange things is/was that cmake was trying to use hidapi from ./Externals/. , but building was still throwing that error...
Eventually, since your replies both pointed to an issue with my setup, I tracked it down to an SDL2 Framework that I had previously installed in "/Llibrary/Frameworks". Deleting this and recreating the dolphin build folder, then running "cmake .." [which used the homebrew installed SDL libraries] then led to a successful build....
I believe this can be closed now..