uber-research / ape-x

This repo replicates the results Horgan et al obtained in "Distributed Prioritized Experience Replay"
Apache License 2.0
189 stars 23 forks source link

Build error: ale_interface.hpp: No such file or directory / cannot find -lale #1

Open wookayin opened 6 years ago

wookayin commented 6 years ago

During make inside ape-x/gym_tensorflow, we get the following error.

.//atari/tf_atari.cpp:18:29: fatal error: ale_interface.hpp: No such file or directory
 #include <ale_interface.hpp>
                             ^
compilation terminated.
make: *** [gym_tensorflow.so] Error 1

The ALE header file seems to be like this or this, but it requires additional steps for installation. README should mention this.

Makefile reads:

   ALE := $(shell pwd)/atari-py/atari_py/ale_interface
    FLAGS += -I$(ALE)/src -I$(ALE)/src/controllers -I$(ALE)/src/os_dependent -I$(ALE)/src/environment -I$(ALE)/src/external -L$(ALE)/build

Therefore a simple solution is to have atari-py directory cloned (which is gitignored) inside gym_tensorflow, and build (make) it first. Doing this additional procedure made build successful.

wookayin commented 6 years ago

A note: it should be https://github.com/fps7806/atari-py.git. There is an instruction at https://github.com/uber-research/ape-x/tree/master/gym_tensorflow/atari.

wookayin commented 6 years ago

In my machine, the library file built in ale_interface was libale_c.so, not libale.so. So I renamed it as a work-around; what happens in your environment?

In Makefile:

LDFLAGS += -lale

Original error message:

/usr/bin/ld: cannot find -lale
collect2: error: ld returned 1 exit status
make: *** [gym_tensorflow.so] Error 1
fps7806 commented 6 years ago

Did you follow the other instructions on the README (https://github.com/uber-research/ape-x/tree/master/gym_tensorflow/atari)? One of them disables the build of the libale_c.so and enables libale.so instead.

wookayin commented 6 years ago

Thanks for your help. -D_GLIBCXX_USE_CXX11_ABI=0 did the trick.

Just out of curiosity, why don't you apply these patches on CMakefile on the forked atari-py repo directly?

fps7806 commented 6 years ago

No good reason, I'll add that to the todos