安装ale_python_interface时遇到make错误

1、

 首先按照https://pypi.org/project/ale-python-interface/0.0.1/ 来安装,直接python3 -m pip

但提示缺少一个头文件ale_c_wrapper.h,报错如下:

1     ale_python_interface/ale_c_wrapper.cpp:1:10: fatal error: ale_c_wrapper.h: No such file or directory
2      #include "ale_c_wrapper.h"
3               ^~~~~~~~~~~~~~~~~
4     compilation terminated.
5     error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
6   

不过这个网上有一个blog写到这个问题,不过他的方法我试了不可以,你们可以试试:https://blog.csdn.net/senjie_wang/article/details/84073823

 

2、

然后按照https://github.com/bbitmaster/ale_python_interface/wiki/Installation-Instructions,来安装。

结果在第一大步的最后一小步,make时出错,报错如下:

 1 MsPacman.cpp:(.text+0x18a): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
 2 MsPacman.cpp:(.text+0x1da): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
 3 MsPacman.cpp:(.text+0x1c2): undefined reference to `StellaEnvironmentWrapper::softReset()'
 4 src/games/supported/NameThisGame.o: In function `NameThisGameSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
 5 NameThisGame.cpp:(.text+0x172): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
 6 NameThisGame.cpp:(.text+0x193): undefined reference to `StellaEnvironmentWrapper::softReset()'
 7 src/games/supported/Pong.o: In function `PongSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
 8 Pong.cpp:(.text+0x152): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
 9 Pong.cpp:(.text+0x173): undefined reference to `StellaEnvironmentWrapper::softReset()'
10 src/games/supported/Pooyan.o: In function `PooyanSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
11 Pooyan.cpp:(.text+0x18a): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
12 Pooyan.cpp:(.text+0x1ab): undefined reference to `StellaEnvironmentWrapper::softReset()'
13 src/games/supported/PrivateEye.o: In function `PrivateEyeSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
14 PrivateEye.cpp:(.text+0x152): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
15 PrivateEye.cpp:(.text+0x173): undefined reference to `StellaEnvironmentWrapper::softReset()'
16 src/games/supported/SpaceInvaders.o: In function `SpaceInvadersSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
17 SpaceInvaders.cpp:(.text+0x192): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
18 SpaceInvaders.cpp:(.text+0x1b3): undefined reference to `StellaEnvironmentWrapper::softReset()'
19 src/games/supported/StarGunner.o: In function `StarGunnerSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
20 StarGunner.cpp:(.text+0x1e2): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
21 StarGunner.cpp:(.text+0x203): undefined reference to `StellaEnvironmentWrapper::softReset()'
22 src/games/supported/Tennis.o: In function `TennisSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
23 Tennis.cpp:(.text+0x1da): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
24 Tennis.cpp:(.text+0x1fb): undefined reference to `StellaEnvironmentWrapper::softReset()'
25 src/games/supported/Tutankham.o: In function `TutankhamSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
26 Tutankham.cpp:(.text+0x1aa): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
27 Tutankham.cpp:(.text+0x1cb): undefined reference to `StellaEnvironmentWrapper::softReset()'
28 src/games/supported/VideoPinball.o: In function `VideoPinballSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
29 VideoPinball.cpp:(.text+0x19a): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
30 VideoPinball.cpp:(.text+0x1bb): undefined reference to `StellaEnvironmentWrapper::softReset()'
31 src/games/supported/YarsRevenge.o: In function `YarsRevengeSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
32 YarsRevenge.cpp:(.text+0x171): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
33 YarsRevenge.cpp:(.text+0x199): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
34 YarsRevenge.cpp:(.text+0x1b9): undefined reference to `StellaEnvironmentWrapper::softReset()'
35 src/games/supported/Zaxxon.o: In function `ZaxxonSettings::setMode(unsigned int, System&, std::unique_ptr<StellaEnvironmentWrapper, std::default_delete<StellaEnvironmentWrapper> >)':
36 Zaxxon.cpp:(.text+0x149): undefined reference to `StellaEnvironmentWrapper::pressSelect(unsigned long)'
37 Zaxxon.cpp:(.text+0x169): undefined reference to `StellaEnvironmentWrapper::softReset()'
38 src/environment/stella_environment.o: In function `StellaEnvironment::getWrapper()':
39 stella_environment.cpp:(.text+0x7ae): undefined reference to `StellaEnvironmentWrapper::StellaEnvironmentWrapper(StellaEnvironment&)'
40 collect2: error: ld returned 1 exit status
41 makefile:149: recipe for target 'ale' failed
42 make: *** [ale] Error 1

 从这个报错中,就可以发现,基本就是StellaEnvironmentWrapper::*   什么什么没有定义。

终于找到相关的文件stella_environment_wrapper.cpp 和 stella_environment_wrapper.hpp

在下载的文件Arcade-Learning-Environment的./src/environment/目录下面。

从下面截图就能发现很奇怪,在make一遍后,相关文件都被编译成.o文件了,却没有stella_environment_wrapper.o文件:

于是打开这个目录里面的module.mk文件:$ vi module.mk

为什么只产生三个.o文件,不生成stella_environment_wrapper.o文件啊。

于是把它改成:

就是多加了一行,生成对应的stella_environment_wrapper.o文件。

然后再返回到Arcade-Learning-Environment目录,然后再执行一遍make。

再执行一遍$ ls,看到当前目录下有libale.so,就成功了

 

OK

done.

 

 

Reference:

https://github.com/bbitmaster/ale_python_interface/issues/7

posted @ 2018-11-28 21:49  哈萨尅  阅读(1462)  评论(0编辑  收藏  举报