lab
lab copied to clipboard
Installation script for Ubuntu 24
Based on the installation script for earlier Ubuntu versions, I've put together a script for Ubuntu 24. Sharing it here in case it's useful to others:
#!/bin/bash
set -e
apt-get update
apt-get install -y \
build-essential curl freeglut3-dev gettext git libffi-dev libglu1-mesa \
libglu1-mesa-dev libjpeg-dev liblua5.1-0-dev libosmesa6-dev \
libsdl2-dev lua5.1 pkg-config python3-dev \
software-properties-common unzip zip zlib1g-dev g++
apt-get clean
pip install -U pip setuptools wheel
pip install numpy dm-env
wget -q https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64 -O bazelisk
chmod +x bazelisk
mv bazelisk /usr/local/bin/bazel
git clone https://github.com/google-deepmind/lab.git
cd lab
cat > .bazelrc << EOL
build --enable_workspace
build --python_version=PY3
build --action_env=PYTHON_BIN_PATH=$(which python3)
EOL
sed -i '/\[py_binary(/,/\]]/c\
py_binary(\
name = "python_game_py3",\
srcs = ["examples/game_main.py"],\
data = ["//:deepmind_lab.so"],\
main = "examples/game_main.py",\
python_version = "PY3",\
srcs_version = "PY3",\
tags = ["manual"],\
deps = ["@six_archive//:six"],\
)' BUILD
cat > python_system.bzl << 'EOL'
_BUILD_FILE = '''
exports_files(["defs.bzl"])
cc_library(
name = "python_headers",
hdrs = glob(["python3/**/*.h", "numpy3/**/*.h"]),
includes = ["python3", "numpy3"],
visibility = ["//visibility:public"],
)
'''
_GET_PYTHON_INCLUDE_DIR = """
import sys
from distutils.sysconfig import get_python_inc
from numpy import get_include
sys.stdout.write("{}\\n{}\\n".format(get_python_inc(), get_include()))
""".strip()
def _python_repo_impl(repository_ctx):
repository_ctx.file("BUILD", _BUILD_FILE)
result = repository_ctx.execute(["python3", "-c", _GET_PYTHON_INCLUDE_DIR])
if result.return_code:
fail("Failed to run local Python3 interpreter: %s" % result.stderr)
pypath, nppath = result.stdout.splitlines()
repository_ctx.symlink(pypath, "python3")
repository_ctx.symlink(nppath, "numpy3")
python_repo = repository_rule(
implementation = _python_repo_impl,
configure = True,
local = True,
attrs = {"py_version": attr.string(default = "PY3", values = ["PY3"])},
)
EOL
bazel clean --expunge
bazel build -c opt //python/pip_package:build_pip_package --verbose_failures
./bazel-bin/python/pip_package/build_pip_package /tmp/dmlab_pkg
pip install --force-reinstall /tmp/dmlab_pkg/deepmind_lab-*.whl
DEST="$(python3 -c 'import site; print(site.getsitepackages()[0])')/deepmind_lab"
mv "${DEST}/_main/"* "${DEST}/"
rmdir "${DEST}/_main"
cd ..
rm -rf lab
mkdir dmlab_data
cd dmlab_data
pip install Pillow
curl https://bradylab.ucsd.edu/stimuli/ObjectsAll.zip -o ObjectsAll.zip
unzip ObjectsAll.zip
cd OBJECTSALL
python3 << EOM
import os
from PIL import Image
files = [f for f in os.listdir('.') if f.lower().endswith('jpg')]
for i, file in enumerate(sorted(files)):
print(file)
im = Image.open(file)
im.save('../%04d.png' % (i+1))
EOM
cd ..
rm -rf __MACOSX OBJECTSALL ObjectsAll.zip
DMLAB_DATA=$(pwd | sed 's/[\/&]/\\&/g')
sed -i "s|DATASET_PATH = ''|DATASET_PATH = '$DMLAB_DATA'|g" "$DEST/baselab/game_scripts/datasets/brady_konkle_oliva2008.lua"
cd ..
python3 -c "import deepmind_lab; deepmind_lab.Lab('contributed/dmlab30/explore_goal_locations_small', []).reset();"
python3 -c "import deepmind_lab; deepmind_lab.Lab('contributed/dmlab30/psychlab_arbitrary_visuomotor_mapping', []).reset();"
echo "DMLab installed"
Thank you. Can this be added to the README too?
Moreover, I am getting this error when running bazel build -c opt //python/pip_package:build_pip_package --verbose_failures :
Starting local Bazel server (8.2.1) and connecting to it...
WARNING: WORKSPACE support will be removed in Bazel 9 (late 2025), please migrate to Bzlmod, see https://bazel.build/external/migration.
DEBUG: Rule 'bazel_skylib' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-QBRnnk3Oc4y2b3iHEarYo927G5JQ3tgnAuEPvnhxsxk="
DEBUG: Repository bazel_skylib instantiated at:
/home/ashok/lab/WORKSPACE:12:13: in <toplevel>
Repository rule http_archive defined at:
/home/ashok/.cache/bazel/_bazel_ashok/14410d4d18ddbc0fd7b4c6f5921aaf3e/external/bazel_tools/tools/build_defs/repo/http.bzl:392:31: in <toplevel>
WARNING: Download from https://mirror.bazel.build/github.com/glennrp/libpng/archive/v1.6.37.zip failed: class java.io.FileNotFoundException GET returned 404 Not Found
DEBUG: Rule 'com_google_absl' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-mWKtMfTU1AbhJmOLw/OoTz3t/olevLYM/0bYHV+ouOw="
DEBUG: Repository com_google_absl instantiated at:
/home/ashok/lab/WORKSPACE:18:13: in <toplevel>
Repository rule http_archive defined at:
/home/ashok/.cache/bazel/_bazel_ashok/14410d4d18ddbc0fd7b4c6f5921aaf3e/external/bazel_tools/tools/build_defs/repo/http.bzl:392:31: in <toplevel>
INFO: Analyzed target //python/pip_package:build_pip_package (158 packages loaded, 5458 targets configured).
INFO: From Compiling engine/code/tools/lcc/cpp/lex.c [for tool]:
In file included from /usr/include/string.h:535,
from engine/code/tools/lcc/cpp/lex.c:3:
In function 'strncpy',
inlined from 'setsource' at engine/code/tools/lcc/cpp/lex.c:558:3:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
95 | return __builtin___strncpy_chk (__dest, __src, __len,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96 | __glibc_objsize (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~
engine/code/tools/lcc/cpp/lex.c: In function 'setsource':
engine/code/tools/lcc/cpp/lex.c:555:23: note: length computed here
555 | len = strlen(str);
| ^~~~~~~~~~~
INFO: From Compiling png.c:
external/png_archive/png.c: In function 'png_convert_to_rfc1123_buffer':
external/png_archive/pngpriv.h:1749:4: warning: 'number_buf' may be used uninitialized [-Wmaybe-uninitialized]
1749 | png_format_number(buffer, buffer + (sizeof buffer), format, number)
external/png_archive/png.c:757:69: note: in definition of macro 'APPEND_STRING'
757 | # define APPEND_STRING(string) pos = png_safecat(out, 29, pos, (string))
| ^~~~~~
external/png_archive/png.c:759:24: note: in expansion of macro 'PNG_FORMAT_NUMBER'
759 | APPEND_STRING(PNG_FORMAT_NUMBER(number_buf, format, (value)))
| ^~~~~~~~~~~~~~~~~
external/png_archive/png.c:762:7: note: in expansion of macro 'APPEND_NUMBER'
762 | APPEND_NUMBER(PNG_NUMBER_FORMAT_u, (unsigned)ptime->day);
| ^~~~~~~~~~~~~
In file included from external/png_archive/png.h:335,
from external/png_archive/pngpriv.h:386,
from external/png_archive/png.c:14:
external/png_archive/pngpriv.h:1744:33: note: by argument 1 of type 'png_const_charp' {aka 'const char *'} to 'png_format_number' declared here
1744 | PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start,
| ^~~~~~~~~~~~~~~~~
external/png_archive/pngconf.h:287:70: note: in definition of macro 'PNG_FUNCTION'
287 | # define PNG_FUNCTION(type, name, args, attributes) attributes type name args
| ^~~~
external/png_archive/pngpriv.h:1744:1: note: in expansion of macro 'PNG_INTERNAL_FUNCTION'
1744 | PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start,
| ^~~~~~~~~~~~~~~~~~~~~
external/png_archive/png.c:755:12: note: 'number_buf' declared here
755 | char number_buf[5]; /* enough for a four-digit year */
| ^~~~~~~~~~
INFO: From Compiling pngerror.c:
In file included from external/png_archive/pngerror.c:19:
external/png_archive/pngerror.c: In function 'png_warning_parameter_unsigned':
external/png_archive/pngpriv.h:1749:4: warning: 'buffer' may be used uninitialized [-Wmaybe-uninitialized]
1749 | png_format_number(buffer, buffer + (sizeof buffer), format, number)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/png_archive/pngerror.c:259:37: note: in expansion of macro 'PNG_FORMAT_NUMBER'
259 | png_warning_parameter(p, number, PNG_FORMAT_NUMBER(buffer, format, value));
| ^~~~~~~~~~~~~~~~~
external/png_archive/pngerror.c:133:1: note: by argument 1 of type 'png_const_charp' {aka 'const char *'} to 'png_format_number' declared here
133 | png_format_number(png_const_charp start, png_charp end, int format,
| ^~~~~~~~~~~~~~~~~
external/png_archive/pngerror.c:258:9: note: 'buffer' declared here
258 | char buffer[PNG_NUMBER_BUFFER_SIZE];
| ^~~~~~
In file included from external/png_archive/pngerror.c:19:
external/png_archive/pngerror.c: In function 'png_warning_parameter_signed':
external/png_archive/pngpriv.h:1749:4: warning: 'buffer' may be used uninitialized [-Wmaybe-uninitialized]
1749 | png_format_number(buffer, buffer + (sizeof buffer), format, number)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/png_archive/pngerror.c:275:10: note: in expansion of macro 'PNG_FORMAT_NUMBER'
275 | str = PNG_FORMAT_NUMBER(buffer, format, u);
| ^~~~~~~~~~~~~~~~~
external/png_archive/pngerror.c:133:1: note: by argument 1 of type 'png_const_charp' {aka 'const char *'} to 'png_format_number' declared here
133 | png_format_number(png_const_charp start, png_charp end, int format,
| ^~~~~~~~~~~~~~~~~
external/png_archive/pngerror.c:268:9: note: 'buffer' declared here
268 | char buffer[PNG_NUMBER_BUFFER_SIZE];
| ^~~~~~
In file included from external/png_archive/pngerror.c:19:
external/png_archive/pngpriv.h:1749:4: warning: 'buffer' may be used uninitialized [-Wmaybe-uninitialized]
1749 | png_format_number(buffer, buffer + (sizeof buffer), format, number)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/png_archive/pngerror.c:275:10: note: in expansion of macro 'PNG_FORMAT_NUMBER'
275 | str = PNG_FORMAT_NUMBER(buffer, format, u);
| ^~~~~~~~~~~~~~~~~
external/png_archive/pngerror.c:133:1: note: by argument 1 of type 'png_const_charp' {aka 'const char *'} to 'png_format_number' declared here
133 | png_format_number(png_const_charp start, png_charp end, int format,
| ^~~~~~~~~~~~~~~~~
external/png_archive/pngerror.c:268:9: note: 'buffer' declared here
268 | char buffer[PNG_NUMBER_BUFFER_SIZE];
| ^~~~~~
INFO: From Compiling lauxlib.c:
external/lua_archive/lauxlib.c: In function 'luaL_loadfile':
external/lua_archive/lauxlib.c:577:4: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
577 | while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
| ^~~~~
external/lua_archive/lauxlib.c:578:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
578 | lf.extraline = 0;
| ^~
INFO: From Compiling png.c:
external/png_archive/png.c: In function 'png_convert_to_rfc1123_buffer':
external/png_archive/pngpriv.h:1749:4: warning: 'number_buf' may be used uninitialized [-Wmaybe-uninitialized]
1749 | png_format_number(buffer, buffer + (sizeof buffer), format, number)
external/png_archive/png.c:757:69: note: in definition of macro 'APPEND_STRING'
757 | # define APPEND_STRING(string) pos = png_safecat(out, 29, pos, (string))
| ^~~~~~
external/png_archive/png.c:759:24: note: in expansion of macro 'PNG_FORMAT_NUMBER'
759 | APPEND_STRING(PNG_FORMAT_NUMBER(number_buf, format, (value)))
| ^~~~~~~~~~~~~~~~~
external/png_archive/png.c:762:7: note: in expansion of macro 'APPEND_NUMBER'
762 | APPEND_NUMBER(PNG_NUMBER_FORMAT_u, (unsigned)ptime->day);
| ^~~~~~~~~~~~~
In file included from external/png_archive/png.h:335,
from external/png_archive/pngpriv.h:386,
from external/png_archive/png.c:14:
external/png_archive/pngpriv.h:1744:33: note: by argument 1 of type 'png_const_charp' {aka 'const char *'} to 'png_format_number' declared here
1744 | PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start,
| ^~~~~~~~~~~~~~~~~
external/png_archive/pngconf.h:287:70: note: in definition of macro 'PNG_FUNCTION'
287 | # define PNG_FUNCTION(type, name, args, attributes) attributes type name args
| ^~~~
external/png_archive/pngpriv.h:1744:1: note: in expansion of macro 'PNG_INTERNAL_FUNCTION'
1744 | PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start,
| ^~~~~~~~~~~~~~~~~~~~~
external/png_archive/png.c:755:12: note: 'number_buf' declared here
755 | char number_buf[5]; /* enough for a four-digit year */
| ^~~~~~~~~~
INFO: From Compiling ltablib.c:
external/lua_archive/ltablib.c: In function 'addfield':
external/lua_archive/ltablib.c:137:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
137 | if (!lua_isstring(L, -1))
| ^~
external/lua_archive/ltablib.c:140:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
140 | luaL_addvalue(b);
| ^~~~~~~~~~~~~
INFO: From Compiling engine/code/tools/asm/cmdlib.c [for tool]:
engine/code/tools/asm/cmdlib.c: In function 'ExpandPathAndArchive':
engine/code/tools/asm/cmdlib.c:347:45: warning: '__builtin___sprintf_chk' may write a terminating nul past the end of the destination [-Wformat-overflow=]
347 | sprintf (archivename, "%s/%s", archivedir, path);
| ^
In file included from /usr/include/stdio.h:894,
from engine/code/tools/asm/cmdlib.h:39,
from engine/code/tools/asm/cmdlib.c:24:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: '__builtin___sprintf_chk' output 2 or more bytes (assuming 1025) into a destination of size 1024
38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
INFO: From Compiling engine/code/tools/asm/q3asm.c [for tool]:
engine/code/tools/asm/q3asm.c: In function 'ParseExpression':
engine/code/tools/asm/q3asm.c:605:40: warning: '%i' directive writing between 1 and 11 bytes into a region of size between 0 and 1023 [-Wformat-overflow=]
605 | sprintf( expanded, "%s_%i", sym, currentFileIndex );
| ^~
In file included from /usr/include/stdio.h:894,
from engine/code/tools/asm/cmdlib.h:39,
from engine/code/tools/asm/q3asm.c:24:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: '__builtin___sprintf_chk' output between 3 and 1036 bytes into a destination of size 1024
38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
INFO: From Executing genrule @@libxml_archive//:gen_configure:
Checking zlib
Checking lzma
Disabling compression support
Checking headers
Checking types
Checking libraries
Found Python version 3.12
Checking configuration requirements
Enabling multithreaded support
Enabled Schematron support
Disabling ICU support
Enabled Schemas/Relax-NG support
Disabling code coverage for GCC
Done configuring
'config.h' -> 'bazel-out/k8-opt/bin/external/libxml_archive/config.h'
'include/libxml/xmlversion.h' -> 'bazel-out/k8-opt/bin/external/libxml_archive/include/libxml/xmlversion.h'
ERROR: /home/ashok/.cache/bazel/_bazel_ashok/14410d4d18ddbc0fd7b4c6f5921aaf3e/external/glib_archive/BUILD.bazel:1:8: Executing genrule @@glib_archive//:gen_configure failed: (Exit 1): bash failed: error executing Genrule command (from target @@glib_archive//:gen_configure)
(cd /home/ashok/.cache/bazel/_bazel_ashok/14410d4d18ddbc0fd7b4c6f5921aaf3e/sandbox/linux-sandbox/316/execroot/_main && \
exec env - \
PATH=/home/ashok/.cache/bazelisk/downloads/bazelbuild/bazel-8.2.1-linux-x86_64/bin:/home/ashok/miniconda3/bin:/home/ashok/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin \
PYTHON_BIN_PATH=/home/ashok/miniconda3/bin/python3 \
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; ./external/glib_archive/configure --silent --disable-fam --disable-libmount --disable-dtrace --disable-compile-warnings --with-pcre=internal && cp --verbose -- config.h bazel-out/k8-opt/bin/external/glib_archive/config.h&& cp --verbose -- glib/glibconfig.h bazel-out/k8-opt/bin/external/glib_archive/glibconfig.h')
# Configuration: 3e924ca9e264fb23755aa05e145496bf86c6faaa44b0ec6a9865b1281b353add
# Execution platform: @@platforms//host:host
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html)
Target //python/pip_package:build_pip_package failed to build
INFO: Elapsed time: 103.351s, Critical Path: 7.35s
INFO: 372 processes: 32 internal, 340 linux-sandbox.
ERROR: Build did NOT complete successfully
Solution to last error was:
sudo apt install gettext
Error2:
ERROR: /home/ashok/lab/BUILD:825:11: Compiling engine/code/deepmind/headless_osmesa_glimp.c failed: (Exit 1): gcc failed: error executing CppCompile command (from target //:game_lib_headless_osmesa)
(cd /home/ashok/.cache/bazel/_bazel_ashok/14410d4d18ddbc0fd7b4c6f5921aaf3e/sandbox/linux-sandbox/764/execroot/_main && \
exec env - \
PATH=/home/ashok/.cache/bazelisk/downloads/bazelbuild/bazel-8.2.1-linux-x86_64/bin:/home/ashok/miniconda3/bin:/home/ashok/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin \
PWD=/proc/self/cwd \
PYTHON_BIN_PATH=/home/ashok/miniconda3/bin/python3 \
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections -MD -MF bazel-out/k8-opt/bin/_objs/game_lib_headless_osmesa/headless_osmesa_glimp.pic.d '-frandom-seed=bazel-out/k8-opt/bin/_objs/game_lib_headless_osmesa/headless_osmesa_glimp.pic.o' -fPIC -DEIGEN_MPL2_ONLY -D_REENTRANT -DBOTLIB -D_GNU_SOURCE -iquote . -iquote bazel-out/k8-opt/bin -iquote external/lua_archive -iquote bazel-out/k8-opt/bin/external/lua_archive -iquote external/com_google_absl -iquote bazel-out/k8-opt/bin/external/com_google_absl -iquote external/eigen_archive -iquote bazel-out/k8-opt/bin/external/eigen_archive -iquote external/png_archive -iquote bazel-out/k8-opt/bin/external/png_archive -iquote external/zlib_archive -iquote bazel-out/k8-opt/bin/external/zlib_archive -iquote external/jpeg_archive -iquote bazel-out/k8-opt/bin/external/jpeg_archive -iquote external/sdl_system -iquote bazel-out/k8-opt/bin/external/sdl_system -isystem external/eigen_archive -isystem bazel-out/k8-opt/bin/external/eigen_archive -isystem external/png_archive -isystem bazel-out/k8-opt/bin/external/png_archive -isystem external/zlib_archive -isystem bazel-out/k8-opt/bin/external/zlib_archive -isystem external/jpeg_archive -isystem bazel-out/k8-opt/bin/external/jpeg_archive -isystem external/sdl_system/include/SDL2 -isystem bazel-out/k8-opt/bin/external/sdl_system/include/SDL2 '-std=c99' -fno-common -fno-strict-aliasing '-DARCH_STRING="x86_64"' -DSTANDALONE -c engine/code/deepmind/headless_osmesa_glimp.c -o bazel-out/k8-opt/bin/_objs/game_lib_headless_osmesa/headless_osmesa_glimp.pic.o -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"')
# Configuration: 3e924ca9e264fb23755aa05e145496bf86c6faaa44b0ec6a9865b1281b353add
# Execution platform: @@platforms//host:host
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
engine/code/deepmind/headless_osmesa_glimp.c:22:10: fatal error: GL/osmesa.h: No such file or directory
22 | #include <GL/osmesa.h>
| ^~~~~~~~~~~~~
compilation terminated.
Target //python/pip_package:build_pip_package failed to build
INFO: Elapsed time: 10.863s, Critical Path: 10.46s
INFO: 244 processes: 6 action cache hit, 9 internal, 235 linux-sandbox.
ERROR: Build did NOT complete successfully
Solution:
sudo apt-get install libosmesa6-dev
Error 3:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/ashok/miniconda3/lib/python3.12/site-packages/deepmind_lab/__init__.py", line 24, in <module>
import imp
ModuleNotFoundError: No module named 'imp'
Well, no good solution for it since imp is deprecated in py3.12. py3.11 may work.
Error 4:
Failed to open library! - /home/ashok/miniconda3/envs/py310/lib/python3.10/site-packages/deepmind_lab/libdmlab_headless_sw.so
/home/ashok/miniconda3/envs/py310/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-15.so.1)
Traceback (most recent call last):
File "<string>", line 1, in <module>
RuntimeError: Failed to connect RL API
Solution 4:
conda install -n py310 -c conda-forge libstdcxx-ng
@danijar any ideas on the following error (fresh Ubuntu 24 install):
$ bazel build -c opt //python/pip_package:build_pip_package --verbose_failures
Error:
NFO: From Compiling engine/code/botlib/l_precomp.c:
engine/code/botlib/l_precomp.c: In function 'PC_StringizeTokens':
engine/code/botlib/l_precomp.c:479:17: warning: '__builtin_strncat' output may be truncated copying between 0 and 1023 bytes from a string of length 1023 [-Wstringop-truncation]
479 | strncat(token->string, t->string, MAX_TOKEN - strlen(token->string) - 1);
| ^
INFO: From Linking libdmlab_headless_sw.so:
bazel-out/k8-opt/bin/external/lua_archive/_objs/lua/loslib.pic.o:loslib.c:function os_tmpname:(.text.os_tmpname+0x27): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
INFO: From Executing genrule @@libxml_archive//:gen_configure:
./external/libxml_archive/configure: line 15272: python-config: command not found
Checking zlib
Checking lzma
Disabling compression support
Checking headers
Checking types
Checking libraries
Checking configuration requirements
Enabling multithreaded support
Enabled Schematron support
Disabling ICU support
Enabled Schemas/Relax-NG support
Disabling code coverage for GCC
Done configuring
'config.h' -> 'bazel-out/k8-opt/bin/external/libxml_archive/config.h'
'include/libxml/xmlversion.h' -> 'bazel-out/k8-opt/bin/external/libxml_archive/include/libxml/xmlversion.h'
INFO: From Compiling engine/code/botlib/l_precomp.c:
engine/code/botlib/l_precomp.c: In function 'PC_StringizeTokens':
engine/code/botlib/l_precomp.c:479:17: warning: '__builtin_strncat' output may be truncated copying between 0 and 1023 bytes from a string of length 1023 [-Wstringop-truncation]
479 | strncat(token->string, t->string, MAX_TOKEN - strlen(token->string) - 1);
| ^
INFO: From Linking libdmlab_headless_hw.so:
bazel-out/k8-opt/bin/external/lua_archive/_objs/lua/loslib.pic.o:loslib.c:function os_tmpname:(.text.os_tmpname+0x27): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
ERROR: /root/lab/q3map2/BUILD:34:11: Compiling q3map2/libs/picomodel/lwo/pntspols.c failed: (Exit 1): gcc failed: error executing CppCompile command (from target //q3map2:picomodel)
(cd /root/.cache/bazel/_bazel_root/223621a6357e7409f6ff6977f7adb92d/sandbox/linux-sandbox/733/execroot/_main && \
exec env - \
PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-8.3.1-linux-x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
PWD=/proc/self/cwd \
PYTHON_BIN_PATH=/usr/bin/python3 \
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections -MD -MF bazel-out/k8-opt/bin/q3map2/_objs/picomodel/pntspols.d '-frandom-seed=bazel-out/k8-opt/bin/q3map2/_objs/picomodel/pntspols.o' -iquote . -iquote bazel-out/k8-opt/bin -Iq3map2/libs -Wno-error -w -c q3map2/libs/picomodel/lwo/pntspols.c -o bazel-out/k8-opt/bin/q3map2/_objs/picomodel/pntspols.o -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"')
# Configuration: c6cb50a9fd936fee597674e766851f01539d476456b75609f20434efdccb8f03
# Execution platform: @@platforms//host:host
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
q3map2/libs/picomodel/lwo/pntspols.c: In function 'lwGetTags':
q3map2/libs/picomodel/lwo/pntspols.c:535:59: error: passing argument 1 of 'sgetS0' from incompatible pointer type [-Wincompatible-pointer-types]
535 | tlist->tag[ i + tlist->offset ] = sgetS0( &bp );
| ^~~
| |
| char **
In file included from q3map2/libs/picomodel/lwo/pntspols.c:11:
q3map2/libs/picomodel/lwo/lwo2.h:644:31: note: expected 'unsigned char **' but argument is of type 'char **'
644 | char *sgetS0( unsigned char **bp );
| ~~~~~~~~~~~~~~~~^~
Target //python/pip_package:build_pip_package failed to build
INFO: Elapsed time: 327.459s, Critical Path: 47.79s
INFO: 757 processes: 26 internal, 731 linux-sandbox.
ERROR: Build did NOT complete successfully