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 Meta Issue #5361

Closed
4 tasks done
hcorion opened this issue Nov 22, 2018 · 33 comments
Closed
4 tasks done

macOS Meta Issue #5361

hcorion opened this issue Nov 22, 2018 · 33 comments

Comments

@hcorion
Copy link
Member

hcorion commented Nov 22, 2018

Here is a list of the issues that need to get fixed before we can start providing binaries for MacOS:

  • Fix SIGBUS crashes that happen to every commercial game
  • Fix LLVM on MacOS.

Some of the issues that can be solved afterwards:

  • macOS supported controller backend
  • better audio API than OpenAL for macOS.
@Megamouse
Copy link
Contributor

The newest version uses AA_EnableHighDpiScaling. Please test if this is the correct setting or if it needs the variable QT_AUTO_SCREEN_SCALE_FACTOR set manually.

@vit9696
Copy link
Contributor

vit9696 commented Dec 24, 2018

Well, I do not have a HDPI screen nearby, but rpcs3looks fine on a normal screen on macOS, and I believe the change is sane.

@kvark
Copy link
Contributor

kvark commented Mar 20, 2019

@hcorion I just tried building RPCS3 afresh on macOS and running some simple things, like Scogger HD (installed from .pkg) and getting PPU unhandled exceptions right away on start. Is this expected or related to some of the things listed here? If not, I'll investigate further and file issues separately.

@bitsydarel
Copy link

Hi, any updates on this ?

@13xforever
Copy link
Contributor

hcorion is currently busy irl with the education and isn't available, generally speaking.

@gabjauf
Copy link

gabjauf commented Nov 21, 2020

Hello guys,

Have you got any update on the binary status for macOS?
I tried to compile rpcs3 on my Mac but it does not seem to be working for the moment.
I tried the CI script and a custom script on my own.

Vulkan seems to be "working" now (well at least, cmake can find it)

My script 😛:
cmake ../rpcs3/ -DQt5_DIR=$(brew --prefix qt5)/lib/cmake/Qt5 -DWITH_LLVM=OFF -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9 -DUSE_NATIVE_INSTRUCTIONS=OFF -G Ninja && ninja

Tried with clang as well (got some different errors 😝 )

I am not really an expert in Cpp and cmake stuff but with some guidance, I may be able to make it work.
I will try to provide compiling errors as much as I can meanwhile 😉

@gabjauf
Copy link

gabjauf commented Nov 21, 2020

Capture d’écran 2020-11-21 à 17 28 25

@gabjauf
Copy link

gabjauf commented Nov 21, 2020

(this one is from a 3rd party lib)

@AniLeo
Copy link
Member

AniLeo commented Nov 21, 2020

There has been no progress, in fact the Apple code paths may eventually be purged from the code base as Apple moves away from x86

@iMonZ
Copy link

iMonZ commented Aug 20, 2021

macOS's support could be provided by using MoltenVK.

Additionally, the Zink tool can be added for macOS and Linux.

This shouldn't be very hard and would add macOS support for this emulator and would improve the Linux support.

@dio-gh
Copy link
Contributor

dio-gh commented Aug 20, 2021

Zink is an OpenGL implementation over Vulkan, but since we have a decently maintained native OpenGL renderer, I'm fully certain that a Zink backend would not give any benefits, especially on Mac, where Zink targets MoltenVK.

Edit: I forgot that Mac doesn't even support OpenGL 4.3, which is our minimum requirement. So in a way, I suppose Zink would make sense, although no idea why it would be necessarily desirable.

As for MoltenVK, I remember some technical limitations being blockers, but #4996 seemed to have gone peachy, so I'm unsure where it stands now. Maybe someone with an x86 Mac can tell us if the emulator even compiles these days?

Please also consider that Apple is transitioning away to ARM, full force. Mac support would need not just compliance with MoltenVK, but also adjustments made to the recompilers, as despite them technically using LLVM as a backend, as far as I'm aware, lots of x86isms are present in it.

These, along with the highly limited access to Mac hardware, the minimal developer interest, and general hostility Apple seems to be showing against emulators within some spaces of their ecosystem makes them quite a hard sell at the moment for anyone involved.

@malicious
Copy link

Tried compiling v0.0.18 on an x86 mac, dependencies seem fine + stuck on rpcs3:

[ 78%] Building CXX object rpcs3/Emu/CMakeFiles/rpcs3_emu.dir/cache_utils.cpp.o
warning: unknown warning option '-Wdeprecated-copy'; did you mean '-Wdeprecated'?
      [-Wunknown-warning-option]
In file included from [snip]/rpcs3/rpcs3/Emu/cache_utils.cpp:1:
In file included from [snip]/rpcs3/rpcs3/stdafx.h:3:
[snip]/rpcs3/rpcs3/util/types.hpp:529:11: error: unknown type name
      'UnsignedInt'
template <UnsignedInt T>
          ^

Related changes seem to be from 2021-05-22, which isn't too long ago (#4996 is three years ago now)

@nastys nastys mentioned this issue Dec 4, 2021
27 tasks
@f2re
Copy link

f2re commented Dec 5, 2021

Im tried compiling v0.0.19 on MacOS 10.15.7 and have some error:

[ 70%] Built target LLVMX86AsmParser
Scanning dependencies of target rpcs3_emu
[ 70%] Building CXX object rpcs3/Emu/CMakeFiles/rpcs3_emu.dir/cache_utils.cpp.o
warning: unknown warning option '-Wdeprecated-copy'; did you mean '-Wdeprecated'? [-Wunknown-warning-option]
In file included from /Users/meteo/Downloads/rpcs3/rpcs3/Emu/cache_utils.cpp:1:
In file included from /Users/meteo/Downloads/rpcs3/rpcs3/stdafx.h:3:
/Users/meteo/Downloads/rpcs3/rpcs3/util/types.hpp:531:11: error: unknown type name 'UnsignedInt'
template <UnsignedInt T>

@iMonZ
Copy link

iMonZ commented Dec 5, 2021

Could it be that you are using the wrong compiler?

@f2re
Copy link

f2re commented Dec 5, 2021

no, Im using gcc-11 and g++-11, is it wrong version?

@nastys
Copy link
Contributor

nastys commented Dec 5, 2021

Try building the rmacs3 branch of my fork with

export Qt5_DIR="/usr/local/Cellar/qt@5/5.15.2_1/lib/cmake/Qt5"
export CXX=g++-11
export CC=gcc-11
cmake -DUSE_DISCORD_RPC=OFF -DUSE_VULKAN=ON -DUSE_ALSA=OFF -DUSE_PULSE=OFF ../rpcs3/ && make -j8

(Vulkan SDK, molten-vk, and vulkan-headers are required for Vulkan support)

LLVM still doesn't work, though (see #11222).
Also, make sure all submodules are cloned when using my fork.

@iMonZ
Copy link

iMonZ commented Dec 5, 2021

I would love to see a HomeBrew Formula :)

@f2re
Copy link

f2re commented Dec 6, 2021

Try building the rmacs3 branch of my fork with

Thanks, so Im go to next error =)

[ 57%] Building C object 3rdparty/libusb/CMakeFiles/usb-1.0-static.dir/libusb/libusb/os/darwin_usb.c.o
/Users/meteo/Downloads/rpcs3/3rdparty/libusb/libusb/libusb/os/darwin_usb.c: In function 'darwin_handle_transfer_completion':
/Users/meteo/Downloads/rpcs3/3rdparty/libusb/libusb/libusb/os/darwin_usb.c:2151:3: error: variable-sized object may not be initialized
 2151 |   const char *transfer_types[max_transfer_type + 1] = {"control", "isoc", "bulk", "interrupt", "bulk-stream"};
      |   ^~~~~
make[2]: *** [3rdparty/libusb/CMakeFiles/usb-1.0-static.dir/libusb/libusb/os/darwin_usb.c.o] Error 1

I would love to see a HomeBrew Formula :)

something like that?

brew info gcc
gcc: stable 11.2.0 (bottled), HEAD
GNU compiler collection
https://gcc.gnu.org/
/usr/local/Cellar/gcc/11.2.0_3 (2,163 files, 459.7MB) *
  Poured from bottle on 2021-12-05 at 14:11:58
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gcc.rb
License: GPL-3.0-or-later with GCC-exception-3.1
==> Dependencies
Required: gmp ✔, isl ✔, libmpc ✔, mpfr ✔, zstd ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 178,662 (30 days), 385,537 (90 days), 1,428,816 (365 days)
install-on-request: 86,814 (30 days), 180,165 (90 days), 665,290 (365 days)
build-error: 737 (30 days)

@nastys
Copy link
Contributor

nastys commented Dec 6, 2021

Thanks, so Im go to next error =)

[ 57%] Building C object 3rdparty/libusb/CMakeFiles/usb-1.0-static.dir/libusb/libusb/os/darwin_usb.c.o
/Users/meteo/Downloads/rpcs3/3rdparty/libusb/libusb/libusb/os/darwin_usb.c: In function 'darwin_handle_transfer_completion':
/Users/meteo/Downloads/rpcs3/3rdparty/libusb/libusb/libusb/os/darwin_usb.c:2151:3: error: variable-sized object may not be initialized
 2151 |   const char *transfer_types[max_transfer_type + 1] = {"control", "isoc", "bulk", "interrupt", "bulk-stream"};
      |   ^~~~~
make[2]: *** [3rdparty/libusb/CMakeFiles/usb-1.0-static.dir/libusb/libusb/os/darwin_usb.c.o] Error 1

In 3rdparty/libusb/libusb/libusb/os/darwin_usb.c:2151, remove max_transfer_type + 1.

Also, if you get an error about dispatch_block_t being undefined, open 3rdparty/hidapi/hidapi/mac/hid.c and add typedef void* dispatch_block_t; before the first #include.
EDIT: if you get linker errors, update hid.c first.

@f2re
Copy link

f2re commented Dec 7, 2021

So, go next =)

Scanning dependencies of target rpcs3_emu
[ 71%] Building CXX object rpcs3/Emu/CMakeFiles/rpcs3_emu.dir/cache_utils.cpp.o
g++-11: error: unrecognized command-line option '-stdlib=libc++'

@nastys
Copy link
Contributor

nastys commented Dec 7, 2021

That should be comment out in my fork. Are you sure you checked out the rmacs3 branch?

@f2re
Copy link

f2re commented Dec 7, 2021

Are you sure you checked out the rmacs3 branch?

Yeah, 🤦 Im on master branch.

@f2re
Copy link

f2re commented Dec 7, 2021

So, when I'm about to finish, I get a QT error:

[ 96%] Building CXX object rpcs3/rpcs3qt/CMakeFiles/rpcs3_ui.dir/pad_settings_dialog.cpp.o
/Users/meteo/Downloads/rpcs3/rpcs3/rpcs3qt/main_window.cpp: In member function 'bool main_window::Init(bool)':
/Users/meteo/Downloads/rpcs3/rpcs3/rpcs3qt/main_window.cpp:96:29: warning: unused parameter 'with_cli_boot' [-Wunused-parameter]
   96 | bool main_window::Init(bool with_cli_boot)
      |                        ~~~~~^~~~~~~~~~~~~
In file included from /usr/local/Cellar/qt@5/5.15.2_1/lib/QtConcurrent.framework/Headers/qtconcurrentiteratekernel.h:49,
                 from /usr/local/Cellar/qt@5/5.15.2_1/lib/QtConcurrent.framework/Headers/qtconcurrentfilterkernel.h:47,
                 from /usr/local/Cellar/qt@5/5.15.2_1/lib/QtConcurrent.framework/Headers/qtconcurrentfilter.h:47,
                 from /usr/local/Cellar/qt@5/5.15.2_1/lib/QtConcurrent.framework/Headers/QtConcurrent:8,
                 from /Users/meteo/Downloads/rpcs3/rpcs3/rpcs3qt/game_list_frame.cpp:33:
/usr/local/Cellar/qt@5/5.15.2_1/lib/QtConcurrent.framework/Headers/qtconcurrentthreadengine.h:250:50: error: invalid declarator before '*' token
  250 |     ThreadEngineStarter<void>(ThreadEngine<void> *_threadEngine)
      |                                                  ^
/usr/local/Cellar/qt@5/5.15.2_1/lib/QtConcurrent.framework/Headers/qtconcurrentthreadengine.h:250:49: error: expected ')' before '*' token
  250 |     ThreadEngineStarter<void>(ThreadEngine<void> *_threadEngine)
      |                              ~                  ^~
      |                                                 )

This like seems as it already fixed, but in qt 6.1. Any ideas?

@nastys
Copy link
Contributor

nastys commented Dec 7, 2021

You need to replace those Qt headers (see #11222)

@f2re
Copy link

f2re commented Dec 7, 2021

Thank you very much! Im dont know what I must doing to resolve next (maybe last) problem:

[100%] Linking CXX executable ../bin/rpcs3.app/Contents/MacOS/rpcs3
ld: in /Users/meteo/Downloads/rpcs3/3rdparty/ffmpeg/macos/x86_64/libswscale.a(input.o), building for macOS, but linking in object file built for free standing,
collect2: error: ld returned 1 exit status
make[2]: *** [bin/rpcs3.app/Contents/MacOS/rpcs3] Error 1
make[1]: *** [rpcs3/CMakeFiles/rpcs3.dir/all] Error 2
make: *** [all] Error 2

@nastys
Copy link
Contributor

nastys commented Dec 7, 2021

Oh, I forgot that you need to rebuild ffmpeg, replacing the existing .a files (no modifications to the source code are needed).

@f2re
Copy link

f2re commented Dec 8, 2021

Hmm...now I have arch error by hidapi

[100%] Linking CXX executable ../bin/rpcs3.app/Contents/MacOS/rpcs3
Undefined symbols for architecture x86_64:
  "_NSAppKitVersionNumber", referenced from:
      _hid_init in libhidapi-mac.a(hid.c.o)
      _hid_enumerate in libhidapi-mac.a(hid.c.o)
      _hid_open_path in libhidapi-mac.a(hid.c.o)
ld: symbol(s) not found for architecture x86_64

@nastys
Copy link
Contributor

nastys commented Dec 8, 2021

#issuecomment-986430965

@gabjauf
Copy link

gabjauf commented Dec 10, 2021

@f2re Did you manage to build it?

@f2re
Copy link

f2re commented Dec 10, 2021

@gabjauf no, Im trying to fix hid.c problem.

@nastys
Copy link
Contributor

nastys commented Dec 10, 2021

See the edit in the comment I linked

@f2re
Copy link

f2re commented Dec 10, 2021

@nastys, @gabjauf thank you very much! It is work! =) e-e-e-e =)

@Megamouse Megamouse added the In Progress This issue is actively being investigated at the moment. label Dec 10, 2021
@HerrHulaHoop
Copy link

I think some of the issues mentioned in the main issue is fixed. Maybe we can close this issue and @nastys can create a new meta issue to track the work that is still pending.

@Megamouse Megamouse removed the In Progress This issue is actively being investigated at the moment. label Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests