zoq / gym_tcp_api

gym tcp api
BSD 3-Clause "New" or "Revised" License
24 stars 17 forks source link

Error running example #1

Closed kris-singh closed 7 years ago

kris-singh commented 7 years ago

I am using ubuntu 14.04. The installation of the server went fine. It was listening on port 4040. But when running ./example from build directory. terminate called after throwing an instance of 'boost::system::system_error' what(): Connection refused netstat output: Aborted (core dumped) tcp 0 0 0.0.0.0:4040 0.0.0.0:* LISTEN 6623/beam.smp

zoq commented 7 years ago

Hello, do you run your own server instance? If that's the case, can you make sure line 17 in example.cpp matches your settings e.g. instead of const std::string host = "kurg.org"; you can use: const std::string host = "127.0.0.1";. Let me know if that helps.

kris-singh commented 7 years ago

@zoq some linking errors while recompiling example cpp. I think needs the libboost mt links which are not present with newest libboost. should i do something like this.

zoq commented 7 years ago

Can you test it with: cmake -DBoost_USE_MULTITHREADED=OFF ../?

kris-singh commented 7 years ago

Yes that is not helping. There is still linker error with something like this undefined reference to `boost::iostreams::detail::zlib_base::reset(bool, bool)'

zoq commented 7 years ago

Okay, I thought the error has something to do with boost thread. Anyway, the zlib support isn't necessary, but before I write some code, that checks for the zlib support maybe that also works:

  1. Install
apt-get install zlib1g
apt-get install zlib1g-dev
  1. Add -lz in CMakeLists.txt in line 7 and 8
    SET(CMAKE_CXX_FLAGS "-std=c++11 -O3 -fPIC -ffast-math -lz ${CMAKE_CXX_FLAGS}")
    SET(CMAKE_C_FLAGS "-std=c99 -O3 -lz ${CMAKE_C_FLAGS}")
kris-singh commented 7 years ago

@zoq This finally works. I have the basic version for gym that did not have the space invader enviorment. Changed it to Cartpole env it renders fine.

zoq commented 7 years ago

Great, I'll update the CMakeList.txt accordingly.