Farama-Foundation / stable-retro

Retro games for Reinforcement Learning
https://stable-retro.farama.org/
MIT License
187 stars 39 forks source link

Issue installing from git #127

Open hairymanmex opened 1 month ago

hairymanmex commented 1 month ago

I'm having a problem installing stable retro from the git repository.

I'm able to install stable retro using pip. Although when I try to install from git I get this error.

src/core/config.c: In function ‘mCoreConfigMap’: src/core/config.c:334:47: error: passing argument 3 of ‘_lookupIntValue’ from incompatible pointer type [-Wincompatible-pointer-types] 334 _lookupIntValue(config, "rewindSave", &opts->rewindSave); ^~~~~
_Bool *
  src/core/config.c:82:85: note: expected ‘int *’ but argument is of type ‘_Bool *’
     82 | static bool _lookupIntValue(const struct mCoreConfig* config, const char* key, int* out) {
        |                                                                                ~~~~~^~~
  make[4]: *** [Makefile.libretro:306: src/core/config.o] Error 1
  make[3]: *** [CMakeFiles/gba.dir/build.make:79: build/lib.linux-x86_64-cpython-310/retro/cores/mgba_libretro.so] Error 2
  make[2]: *** [CMakeFiles/Makefile2:556: CMakeFiles/gba.dir/all] Error 2
  make[2]: *** Waiting for unfinished jobs....
  [ 62%] Built target 32x
  make[1]: *** [CMakeFiles/Makefile2:873: CMakeFiles/retro.dir/rule] Error 2
  make: *** [Makefile:485: retro] Error 2
  Traceback (most recent call last):
    File "/home/flippy/.pyenv/versions/3.10.15/envs/test310/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/home/flippy/.pyenv/versions/3.10.15/envs/test310/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 "/home/flippy/.pyenv/versions/3.10.15/envs/test310/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 434, in build_wheel
      return _build(['bdist_wheel', '--dist-info-dir', metadata_directory])
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 422, in _build
      return self._build_with_temp_dir(
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 403, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 516, in run_setup
      super().run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 318, in run_setup
      exec(code, locals())
    File "<string>", line 84, in <module>
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup
      return distutils.core.setup(**attrs)
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 183, in setup
      return run_commands(dist)
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 991, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 407, in run
      self.run_command("build")
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 991, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 991, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-x3b63sni/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
      cmd_obj.run()
    File "<string>", line 62, in run
    File "/home/flippy/.pyenv/versions/3.10.15/lib/python3.10/subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['make', '-j12', '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 wheel 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

I'm running arch linux, python 3.10.15 "although tried version 3.9 to 3.12 and get the same error".

hairymanmex commented 1 month ago

I tried installing an older version of gym-retro and ended up with the same errors.

looking online for similar issues, I found the issue is with gcc version 14.

I did try setting environment variables to gcc-13, but this was unsuccessful

I found I had to install gcc13 and to simlink cc to gcc13.

sudo ln -sf /usr/bin/gcc-13 /usr/bin/cc

I was able to succesfuly install stable retro after this.

I also removed the gcc-13 symlink when I was done, by setting it back to the regular gcc. So I would not run into other system issues later. sudo ln -sf /usr/bin/gcc /usr/bin/cc