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] Unable to build from source #289

Open HyunyoungJung opened 10 months ago

HyunyoungJung commented 10 months ago

Describe the bug

Hi, I tried to build the source code but failed even though I followed the instructions with the error message.

gcc failed: error executing command (from target //envpool/mujoco:mujoco_dmc_env) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++17' -MD -MF ... (remaining 60 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging gcc: error: envpool/mujoco/dmc/utils.cc: Permission denied gcc: fatal error: no input files compilation terminated. Target //:setup failed to build Use --verbose_failures to see the command lines of failed build steps.

To Reproduce

The same as instruction.

System info

Describe the characteristic of your environment:

import envpool, numpy, sys
print(envpool.__version__, numpy.__version__, sys.version, sys.platform)

Checklist

Trinkle23897 commented 10 months ago

could you repro the same issue inside docker container?

HyunyoungJung commented 10 months ago

Unfortunately, I am not using docker and am not familiar with it. Would there be another way that I can build the source code locally?

Trinkle23897 commented 10 months ago

need to make sure envpool/mujoco/dmc/utils.cc has the correct permission. What does ls -lh envpool/mujoco/dmc/utils.cc give?

HyunyoungJung commented 10 months ago

The permission of the file is -rw-rw-r--

Trinkle23897 commented 10 months ago

could you try BAZELOPT=--verbose_failures make bazel-build? See Makefile for actual command.

HyunyoungJung commented 10 months ago
SHELL          = /bin/bash
PROJECT_NAME   = envpool
PROJECT_FOLDER = $(PROJECT_NAME) third_party examples benchmark
PYTHON_FILES   = $(shell find . -type f -name "*.py")
CPP_FILES      = $(shell find $(PROJECT_NAME) -type f -name "*.h" -o -name "*.cc")
BAZEL_FILES    = $(shell find . -type f -name "*BUILD" -o -name "*.bzl")
COMMIT_HASH    = $(shell git log -1 --format=%h)
COPYRIGHT      = "Garena Online Private Limited"
BAZELOPT       =
DATE           = $(shell date "+%Y-%m-%d")
DOCKER_TAG     = $(DATE)-$(COMMIT_HASH)
DOCKER_USER    = trinkle23897
PATH           := $(HOME)/go/bin:$(PATH)

# installation

check_install = python3 -c "import $(1)" || (cd && pip3 install $(1) --upgrade && cd -)
check_install_extra = python3 -c "import $(1)" || (cd && pip3 install $(2) --upgrade && cd -)

flake8-install:
        $(call check_install, flake8)
        $(call check_install_extra, bugbear, flake8_bugbear)

py-format-install:
        $(call check_install, isort)
        $(call check_install, yapf)

mypy-install:
        $(call check_install, mypy)

cpplint-install:
        $(call check_install, cpplint)

clang-format-install:
        command -v clang-format || sudo apt-get install -y clang-format

clang-tidy-install:
        command -v clang-tidy || sudo apt-get install -y clang-tidy

go-install:
        # requires go >= 1.16
        command -v go || (sudo apt-get install -y golang-1.18 && sudo ln -sf /usr/lib/go-1.18/bin/go /usr/bin/go)

bazel-install: go-install
        command -v bazel || (go install github.com/bazelbuild/bazelisk@latest && ln -sf $(HOME)/go/bin/bazelisk $(HOME)/go/bin/bazel)

buildifier-install: go-install
        command -v buildifier || go install github.com/bazelbuild/buildtools/buildifier@latest

addlicense-install: go-install
        command -v addlicense || go install github.com/google/addlicense@latest

doc-install:
        $(call check_install, pydocstyle)
        $(call check_install_extra, doc8, "doc8<1")
        $(call check_install, sphinx)
        $(call check_install, sphinx_rtd_theme)
        $(call check_install_extra, sphinxcontrib.spelling, sphinxcontrib.spelling pyenchant)

auditwheel-install:
        $(call check_install_extra, auditwheel, auditwheel typed-ast patchelf)