openai / retro

Retro Games in Gym
MIT License
3.35k stars 524 forks source link

How can install gym-retro on raspberry pi 4 #242

Closed Jourdelune closed 2 years ago

Jourdelune commented 3 years ago

Hello, I tried pip3 install gym-retro but I get this error: subprocess.CalledProcessError: Command '['/usr/bin/make', '-j4', 'retro']' returned non-zero exit status 2. I have try to pass my raspberry pi to 64bits with CommanderPI but I still have this error.

mapostolidou commented 2 years ago

I had the same issue and if you check the a bit higher at the error message it says

/tmp/pip-install-gbng229c/gym-retro_15b29bd669c34616b183c12cc857ffdc/src/search.cpp:491:51: error: ‘T’ does not name a type
     inline void hash_combine(std::size_t& seed, const T& v) {
                                                       ^
    /tmp/pip-install-gbng229c/gym-retro_15b29bd669c34616b183c12cc857ffdc/src/search.cpp: In function ‘void hash_combine(std::size_t&, const int&)’:
    /tmp/pip-install-gbng229c/gym-retro_15b29bd669c34616b183c12cc857ffdc/src/search.cpp:492:12: error: ‘T’ was not declared in this scope
      std::hash<T> hasher;

This is coming from retro/src/search.cpp lines 479-502. The template<class T> is declared just under the if statement so if the code reaches the elif at line 490 it is out of scope.

This can be solved in two ways:

  1. insert a line after the elif (line 490) and insert template<class T> so that the template is declared even when the code runs from the elif
  2. move the template from line 480 and place it before the if block (a bit riskier to break something later in the code)

I tried the first solution and it worked