Skip to content

Instantly share code, notes, and snippets.

@pierric
Last active June 27, 2017 13:55
Show Gist options
  • Save pierric/91f5e827afdedb22b2ee4460628bb1b7 to your computer and use it in GitHub Desktop.
Save pierric/91f5e827afdedb22b2ee4460628bb1b7 to your computer and use it in GitHub Desktop.
Run atari-rl on windows
  • Install MSYS2 (http://www.msys2.org/)

    • pacman -S base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake
  • Install Anaconda

  • Env

    • conda create --name atari-rl python=3.5
    • activate atari-rl
    • PATH=%PATH%:D:\msys64\mingw64\bin;D:\msys64\usr\bin
      • note, I installed msys64 in D:\msys64
  • atari-py

diff --git a/Makefile b/Makefile
index 5fd410b..2e123b2 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ clean:
        make -C atari_py/ale_interface clean

 package_data:
-       ( echo "ale_interface/build/*.so" && echo "ale_interface/build/ale" && c
d atari_py && git ls-files |grep -v \\.py$ ) > atari_py/package_data.txt
+       ( echo "ale_interface/build/*.dll" && echo "ale_interface/build/ale" &&
cd atari_py && git ls-files |grep -v \\.py$ ) > atari_py/package_data.txt

 upload:
        make clean
diff --git a/atari_py/ale_interface/Makefile b/atari_py/ale_interface/Makefile
index e77c530..0338208 100644
--- a/atari_py/ale_interface/Makefile
+++ b/atari_py/ale_interface/Makefile
@@ -1,7 +1,7 @@
 .PHONY: build clean

 build:
-       mkdir -p build && cd build && cmake .. && make -j4
+       mkdir -p build && cd build && cmake -G "MSYS Makefiles" .. && make -j4

 clean:
        rm -rf build
diff --git a/atari_py/ale_python_interface.py b/atari_py/ale_python_interface.py
index 72425e0..bf2091e 100644
--- a/atari_py/ale_python_interface.py
+++ b/atari_py/ale_python_interface.py
@@ -11,7 +11,7 @@ import os
 import six

 ale_lib = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__),
-                                        'ale_interface/build/libale_c.so'))
+                                        'ale_interface/build/libale_c.dll'))

 ale_lib.ALE_new.argtypes = None
 ale_lib.ALE_new.restype = c_void_p
diff --git a/atari_py/package_data.txt b/atari_py/package_data.txt
index 6d35fff..3324ea6 100644
--- a/atari_py/package_data.txt
+++ b/atari_py/package_data.txt
@@ -1,4 +1,4 @@
-ale_interface/build/*.so
+ale_interface/build/*.dll
 ale_interface/build/ale
 ale_c_wrapper.cpp
 ale_c_wrapper.h
  • atari-rl
    • git clone https://github.com/brendanator/atari-rl
    • git submodule update --init
    • agents/cts is a shortcut of third-party/cts/python/cts, but on windows I have to make it on my own
      • cd agents
      • mklink /J cts ../third-party/cts/python/cts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment