gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
754 stars 175 forks source link

Compiling on MacOS #2707

Open palmerj opened 1 year ago

palmerj commented 1 year ago

To get GLideN64 to compile on MacOS Moneterey 12.5.1 and Xcode 13.1 I had to set the CXX_FLAGS to -std=c++11:

cmake -DMUPENPLUSAPI=On -DCMAKE_CXX_FLAGS=-std=c++11 ../../src/
-- Found Git: /usr/local/bin/git (found version "2.36.1")
-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libz.tbd (found version "1.2.11")
-- Found PNG: /usr/local/lib/libpng.dylib (found version "1.6.37")
-- Found Freetype: /usr/local/lib/libfreetype.dylib (found version "2.12.1")
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework
Interprocedural optimizations enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jpalmer/Documents/Development/mupenplus/GLideN64/projects/cmake

I suspect this can be best fixed in the CMAKE around here

This was because I was getting errors with the use of c++ 11 curly brace variable initialisers in:

/Users/jpalmer/Documents/Development/mupenplus/GLideN64/src/GLideNHQ/TxFilterExport.h:172:18: error: function definition does not declare parameters
  unsigned char *data{ nullptr };
                 ^
/Users/jpalmer/Documents/Development/mupenplus/GLideN64/src/GLideNHQ/TxFilterExport.h:173:16: error: function definition does not declare parameters
  unsigned int width{ 0u };
               ^
/Users/jpalmer/Documents/Development/mupenplus/GLideN64/src/GLideNHQ/TxFilterExport.h:174:16: error: function definition does not declare parameters
  unsigned int height{ 0u };
               ^
/Users/jpalmer/Documents/Development/mupenplus/GLideN64/src/GLideNHQ/TxFilterExport.h:175:16: error: function definition does not declare parameters
  unsigned int format{ 0u };
               ^
/Users/jpalmer/Documents/Development/mupenplus/GLideN64/src/GLideNHQ/TxFilterExport.h:176:18: error: function definition does not declare parameters
  unsigned short texture_format{ 0u };
                 ^
/Users/jpalmer/Documents/Development/mupenplus/GLideN64/src/GLideNHQ/TxFilterExport.h:177:18: error: function definition does not declare parameters
  unsigned short pixel_type{ 0u };
                 ^
/Users/jpalmer/Documents/Development/mupenplus/GLideN64/src/GLideNHQ/TxFilterExport.h:178:17: error: function definition does not declare parameters
  unsigned char is_hires_tex{ 0u };
                ^
/Users/jpalmer/Documents/Development/mupenplus/GLideN64/src/GLideNHQ/TxFilterExport.h:179:17: error: function definition does not declare parameters
  N64FormatSize n64_format_size{ 0u, 0u };
estefan3112 commented 1 year ago

You are a hero! I finally have mupen64puls and GlideN64 running on my Mac M1 mini. Initial testing very promising. Thank you so much!

retropieuser commented 1 year ago

`neil@Neils-Air src % make
[ 3%] Built target osal [ 16%] Built target GLideNHQ [ 17%] Building CXX object CMakeFiles/mupen64plus-video-GLideN64.dir/BufferCopy/ColorBufferToRDRAM.cpp.o /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:9:10: warning: non-portable path to file ''; specified path differs in case from file name on disk [-Wnonportable-include-path]

include

     ^~~~~~~~~~
     <config.h>

/Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:71:7: error: use of undeclared identifier 'config' if ((config.generalEmulation.hacks & hack_subscreen) != 0 && m_pCurFrameBuffer->m_width == VI.width) { ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:71:39: error: use of undeclared identifier 'hack_subscreen' if ((config.generalEmulation.hacks & hack_subscreen) != 0 && m_pCurFrameBuffer->m_width == VI.width) { ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:78:6: error: use of undeclared identifier 'config' if (config.video.multisampling != 0) { ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:88:7: error: use of undeclared identifier 'config' if (config.frameBufferEmulation.nativeResFactor == 0 && m_pCurFrameBuffer->m_scale != 1.0f) { ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:154:6: error: use of undeclared identifier 'config' if (config.generalEmulation.enableDitheringPattern == 0 || config.frameBufferEmulation.nativeResFactor != 1) { ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:154:61: error: use of undeclared identifier 'config' if (config.generalEmulation.enableDitheringPattern == 0 || config.frameBufferEmulation.nativeResFactor != 1) { ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:156:11: error: use of undeclared identifier 'config' switch (config.generalEmulation.rdramImageDitheringMode) { ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:157:8: error: use of undeclared identifier 'Config' case Config::BufferDitheringMode::bdmBayer: ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:158:8: error: use of undeclared identifier 'Config' case Config::BufferDitheringMode::bdmMagicSquare: ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:160:71: error: use of undeclared identifier 'Config' s32 threshold = config.generalEmulation.rdramImageDitheringMode == Config::BufferDitheringMode::bdmBayer ? ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:160:20: error: use of undeclared identifier 'config' s32 threshold = config.generalEmulation.rdramImageDitheringMode == Config::BufferDitheringMode::bdmBayer ? ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:168:8: error: use of undeclared identifier 'Config' case Config::BufferDitheringMode::bdmBlueNoise: ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:239:6: error: use of undeclared identifier 'config' if (config.frameBufferEmulation.copyToRDRAM == Config::CopyToRDRAM::ctDisable && config.frameBufferEmulation.fbInfoDisabled != 0) ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:239:49: error: use of undeclared identifier 'Config' if (config.frameBufferEmulation.copyToRDRAM == Config::CopyToRDRAM::ctDisable && config.frameBufferEmulation.fbInfoDisabled != 0) ^ /Users/neil/desktop/GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp:239:83: error: use of undeclared identifier 'config' if (config.frameBufferEmulation.copyToRDRAM == Config::CopyToRDRAM::ctDisable && config.frameBufferEmulation.fbInfoDisabled != 0) ^ 1 warning and 15 errors generated. make[2]: [CMakeFiles/mupen64plus-video-GLideN64.dir/BufferCopy/ColorBufferToRDRAM.cpp.o] Error 1 make[1]: [CMakeFiles/mupen64plus-video-GLideN64.dir/all] Error 2 make: *** [all] Error 2 `

I'm getting this error, any ideas?

estefan3112 commented 1 year ago

No errors here. Just to be sure, from the directory projects/cmake cmake -DMUPENPLUSAPI=On -DCMAKE_CXX_FLAGS=-std=c++11 ../../src/ and then cmake --build . -j6 Just works with the latest code. Good luck!

retropieuser commented 1 year ago

No errors here. Just to be sure, from the directory projects/cmake cmake -DMUPENPLUSAPI=On -DCMAKE_CXX_FLAGS=-std=c++11 ../../src/ and then cmake --build . -j6 Just works with the latest code. Good luck!

Thanks this got it working. But I've just realised it's built an arm version and I'm using an old mupen64plus that's Intel via Rosetta. Oops! Oh well, guess I need to figure out how to build mupen64plus as arm64 instead of x84?

UI-Console: Searching for plugins at: /Users/neil/Downloads/mupen64plus-bundle-osx-2/mupen64plus.app/Contents/Frameworks/ UI-Console Error: dlopen('/Users/neil/Downloads/mupen64plus-bundle-osx-2/mupen64plus.app/Contents/Frameworks/mupen64plus-video-GLideN64.dylib') failed: dlopen(/Users/neil/Downloads/mupen64plus-bundle-osx-2/mupen64plus.app/Contents/Frameworks/mupen64plus-video-GLideN64.dylib, 0x0002): tried: '/Users/neil/Downloads/mupen64plus-bundle-osx-2/mupen64plus.app/Contents/Frameworks/mupen64plus-video-GLideN64.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/neil/Downloads/mupen64plus-bundle-osx-2/mupen64plus.app/Contents/Frameworks/mupen64plus-video-GLideN64.dylib' (no such file), '/Users/neil/Downloads/mupen64plus-bundle-osx-2/mupen64plus.app/Contents/Frameworks/mupen64plus-video-GLideN64.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) UI-Console Error: Specified Video plugin not found: mupen64plus-video-GLideN64

estefan3112 commented 1 year ago

At your service

https://mameonmacs.blogspot.com/2022/10/off-topic-mupen64plus-on-mac-silicon.html

retropieuser commented 1 year ago

Wow that's excellent thanks for this! It's good that can also build rice as an arm64 file too. Especially given GLideN64 seems to be the only video plugin that Mario Tennis works on. Thanks again, you're a star!

estefan3112 commented 1 year ago

In the above blog post, I included a Shell script for a full mupen64plus install, read the update of today. It will spare you tons of time, the compile will be finished within a minute! Cheers.