sail-sg / envpool

C++-based high-performance parallel environment execution engine (vectorized env) for general RL environments.
https://envpool.readthedocs.io
Apache License 2.0
1.09k stars 100 forks source link

[BUG] Build from source failed #267

Closed awefwse closed 1 year ago

awefwse commented 1 year ago

Describe the bug

Build from source failed, report error: "no such package '@qt//': The repository's path is "/usr/include/qt" (absolute: "/usr/include/qt") but this directory does not exist".

To Reproduce

Follow the step of building from source here

sudo apt install -y npm
npm install -g @bazel/bazelisk

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt install -y gcc-9 g++-9 build-essential
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9

sudo apt install -y python3-dev python3-pip
sudo ln -sf /usr/bin/python3 /usr/bin/python

cd envpool
cp third_party/pip_requirements/requirements-release.txt third_party/pip_requirements/requirements.txt
bazel run --config=release //:setup -- bdist_wheel

Expected behavior

successful built package

Error message

INFO: Repository boost instantiated at:
  /home/amos/Downloads/envpool-main/WORKSPACE:5:11: in <toplevel>
  /home/amos/Downloads/envpool-main/envpool/workspace0.bzl:266:10: in workspace
  /home/amos/.cache/bazel/_bazel_amos/4db76edca152ef25a49687f18931ac7a/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule http_archive defined at:
  /home/amos/.cache/bazel/_bazel_amos/4db76edca152ef25a49687f18931ac7a/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
ERROR: /home/amos/.cache/bazel/_bazel_amos/4db76edca152ef25a49687f18931ac7a/external/procgen/BUILD.bazel:18:11: @procgen//:procgen depends on @qt//:qt_core in repository @qt which failed to fetch. no such package '@qt//': The repository's path is "/usr/include/qt" (absolute: "/usr/include/qt") but this directory does not exist.
ERROR: /home/amos/.cache/bazel/_bazel_amos/4db76edca152ef25a49687f18931ac7a/external/procgen/BUILD.bazel:18:11: @procgen//:procgen depends on @qt//:qt_gui in repository @qt which failed to fetch. no such package '@qt//': The repository's path is "/usr/include/qt" (absolute: "/usr/include/qt") but this directory does not exist.
ERROR: Analysis of target '//:setup' failed; build aborted: 
INFO: Elapsed time: 403.517s
INFO: 0 processes.
ERROR: Build failed. Not running target
FAILED: Build did NOT complete successfully (92 packages loaded, 4272 targets \
configured)
    Fetching repository @vizdoom; starting
    Fetching ...f25a49687f18931ac7a/external/vizdoom; Extracting 1.1.13.tar.gz
    Fetching https://github.com/opencv/opencv/archive/refs/tags/4.7.0.tar.gz
    Fetching https://github.com/.../download/v0.12.1/freedoom-0.12.1.zip
    Fetching https://github.com/.../2.2.1/mujoco-2.2.1-linux-x86_64.tar.gz
    Fetching https://boostorg.jfrog.io/.../1.81.0/source/boost_1_81_0.tar.bz2

System info

>>> print(envpool.__version__, numpy.__version__, sys.version, sys.platform)
0.8.2 1.22.4 3.8.10 | packaged by conda-forge | (default, May 11 2021, 07:01:05) 
[GCC 9.3.0] linux

Additional context

Add any other context about the problem here.

Reason and Possible fixes

If you know or suspect the reason for this bug, paste the code lines and suggest modifications.

Checklist

awefwse commented 1 year ago

Error seems to be qt package missing? I tried to install qt5 but didn't make any difference.

awefwse commented 1 year ago

System info is here:

PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

I also tried to install on ubuntu 20.04 in VirtualBox, but same error occured.

Trinkle23897 commented 1 year ago

could you try make docker-dev and build from source from that docker? All environment setup is documented in dockerfile: https://github.com/sail-sg/envpool/tree/main/docker

awefwse commented 1 year ago

The problem magically goes away when I try to use make bazel-build to build.

mavenlin commented 1 year ago

I remember running into this problem myself . I suspect the problem should go away equally if you installed qt and do a bazel clean --expunge. The reason install qt doesn't solve the issue is the @qt repo was already pointed to a wrong place in your previous bazel run.