openai / procgen

Procgen Benchmark: Procedurally-Generated Game-Like Gym-Environments
https://openai.com/blog/procgen-benchmark/
MIT License
991 stars 207 forks source link

Is there a way to remove QT dependency if not needed when build? #77

Closed YukunJ closed 2 years ago

YukunJ commented 2 years ago

Hello: I am currently use Procgen in my project as a third-party dependency. However, I ran into small problem as it requires the QT module to be pre-installed. But I am not using Procgen in the "interactive" way. The following is my current bazel-build file.

    // part of my workspace file
    maybe(
        http_archive,
        name = "procgen",
        sha256 = "8d443b7b8fba44ef051b182e9a87abfa4e05292568e476ca1e5f08f9666a1b72",
        strip_prefix = "procgen-0.10.7/procgen/src/",
        urls = [
            "https://github.com/openai/procgen/archive/refs/tags/0.10.7.zip"
        ],
        build_file = "//third_party/procgen:procgen.BUILD",
    )

//third_party/procgen:procgen.BUILD
package(default_visibility = ["//visibility:public"])
cc_library(
    name = "procgen",
    srcs = glob(["*.cpp", "games/*.cpp"]),
    hdrs = glob(["*.h"]),
)

But it won't compile right now as it couldn't find the QT library. I am wondering: I) is it possible to dynamically link the QT library to the Procgen without pre-install? II) Is there a version of Procgen that does not rely on QT GUI, purely backend? Or where could I possibly just edit the Procgen file to remove those functionality related to QT GUI (is this possible?) Thanks!

YukunJ commented 2 years ago

Solved

jordan-schneider commented 2 years ago

How did you resolve this?

YukunJ commented 2 years ago

actually I didn't quite solve the problem I envisioned, i.e. I didn't remove all the lines and functions about the QT library, although I don't need it.

Instead, I just use (https://github.com/justbuchanan/bazel_rules_qt) with a few patches to make the import header file consistent and move on.