Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ViZDoom #4933

Closed
wants to merge 4 commits into from
Closed

add ViZDoom #4933

wants to merge 4 commits into from

Conversation

jbrea
Copy link
Contributor

@jbrea jbrea commented May 23, 2022

No description provided.

V/ViZDoom/build_tarballs.jl Outdated Show resolved Hide resolved
Comment on lines 37 to 38
cp -r bin/* ${libdir}
mv ../src/freedoom2.wad ${libdir}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds wrong. The content of the lib/ directory is

% tar tzvf x86_64-linux-gnu-cxx11-julia_version+1.6.3.tar.gz | grep lib/
-rwxr-xr-x 0/0           19920 1970-01-01 01:00 lib/arithchk
-rw-r--r-- 0/0        28544132 1970-01-01 01:00 lib/freedoom2.wad
-rwxr-xr-x 0/0           76024 1970-01-01 01:00 lib/lemon
-rw-r--r-- 0/0           25628 1970-01-01 01:00 lib/lempar.c
-rw-r--r-- 0/0         1416786 1970-01-01 01:00 lib/libvizdoom.a
-rwxr-xr-x 0/0          717640 1970-01-01 01:00 lib/libvizdoom.so
-rwxr-xr-x 0/0         1696184 1970-01-01 01:00 lib/libvizdoomjl.so
-rwxr-xr-x 0/0           19752 1970-01-01 01:00 lib/qnan
-rwxr-xr-x 0/0          216888 1970-01-01 01:00 lib/re2c
-rwxr-xr-x 0/0           20368 1970-01-01 01:00 lib/updaterevision
-rwxr-xr-x 0/0         5506216 1970-01-01 01:00 lib/vizdoom
-rw-r--r-- 0/0          630827 1970-01-01 01:00 lib/vizdoom.pk3
-rwxr-xr-x 0/0          144904 1970-01-01 01:00 lib/zipdir

There is a mix of shared libraries (only things which should be here), executable binaries (which should go to ${bindir}), source files (which shouldn't be in the tarball at all), files I have no idea what they are (*.wad and *.pk3) and static library (it's ok to have the static library in ${libdir}, but that's just useless for the purpose of calling a library from Julia, so we usually avoid having static libraries around).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I removed most files, but vizdoom.pk3 and freedoom2.wad seem to be needed. Otherwise games won't load.

V/ViZDoom/bundled/ViZDoomJuliaModule.cpp Outdated Show resolved Hide resolved
@giordano
Copy link
Member

The build system assumes you can run executables built for the target platform, which we can't. This is very cross-compilation-unfriendly.

@jbrea
Copy link
Contributor Author

jbrea commented May 23, 2022

Thanks for the review!

The build system assumes you can run executables built for the target platform, which we can't. This is very cross-compilation-unfriendly.

Can I fix this somehow? Note that I use the flag -DCMAKE_CROSSCOMPILING=FALSE, because I couldn't resolve some cmake errors otherwise. But I don't really understand its implications.

@giordano
Copy link
Member

Note that I use the flag -DCMAKE_CROSSCOMPILING=FALSE, because I couldn't resolve some cmake errors otherwise. But I don't really understand its implications.

Well, we are cross-compiling, so that's a blatant lie 🙂

@jbrea
Copy link
Contributor Author

jbrea commented May 23, 2022

Btw. To actually use ViZDoom_jll I have the following lines in ViZDoom.jl

module ViZDoom

using CxxWrap
using ViZDoom_jll

@wrapmodule("libvizdoomjl")

function __init__()
    @initcxx
end

include("util.jl")
export get_scenario_path, set_game

include("games/games.jl")
export basic_game

end # module

Now, when I actually want to run a game I get

~/.julia/artifacts/01f94640f8ea8b00edc310b9f24899fa7811a6ca/lib/vizdoom: error while loading shared libraries: libboost_thread.so.1.76.0: cannot open shared object file: No such file or directory

unless I set my LD_LIBRARY_PATH to the artifact containing libboost 1.76.0. Is there an alternative to setting the LD_LIBRARY_PATH in ViZDoom.jl?

I also get occasionally and seemingly at random the error

C++ exception while wrapping module ViZDoom: invalid subtyping in definition of Label with supertype Any
ERROR: InitError: invalid subtyping in definition of Label with supertype Any
during initialization of module ViZDoom

Don't know if this is related.

@giordano
Copy link
Member

Now, when I actually want to run a game I get

How are you running the program?

@giordano
Copy link
Member

Side note: I quickly skimmed through CMake files of ViZDoom and there are some references to cross-compilation. It sounds like they should support it, but I have no idea how they want to do it. I also don't really have the time to dig into this, so if you want to target all platforms you'll have to do some investigations on your own.

@jbrea
Copy link
Contributor Author

jbrea commented May 23, 2022

How are you running the program?

In a Julia REPL,

julia> using ViZDoom

julia> game = basic_game()

julia> ViZDoom.init(game)

@giordano
Copy link
Member

I wanted to know how you're running the executable. I have no idea what basic_game() and ViZDoom.init(game) do.

@imciner2
Copy link
Member

imciner2 commented Apr 3, 2024

Closing due to inactivity. Please submit a new PR on top of the current master branch if you still want to include this recipe.

@imciner2 imciner2 closed this Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants