Closed nsklaus closed 2 years ago
https://github.com/shiiion/dolphin/wiki/Frequently-Asked-Questions#what-platforms-is-primehack-on
To reiterate, neither me or shio can develop on MacOS. Even if you were to fix these errors, you would not have mouse support as there doesn't exist any mouse implementation for MacOS. We have absolutely no way of maintaining Mac support. Therefore, you are entirely on your own if you wish to pursue this.
The 2nd log tells you your problem, x is unavailable: introduced in macOS 10.15
which suggests your buildtools (or OS) is too old of a version. Try updating them and using the latest C++ standard if possible.
If you discover any problem and fix it, we're open to pull requests, but that's the most we can offer. If you want to discuss this further, I recommend joining our Discord.
I’ll leave this opened but marked as a wontfix.
since it has been reopened i would like to add, i was able to pass that moltenvk error, and also those error: 'path' is unavailable: introduced in macOS 10.15
.
i added this to the cmakelist.txt file:
# set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14.0" CACHE STRING "")
set (CMAKE_OSX_DEPLOYMENT_TARGET "12.0" CACHE STRING "Minimum OS X deployment version" FORCE)
set (CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Architectures" FORCE)
set (CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET[arch=x86_64] "12.0" CACHE STRING "arm 64 minimum deployment target" FORCE)
i also tried to change from x86_64 with arm64. result is always the same. it compile up to 100% then fails on final step:
[100%] Linking CXX executable ../../../Binaries/Dolphin.app/Contents/MacOS/Dolphin
Undefined symbols for architecture x86_64:
"_win_w", referenced from:
RenderWidget::event(QEvent*) in RenderWidget.cpp.o
"_win_h", referenced from:
RenderWidget::event(QEvent*) in RenderWidget.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Source/Core/DolphinQt/CMakeFiles/dolphin-emu.dir/build.make:11186: Binaries/Dolphin.app/Contents/MacOS/Dolphin] Error 1
make[1]: *** [CMakeFiles/Makefile2:2546: Source/Core/DolphinQt/CMakeFiles/dolphin-emu.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
i tried full stack x86_84 (using rosetta2 for the terminal, then x86_64 homebrew install, and qt5.12.12 from official site).
i also tried full stack arm64 (arm64 homebrew for llvm, python, cmale, make ..)
in both cases i end up there with those:Undefined symbols for architecture x86_64 / amr64: "_win_w", "_win_h"
maybe i should try with qt6 now.
This is due to the fact win_w
and win_h
are defined within a mouse class. DInputMouseAbsolute
on Windows. XInput2Mouse
on Linux. I'm honestly surprised it seems to have made it so far without errors.
This should resolve that error. https://github.com/shiiion/dolphin/commit/f82de185aa2365eb34b6567e67d37e3ae40f0fb4
@SirMangler
thank you for your message, that's nice because i wasn't able to build qt6 from sources (not enough memory error, process took 44gb and macos refused to continue) so i was out of options and ideas.
i modified Source/Core/DolphinQt/RenderWidget.cpp as you told, i also did make clean
and rm -fr ./*
in build directory, and i ran again cmake ..
then make -j5
but unfortunately the end result was the same.
[100%] Linking CXX executable ../../../Binaries/Dolphin.app/Contents/MacOS/Dolphin
Undefined symbols for architecture x86_64:
"_win_w", referenced from:
RenderWidget::event(QEvent*) in RenderWidget.cpp.o
"_win_h", referenced from:
RenderWidget::event(QEvent*) in RenderWidget.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Binaries/Dolphin.app/Contents/MacOS/Dolphin] Error 1
make[1]: *** [Source/Core/DolphinQt/CMakeFiles/dolphin-emu.dir/all] Error 2
make: *** [all] Error 2
[ build ] ⍉
>
here's my RenderWidget.cpp: (from line 454 to 471)
case QEvent::Resize:
{
#if defined(CIFACE_USE_WIN32) || defined(CIFACE_USE_XLIB)
const QResizeEvent* se = static_cast<QResizeEvent*>(event);
QSize new_size = se->size();
QScreen* screen = window()->windowHandle()->screen();
const auto dpr = screen->devicePixelRatio();
// Window Centre for PrimeHack mouselock.
win_w = (new_size.width() * dpr) / 2;
win_h = (new_size.height() * dpr) / 2;
emit SizeChanged(new_size.width() * dpr, new_size.height() * dpr);
#endif
break;
}
but unfortunately this wasn't enough. however, i noticed two lines above (451-452): https://github.com/shiiion/dolphin/blob/f82de185aa2365eb34b6567e67d37e3ae40f0fb4/Source/Core/DolphinQt/RenderWidget.cpp#L451-L452
so possibly there's still more references to correct for this problem.
i applied same treatement for those two lines above (451-452) and now i was able to finish compiling primehack.
Consolidate compiler generated dependencies of target dolphin-emu
[ 85%] Building CXX object Source/Core/DolphinQt/CMakeFiles/dolphin-emu.dir/RenderWidget.cpp.o
Copying OS X content Binaries/Dolphin.app/Contents/Frameworks/libMoltenVK.dylib
[ 85%] Linking CXX executable ../../../Binaries/Dolphin.app/Contents/MacOS/Dolphin
-- Fixing up application bundle: /Users/klaus/Sources/dolphin/build/Binaries/Dolphin.app
/Dolphin.app: No such file or directory
/Dolphin.app: No such file or directory
[100%] Built target dolphin-emu
[ build ]
>
i can run it, application starts. i see the modifications this project brought (in settings, i see primehack specific panels) i'm also greeted by a popup saying this is inital run and i'm highly recommended to choose default settings for controller and so on. so that part is good. however, when i try to start any game it immediately crash and quit. to note, normal dolphin runs fine on the same hardware/system/environment. i'm also able to build normal dolphin from sources and it runs fine, even when using my own builds i can play games. i'm playing resident evil 0, 1 and 2 through normal dolphin. i wanted to play metroid prime too but gamecube controls for this game is not enjoyable. i wanted to have controller both stick to work in the usual fashion for FPS. (one stick to lookaround and the other stick for movement). also to note, all the games i currently have are gamecube ones. so to recap: app compiles and runs, but immediately crash upon starting a game.
i don't know if it will be of any help, but i have a crashlog: Dolphin-2022-04-20-121406.log
hold on, i just tried to build a normal dolphin from sources, and i see the same problem. i bet it's a moltenvk issue. something must have changed on their side. i will investigate. but since this project and normal doplhin now are on par, i think it's fine to consider that with the minors changes needed as seen in this issue, it's enough to get primehack to compile fine on mac too.
using this patch here: https://github.com/KhronosGroup/MoltenVK/issues/573#issuecomment-483427224 i'm able to compile the normal dolphin from source and have it run games. i tried to replicate that with primehack, but i fail at it so far. result is like before: app start, UI is usable, but everything crashes if i try to launch a game.
i modified Source/Core/DolphinQt/RenderWidget.cpp as you told
I wasn't telling you to do anything, I only sent the commit link to show you there's a new commit, you can simply update your repository with git pull
assuming you used cloned the repository. If you didn't use git, you can redownload the latest source code.
but unfortunately this wasn't enough. however, i noticed two lines above (451-452):
so possibly there's still more references to correct for this problem.
Whoops, great job on me for missing that part. I pushed an update to cover that one too.
but everything crashes if i try to launch a game.
Sometimes on Windows, going between two dolphin versions can corrupt the video cache in strange ways causing crashes. You could try isolating or clearing your settings.
i deleted settings directory, on macos it's on ~/Library/Application Support/Dolphin/
apparently.
when i started primehack after that, i once again was greeted with the first run popup.
but result was the same. i also tried to use the libmoltenvk.dylib created by the compilation of normal dolphin, that works well and i copied it over in primehack's app bundle in: ~/Sources/dolphin/build/Binaries/Dolphin.app/Contents/Frameworks/libMoltenVK.dylib
but that didn't help either.
here's the crashlog if it's of any help. meanwhile i'll continue investigating but i'm kind of running out of ideas.. Dolphin-2022-04-21-120418.log
Thread 18 Crashed:: Emuthread - Starting
0 Dolphin 0x1050c4145 SerialInterface::UpdateDevices() + 373
1 Dolphin 0x1050c7c5a VideoInterface::Update(unsigned long long) + 506
As is stated in the crash log, the thread that crashed was last running UpdateDevices, where we update our own mouse input device. This is not implemented for MacOS, and needs to be if it is to work on that platform.
@vyuuui i see.. thanks for telling. i'm out of luck for the time being then. at least now i know.
@vyuuui i see.. thanks for telling. i'm out of luck for the time being then. at least now i know.
Try compiling the newest changes.
https://github.com/shiiion/dolphin/commit/b414e7b3072cc684117c6b4b046f93ea497e0003
Following the discussion in this thread, I was able to build PrimeHack on a base M1 device and launch an Echoes GameCube ROM with no crash. Naturally, the mouse input doesn't work.
I would be interested in trying to implement an input API class for macOS. My expertise skews more toward data science, so I am not used to working this close to the metal and may need some pointers. But given the limited scope, I'd love to take a stab at it.
I am curious whether we could leverage XQuartz such that we could just re-use the existing XInput2Mouse
implementation. That's the direction I'll be trying first.
While I personally discourage the requirement of third party software being installed to be able to use this, if it allows you to quickly push out something that can be tested then go ahead. If possible, it should work with the native quartz API, which has been implemented here.
I created a mostly functional build by more or less recycling the code in that file. There's still a few hiccups I'm working to iron out, but as a proof of concept it's basically ready to go. I'll create a PR when I have time over the next few days.
@nsklaus ToT should have this dealt with, give it a try.
i have a macbookpro M1 from 2020, macos version is "monterey 12.3.1 (21E258)". i tried the two types of build, both failed. here's what i got:
build type 1 (single binary)
build type 2 (universal)
i've installed qt5 from brew (
brew install qt@5
) i do not have python2, and available python3 seems to match with../BuildMacOSUniversalBinary.py
which have header:both build seems to fail at moltenvk build step.