stable-retro icon indicating copy to clipboard operation
stable-retro copied to clipboard

Apple silicon build fails

Open FrancoisPgm opened this issue 1 year ago • 12 comments

Issue summary

I followed the instructions to build from source on Apple silicon, but I got a make error :

$ pip install -e .                                                                                              [master]
Obtaining file:///Users/fpaugam/Documents/code/stable-retro
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Collecting gymnasium>=0.27.1 (from stable-retro==0.9.3)
  Using cached gymnasium-0.29.1-py3-none-any.whl.metadata (10 kB)
Collecting pyglet==1.*,>=1.3.2 (from stable-retro==0.9.3)
  Using cached pyglet-1.5.28-py3-none-any.whl.metadata (7.6 kB)
Collecting farama-notifications>=0.0.1 (from stable-retro==0.9.3)
  Using cached Farama_Notifications-0.0.4-py3-none-any.whl (2.5 kB)
Collecting numpy>=1.21.0 (from gymnasium>=0.27.1->stable-retro==0.9.3)
  Using cached numpy-1.26.3-cp310-cp310-macosx_11_0_arm64.whl.metadata (61 kB)
Collecting cloudpickle>=1.2.0 (from gymnasium>=0.27.1->stable-retro==0.9.3)
  Using cached cloudpickle-3.0.0-py3-none-any.whl.metadata (7.0 kB)
Collecting typing-extensions>=4.3.0 (from gymnasium>=0.27.1->stable-retro==0.9.3)
  Using cached typing_extensions-4.9.0-py3-none-any.whl.metadata (3.0 kB)
Using cached pyglet-1.5.28-py3-none-any.whl (1.1 MB)
Using cached gymnasium-0.29.1-py3-none-any.whl (953 kB)
Using cached cloudpickle-3.0.0-py3-none-any.whl (20 kB)
Using cached numpy-1.26.3-cp310-cp310-macosx_11_0_arm64.whl (14.0 MB)
Using cached typing_extensions-4.9.0-py3-none-any.whl (32 kB)
Building wheels for collected packages: stable-retro
  Building editable for stable-retro (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building editable for stable-retro (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [509 lines of output]
      running editable_wheel
      creating /private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-wheel-2_ye8dt1/.tmp-7nsiopmf/stable_retro.egg-info
      writing /private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-wheel-2_ye8dt1/.tmp-7nsiopmf/stable_retro.egg-info/PKG-INFO
      writing dependency_links to /private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-wheel-2_ye8dt1/.tmp-7nsiopmf/stable_retro.egg-info/dependency_links.txt
      writing requirements to /private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-wheel-2_ye8dt1/.tmp-7nsiopmf/stable_retro.egg-info/requires.txt
      writing top-level names to /private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-wheel-2_ye8dt1/.tmp-7nsiopmf/stable_retro.egg-info/top_level.txt
      writing manifest file '/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-wheel-2_ye8dt1/.tmp-7nsiopmf/stable_retro.egg-info/SOURCES.txt'
      reading manifest file '/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-wheel-2_ye8dt1/.tmp-7nsiopmf/stable_retro.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files matching '*.o' found anywhere in distribution
      warning: no previously-included files matching '*.a' found anywhere in distribution
      warning: no previously-included files matching '*.dylib' found anywhere in distribution
      warning: no previously-included files matching '*.so' found anywhere in distribution
      warning: no previously-included files matching '*-version' found under directory 'retro/cores'
      adding license file 'LICENSE'
      adding license file 'LICENSES.md'
      writing manifest file '/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-wheel-2_ye8dt1/.tmp-7nsiopmf/stable_retro.egg-info/SOURCES.txt'
      creating '/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-wheel-2_ye8dt1/.tmp-7nsiopmf/stable_retro-0.9.3.dist-info'
      creating /private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-wheel-2_ye8dt1/.tmp-7nsiopmf/stable_retro-0.9.3.dist-info/WHEEL
      running build_py
      running build_ext
      CMake Warning:
        Ignoring empty string ("") provided on the command line.


      CMake Warning:
        Ignoring empty string ("") provided on the command line.


      CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.

        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.


      -- The C compiler identification is AppleClang 15.0.0.15000100
      -- The CXX compiler identification is AppleClang 15.0.0.15000100
      -- 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 Python: /Users/fpaugam/Documents/code/stable-retro/env/bin/python3 (found suitable version "3.10.5", minimum required is "3") found components: Interpreter Development.Module
      -- Found ZLIB: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libz.tbd (found version "1.2.12")
      -- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
      warningDetected Apple Silicon, skipping gambatte (gb)
      CMake Deprecation Warning at third-party/capnproto/c++/CMakeLists.txt:2 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.

        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.


      -- Looking for C++ include initializer_list
      -- Looking for C++ include initializer_list - found
      CMake Warning (dev) at third-party/capnproto/c++/CMakeLists.txt:30 (option):
        Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
        --help-policy CMP0077" for policy details.  Use the cmake_policy command to
        set the policy and suppress this warning.

        For compatibility with older versions of CMake, option is clearing the
        normal variable 'CAPNP_LITE'.
      This warning is for project developers.  Use -Wno-dev to suppress it.

      CMake Warning at CMakeLists.txt:306 (message):
        Could not find CapnProto, disabling search save/load


      CMake Deprecation Warning at third-party/gtest/googlemock/CMakeLists.txt:46 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.

        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.


      CMake Deprecation Warning at third-party/gtest/googletest/CMakeLists.txt:53 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.

        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.


      CMake Warning (dev) at third-party/gtest/googletest/cmake/internal_utils.cmake:213 (find_package):
        Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
        are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
        the cmake_policy command to set the policy and suppress this warning.

      Call Stack (most recent call first):
        third-party/gtest/googletest/CMakeLists.txt:65 (include)
      This warning is for project developers.  Use -Wno-dev to suppress it.

      -- Found PythonInterp: /Users/fpaugam/Documents/code/stable-retro/env/bin/python (found version "3.10.5")
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
      -- Found Threads: TRUE
      -- Configuring done (1.2s)
      -- Generating done (0.1s)
      -- Build files have been written to: /Users/fpaugam/Documents/code/stable-retro
      [  3%] Generating retro/cores/picodrive-version
      [  6%] Generating retro/cores/mednafen_pce_fast-version
      [  6%] Generating retro/cores/mgba-version
      [  6%] Generating retro/cores/genesis_plus_gx-version
      [  6%] Generating retro/cores/mednafen_saturn-version
      [ 10%] Generating retro/cores/stella-version
      [ 10%] Generating retro/cores/fceumm-version
      [ 13%] Generating retro/cores/snes9x-version
      [ 26%] Generating retro/cores/mednafen_pce_fast.json
      [ 26%] Generating retro/cores/stella.json
      [ 26%] Generating retro/cores/genesis_plus_gx.json
      [ 26%] Generating retro/cores/mgba.json
      [ 30%] Generating retro/cores/fceumm.json
      [ 33%] Generating retro/cores/snes9x.json
      [ 33%] Generating retro/cores/mednafen_pce_fast_libretro.dylib
      [ 36%] Generating retro/cores/mednafen_saturn.json
      [ 43%] Generating retro/cores/mgba_libretro.dylib
      [ 43%] Generating retro/cores/picodrive.json
      [ 46%] Generating retro/cores/genesis_plus_gx_libretro.dylib
      [ 53%] Generating retro/cores/stella_libretro.dylib
      [ 53%] Generating retro/cores/snes9x_libretro.dylib
      [ 53%] Generating retro/cores/fceumm_libretro.dylib
      [ 56%] Generating retro/cores/mednafen_saturn_libretro.dylib
      [ 60%] Generating retro/cores/picodrive_libretro.dylib
      make[4]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
      make[4]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
      make[4]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
      make[4]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
      make[4]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
      make[4]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
      make[4]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      make[4]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      Error copying file "mgba_libretro.so" to "/Users/fpaugam/Documents/code/stable-retro/retro/cores/mgba_libretro.dylib".
      make[3]: *** [retro/cores/mgba_libretro.dylib] Error 1
      make[2]: *** [CMakeFiles/gba.dir/all] Error 2
      make[2]: *** Waiting for unfinished jobs....
      Error copying file "fceumm_libretro.so" to "/Users/fpaugam/Documents/code/stable-retro/retro/cores/fceumm_libretro.dylib".
      make[3]: *** [retro/cores/fceumm_libretro.dylib] Error 1
      make[2]: *** [CMakeFiles/nes.dir/all] Error 2
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      core/cart_hw/svp/ssp16.c:602:20: warning: cast to smaller integer type 'unsigned int' from 'unsigned short *' [-Wpointer-to-int-cast]
        if (!(d & 2) && (GET_PPC_OFFS() == 0x800 || GET_PPC_OFFS() == 0x1851E)) {
                         ^~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:222:25: note: expanded from macro 'GET_PPC_OFFS'
      #define GET_PPC_OFFS() ((unsigned int)PC - (unsigned int)svp->iram_rom - 2)
                              ^~~~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:602:20: warning: cast to smaller integer type 'unsigned int' from 'unsigned char *' [-Wpointer-to-int-cast]
        if (!(d & 2) && (GET_PPC_OFFS() == 0x800 || GET_PPC_OFFS() == 0x1851E)) {
                         ^~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:222:44: note: expanded from macro 'GET_PPC_OFFS'
      #define GET_PPC_OFFS() ((unsigned int)PC - (unsigned int)svp->iram_rom - 2)
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:602:47: warning: cast to smaller integer type 'unsigned int' from 'unsigned short *' [-Wpointer-to-int-cast]
        if (!(d & 2) && (GET_PPC_OFFS() == 0x800 || GET_PPC_OFFS() == 0x1851E)) {
                                                    ^~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:222:25: note: expanded from macro 'GET_PPC_OFFS'
      #define GET_PPC_OFFS() ((unsigned int)PC - (unsigned int)svp->iram_rom - 2)
                              ^~~~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:602:47: warning: cast to smaller integer type 'unsigned int' from 'unsigned char *' [-Wpointer-to-int-cast]
        if (!(d & 2) && (GET_PPC_OFFS() == 0x800 || GET_PPC_OFFS() == 0x1851E)) {
                                                    ^~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:222:44: note: expanded from macro 'GET_PPC_OFFS'
      #define GET_PPC_OFFS() ((unsigned int)PC - (unsigned int)svp->iram_rom - 2)
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:697:13: warning: cast to smaller integer type 'unsigned int' from 'unsigned short *' [-Wpointer-to-int-cast]
          switch (GET_PPC_OFFS()) {
                  ^~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:222:25: note: expanded from macro 'GET_PPC_OFFS'
      #define GET_PPC_OFFS() ((unsigned int)PC - (unsigned int)svp->iram_rom - 2)
                              ^~~~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:697:13: warning: cast to smaller integer type 'unsigned int' from 'unsigned char *' [-Wpointer-to-int-cast]
          switch (GET_PPC_OFFS()) {
                  ^~~~~~~~~~~~~~
      core/cart_hw/svp/ssp16.c:222:44: note: expanded from macro 'GET_PPC_OFFS'
      #define GET_PPC_OFFS() ((unsigned int)PC - (unsigned int)svp->iram_rom - 2)
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      6 warnings generated.
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      core/cd_hw/libchdr/deps/zlib/adler32.c:63:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      uLong ZEXPORT adler32_z(adler, buf, len)
                    ^
      core/cd_hw/libchdr/deps/zlib/adler32.c:134:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      uLong ZEXPORT adler32(adler, buf, len)
                    ^
      core/cd_hw/libchdr/deps/zlib/adler32.c:143:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      local uLong adler32_combine_(adler1, adler2, len2)
                  ^
      core/cd_hw/libchdr/deps/zlib/adler32.c:172:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      uLong ZEXPORT adler32_combine(adler1, adler2, len2)
                    ^
      core/cd_hw/libchdr/deps/zlib/adler32.c:180:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
                    ^
      5 warnings generated.
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      core/cd_hw/libchdr/deps/zlib/inffast.c:50:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      void ZLIB_INTERNAL inflate_fast(strm, start)
                         ^
      1 warning generated.
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      core/cd_hw/libchdr/deps/zlib/inflate.c:105:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      local int inflateStateCheck(strm)
                ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:119:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateResetKeep(strm)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:144:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateReset(strm)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:157:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateReset2(strm, windowBits)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:195:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:239:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateInit_(strm, version, stream_size)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:247:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflatePrime(strm, bits, value)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:278:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      local void fixedtables(state)
                 ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:396:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      local int updatewindow(strm, end, copy)
                ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:622:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflate(strm, flush)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1277:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateEnd(strm)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1291:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1314:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1349:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateGetHeader(strm, head)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1377:16: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      local unsigned syncsearch(have, buf, len)
                     ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1400:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateSync(strm)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1451:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateSyncPoint(strm)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1461:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateCopy(dest, source)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1508:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateUndermine(strm, subvert)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1526:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZEXPORT inflateValidate(strm, check)
                  ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1541:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      long ZEXPORT inflateMark(strm)
                   ^
      core/cd_hw/libchdr/deps/zlib/inflate.c:1554:23: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      unsigned long ZEXPORT inflateCodesUsed(strm)
                            ^
      22 warnings generated.
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      core/cd_hw/libchdr/deps/zlib/inftrees.c:32:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
                        ^
      1 warning generated.
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      core/cd_hw/libchdr/deps/zlib/zutil.c:133:22: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      const char * ZEXPORT zError(err)
                           ^
      core/cd_hw/libchdr/deps/zlib/zutil.c:305:22: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
                           ^
      core/cd_hw/libchdr/deps/zlib/zutil.c:315:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      void ZLIB_INTERNAL zcfree (opaque, ptr)
                         ^
      3 warnings generated.
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      core/tremor/sharedbook.c:215:6: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
                                       abs(b->quantlist[index]),&point);
                                       ^
      core/tremor/sharedbook.c:215:6: note: use function 'labs' instead
                                       abs(b->quantlist[index]),&point);
                                       ^~~
                                       labs
      core/tremor/sharedbook.c:249:6: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
                                       abs(b->quantlist[j*b->dim+k]),&point);
                                       ^
      core/tremor/sharedbook.c:249:6: note: use function 'labs' instead
                                       abs(b->quantlist[j*b->dim+k]),&point);
                                       ^~~
                                       labs
      2 warnings generated.
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
      Error copying file "genesis_plus_gx_libretro.so" to "/Users/fpaugam/Documents/code/stable-retro/retro/cores/genesis_plus_gx_libretro.dylib".
      make[3]: *** [retro/cores/genesis_plus_gx_libretro.dylib] Error 1
      make[2]: *** [CMakeFiles/genesis.dir/all] Error 2
      Error copying file "mednafen_pce_fast_libretro.so" to "/Users/fpaugam/Documents/code/stable-retro/retro/cores/mednafen_pce_fast_libretro.dylib".
      make[3]: *** [retro/cores/mednafen_pce_fast_libretro.dylib] Error 1
      make[2]: *** [CMakeFiles/pce.dir/all] Error 2
      Error copying file "stella_libretro.so" to "/Users/fpaugam/Documents/code/stable-retro/retro/cores/stella_libretro.dylib".
      make[3]: *** [retro/cores/stella_libretro.dylib] Error 1
      make[2]: *** [CMakeFiles/atari2600.dir/all] Error 2
      Error copying file "picodrive_libretro.so" to "/Users/fpaugam/Documents/code/stable-retro/retro/cores/picodrive_libretro.dylib".
      make[3]: *** [retro/cores/picodrive_libretro.dylib] Error 1
      make[2]: *** [CMakeFiles/32x.dir/all] Error 2
      Error copying file "snes9x_libretro.so" to "/Users/fpaugam/Documents/code/stable-retro/retro/cores/snes9x_libretro.dylib".
      make[3]: *** [retro/cores/snes9x_libretro.dylib] Error 1
      make[2]: *** [CMakeFiles/snes.dir/all] Error 2
      Error copying file "mednafen_saturn_libretro.so" to "/Users/fpaugam/Documents/code/stable-retro/retro/cores/mednafen_saturn_libretro.dylib".
      make[3]: *** [retro/cores/mednafen_saturn_libretro.dylib] Error 1
      make[2]: *** [CMakeFiles/saturn.dir/all] Error 2
      make[1]: *** [CMakeFiles/retro.dir/rule] Error 2
      make: *** [retro] Error 2
      Traceback (most recent call last):
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 156, in run
          self._create_wheel_file(bdist_wheel)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 345, in _create_wheel_file
          files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 268, in _run_build_commands
          self._run_build_subcommands()
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 295, in _run_build_subcommands
          self.run_command(name)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 62, in run
        File "/Users/fpaugam/.pyenv/versions/3.10.5/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['make', '-j10', 'retro']' returned non-zero exit status 2.
      /private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py:988: _DebuggingTips: Problem in editable installation.
      !!

              ********************************************************************************
              An error happened while installing `stable-retro` in editable mode.

              The following steps are recommended to help debug this problem:

              - Try to install the project normally, without using the editable mode.
                Does the error still persist?
                (If it does, try fixing the problem before attempting the editable mode).
              - If you are using binary extensions, make sure you have all OS-level
                dependencies installed (e.g. compilers, toolchains, binary libraries, ...).
              - Try the latest version of setuptools (maybe the error was already fixed).
              - If you (or your project dependencies) are using any setuptools extension
                or customization, make sure they support the editable mode.

              After following the steps above, if the problem still persists and
              you think this is related to how setuptools handles editable installations,
              please submit a reproducible example
              (see https://stackoverflow.com/help/minimal-reproducible-example) to:

                  https://github.com/pypa/setuptools/issues

              See https://setuptools.pypa.io/en/latest/userguide/development_mode.html for details.
              ********************************************************************************

      !!
        cmd_obj.run()
      Traceback (most recent call last):
        File "/Users/fpaugam/Documents/code/stable-retro/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/fpaugam/Documents/code/stable-retro/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/fpaugam/Documents/code/stable-retro/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 273, in build_editable
          return hook(wheel_directory, config_settings, metadata_directory)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 436, in build_editable
          return self._build_with_temp_dir(
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
          self.run_setup()
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 84, in <module>
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 156, in run
          self._create_wheel_file(bdist_wheel)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 345, in _create_wheel_file
          files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 268, in _run_build_commands
          self._run_build_subcommands()
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 295, in _run_build_subcommands
          self.run_command(name)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/private/var/folders/9m/_2zczvvj299570ck819_q6w00000gn/T/pip-build-env-o7ztoqxf/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 62, in run
        File "/Users/fpaugam/.pyenv/versions/3.10.5/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['make', '-j10', 'retro']' returned non-zero exit status 2.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building editable for stable-retro
Failed to build stable-retro
ERROR: Could not build wheels for stable-retro, which is required to install pyproject.toml-based projects

System information

  • MacOS Sonoma 14.2.1 (23C71)
  • Python 3.10.5
  • retro 0.9.3

FrancoisPgm avatar Jan 18 '24 17:01 FrancoisPgm

Did you ever figure this out :)

durgadarba97 avatar Jul 30 '24 05:07 durgadarba97

Same issue here

kevinleee21 avatar Aug 03 '24 20:08 kevinleee21

same

mode80 avatar Aug 04 '24 17:08 mode80

I don't have a mac so it's hard to repro this problem but I think @zbeucler2018 has one

MatPoliquin avatar Aug 05 '24 02:08 MatPoliquin

I suspect the problem is that the libraries versions are so old that yeah don't support arm cpus. We could add Mac-14 to the CI for testing if we wish

pseudo-rnd-thoughts avatar Aug 05 '24 09:08 pseudo-rnd-thoughts

in CmakeFileLists.txt we already skip the core that doesn't support arm64: if(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") message(warning "Detected Apple Silicon, skipping gambatte (gb)") else() add_core(gb gambatte) endif()

I see errors that it can't copy the cores: Error copying file "mgba_libretro.so" to "/Users/fpaugam/Documents/code/stable-retro/retro/cores/mgba_libretro.dylib". make[3]: *** [retro/cores/mgba_libretro.dylib] Error 1

  @FrancoisPgm Can you check if mgba_libretro.so and or mgba_libretro.dylib was created?

MatPoliquin avatar Aug 06 '24 14:08 MatPoliquin

I think I found the issue but since I don't have a mac I can't test it:

In CmakeFileLists.txt: ".so" should be replaced by ".dylib" for PYEXT_SUFFIX

elseif(APPLE) set(PYEXT_SUFFIX ".so" CACHE STRING "Suffix for Python extension modules") set(DYNLIB_SUFFIX ".dylib" CACHE STRING "Suffix for dynamic libraries")

MatPoliquin avatar Aug 06 '24 14:08 MatPoliquin

I made that edit it in CMakeLists.txt, but it did not fix it for me unfortunately. This isn't blocking me right now, but I've attached the output in case it's helpful. output of pip install -e . .txt

mode80 avatar Aug 06 '24 18:08 mode80

Just to make sure. We need to complete the installation process before trying to run anything right? I cloned the repo and tried to import retro but I haven't been able to complete the installation process yet.

kevinleee21 avatar Aug 06 '24 18:08 kevinleee21

the changes in the CMakeLists.txt didn't change anything for me either

kevinleee21 avatar Aug 06 '24 18:08 kevinleee21

Just to make sure. We need to complete the installation process before trying to run anything right? I cloned the repo and tried to import retro but I haven't been able to complete the installation process yet.

Yes the installation must complete successfully first. Have you done the modifications to CMakeLists.txt on freshly cloned repo?

MatPoliquin avatar Aug 12 '24 07:08 MatPoliquin

@FrancoisPgm Can you check if mgba_libretro.so and or mgba_libretro.dylib was created?

The mgba_libretro.so and mgba_libretro.dylib files don't get created.

FrancoisPgm avatar Aug 12 '24 16:08 FrancoisPgm

For me the reason this failed on my MBP with M3 chip was these lines.

add_custom_command(
    OUTPUT "${TARGET_PATH}"
    COMMAND
      ${CMAKE_COMMAND} -E env CFLAGS=${core_cflags} CXXFLAGS=${core_cxxflags}
      LDFLAGS=${core_ldflags} $(MAKE) -f ${makefile} CC="${CMAKE_C_COMPILER}"
      CXX="${CMAKE_CXX_COMPILER}" fpic=${core_fpic_flags} ${libretro_platform}
    COMMAND ${CMAKE_COMMAND} -E copy "${core_name}_libretro${DYNLIB_SUFFIX}"
            "${TARGET_PATH}"
    WORKING_DIRECTORY "cores/${platform}/${subdir}"
    DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${core_name}-version")
add_custom_command(
    OUTPUT "${TARGET_PATH}"
    COMMAND
      ${CMAKE_COMMAND} -E env CFLAGS=${core_cflags} CXXFLAGS=${core_cxxflags}
      LDFLAGS=${core_ldflags} $(MAKE) -f ${makefile} CC="${CMAKE_C_COMPILER}"
      CXX="${CMAKE_CXX_COMPILER}" fpic=${core_fpic_flags} ${libretro_platform}
    COMMAND ${CMAKE_COMMAND} -E copy "${core_name}_libretro.dylib"
            "${TARGET_PATH}"
    WORKING_DIRECTORY "cores/${platform}/${subdir}"
    DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${core_name}-version")

inside of CMakeLists.txt, I thought that if I properly changed the DYNLIB_SUFFIX like the above comment it would work but this was not the case. To get my installation done I just hardcoded and changed that custom command to the above and it finished. Sorry I really dont know if that fully worked but I just wanted to let everyone know how I got the command pip3 install -e . to finish

Hub3r avatar Sep 05 '24 18:09 Hub3r

Thanks, this helped me make progress.

The issue with the CMakeLists.txt is in the order of the conditions. The APPLE check should come before the UNIX check because macOS is both UNIX-like and Apple. The current order causes the UNIX condition to be true for macOS, so it never reaches the APPLE-specific settings.

Here's the corrected relevant section:

if(APPLE)
  set(PYEXT_SUFFIX
      ".so"
      CACHE STRING "Suffix for Python extension modules")
  set(DYNLIB_SUFFIX
      ".dylib"
      CACHE STRING "Suffix for dynamic libraries")
elseif(UNIX)
  set(PYEXT_SUFFIX
      ".so"
      CACHE STRING "Suffix for Python extension modules")
  set(DYNLIB_SUFFIX
      ".so"
      CACHE STRING "Suffix for dynamic libraries")
elseif(WIN32)
  set(PYEXT_SUFFIX
      ".pyd"
      CACHE STRING "Suffix for Python extension modules" FORCE)
  set(DYNLIB_SUFFIX
      ".dll"
      CACHE STRING "Suffix for dynamic libraries")
else()
  message(FATAL_ERROR "Unsupported platform")
endif()

It still doesn't build for me, but I get further . I'll look to make a pull request when I get to the finish line.

mode80 avatar Sep 28 '24 06:09 mode80

I did get finally this building on MacOs with Apple silicon. Besides fixing the CMakeLists.txt file per above, I also needed to:

  1. fix the error below by removing the "register" keyword from several .cpp files (which I guess was deprecated then removed in C++ 17 ) and
  2. "pip install opencv-python"

But after all that, it works to run python ppo.py --game='Airstriker-Genesis' (yay!)

(mamegym)  % make retro     
[  6%] Built target arcade
[  9%] Generating build/lib.macosx-11.0-arm64-cpython-311/retro/cores/snes9x.json
[ 11%] Generating build/lib.macosx-11.0-arm64-cpython-311/retro/cores/snes9x_libretro.dylib
../cpuexec.cpp:293:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  293 |                 register uint8                          Op;
      |                 ^~~~~~~~
../cpuexec.cpp:294:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  294 |                 register struct SOpcodes        *Opcodes;
      |                 ^~~~~~~~
2 errors generated.
make[4]: *** [../cpuexec.o] Error 1
make[3]: *** [build/lib.macosx-11.0-arm64-cpython-311/retro/cores/snes9x_libretro.dylib] Error 2
make[2]: *** [CMakeFiles/snes.dir/all] Error 2
make[1]: *** [CMakeFiles/retro.dir/rule] Error 2
make: *** [retro] Error 2

To fix above, modify the cpuexec.cpp file to remove the register keyword. e.g. Change these lines:

register uint8 Op;
register struct SOpcodes *Opcodes;

to:

uint8 Op;
struct SOpcodes *Opcodes;

Then run make again and repeat for other .cpp files with the same issue.

mode80 avatar Sep 28 '24 07:09 mode80

I've submitted the pull request. In the meantime, if you're fixing things yourself, you may need to remove CMakeCache.txt if you're alternating between running "make retro" and "pip install -e ." as you go.

mode80 avatar Sep 29 '24 05:09 mode80

@mode80 thanks a lot, I merged your PR. To anyone who had issues on mac please test it and give feedback in this thread if you can

MatPoliquin avatar Sep 29 '24 06:09 MatPoliquin

Hi, I was able to get this as well as Ale-py working on my Mac. Please take a look and install this conda-forge package:Gymnasium Atarianaconda.orgOn Oct 14, 2024, at 7:24 AM, Viktor Danilov @.***> wrote: I'm still getting the same error on master branch. Tested on M1 and M3 Pro.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

durgadarba97 avatar Oct 14 '24 14:10 durgadarba97