facebookresearch / habitat-sim

A flexible, high-performance 3D simulator for Embodied AI research.
https://aihabitat.org/
MIT License
2.56k stars 415 forks source link

problem in install habitat-sim-0.1.5 #965

Closed Pixie8888 closed 2 years ago

Pixie8888 commented 3 years ago

❓ Questions and Help

Hi, I use "git clone -b v0.1.5 https://github.com/facebookresearch/habitat-sim.git". I install it according to https://github.com/facebookresearch/habitat-sim/tree/v0.1.5. When I run "python setup.py install", I encounter the following problem:
############################################# CMake Error at deps/glfw/CMakeLists.txt:206 (message): RandR headers not found; install libxrandr development package

-- Configuring incomplete, errors occurred! See also "/home/yating/habitat-sim/build/CMakeFiles/CMakeOutput.log". See also "/home/yating/habitat-sim/build/CMakeFiles/CMakeError.log". Traceback (most recent call last): File "setup.py", line 382, in include_package_data=True, File "/home/yating/anaconda3/envs/habitat/lib/python3.6/site-packages/setuptools/init.py", line 153, in setup return distutils.core.setup(**attrs) File "/home/yating/anaconda3/envs/habitat/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/home/yating/anaconda3/envs/habitat/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/home/yating/anaconda3/envs/habitat/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/yating/anaconda3/envs/habitat/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/home/yating/anaconda3/envs/habitat/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/home/yating/anaconda3/envs/habitat/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/yating/anaconda3/envs/habitat/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/yating/anaconda3/envs/habitat/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 167, in run cmd = self.call_command('install_lib', warn_dir=0) File "/home/yating/anaconda3/envs/habitat/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 153, in call_command self.run_command(cmdname) File "/home/yating/anaconda3/envs/habitat/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/yating/anaconda3/envs/habitat/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/yating/anaconda3/envs/habitat/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run self.build() File "/home/yating/anaconda3/envs/habitat/lib/python3.6/distutils/command/install_lib.py", line 107, in build self.run_command('build_ext') File "/home/yating/anaconda3/envs/habitat/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/yating/anaconda3/envs/habitat/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "setup.py", line 202, in run self.build_extension(ext) File "setup.py", line 271, in build_extension env=env, File "/home/yating/anaconda3/envs/habitat/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '-H/home/yating/habitat-sim/src', '-Bbuild', '-DBUILD_PYTHON_BINDINGS=ON', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/yating/habitat-sim/build/lib.linux-x86_64-3.6/habitat_sim/_ext', '-DPYTHON_EXECUTABLE=/home/yating/anaconda3/envs/habitat/bin/python', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DBUILD_GUI_VIEWERS=ON', '-DTARGET_HEADLESS=OFF', '-DBUILD_TEST=OFF', '-DBUILD_WITH_BULLET=OFF', '-DBUILD_DATATOOL=OFF', '-DBUILD_WITH_CUDA=OFF']' returned non-zero exit status 1. ###################################

What should I do? (Since I want to install soundspace, and soundspace is dependent on habitat-sim v0.1.5, I have to install this version.)

Pixie8888 commented 3 years ago

After install habitat-lab v0.1.5, I tried to install habitat-sim v0.1.5 again, here is the error:

running install running bdist_egg running egg_info writing habitat_sim.egg-info/PKG-INFO writing dependency_links to habitat_sim.egg-info/dependency_links.txt writing requirements to habitat_sim.egg-info/requires.txt writing top-level names to habitat_sim.egg-info/top_level.txt reading manifest file 'habitat_sim.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'habitat_sim.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext error: [Errno 2] No such file or directory: 'build/compile_commands.json'

In the build folder: image

What should I do? Any suggestion?

erikwijmans commented 3 years ago

RandR headers not found; install libxrandr development package

Looks like you are missing development headers, sudo apt-get install xorg-dev libglu1-mesa-dev should fix that. You will either need to add --cmake to force a cmake or do rm -rf build to pruge the build folder after the install.

AgentEXPL commented 3 years ago

Hi, @erikwijmans The following problem occurs when I install habitat-sim. What should I do to fix this problem?

-- Found Git: /usr/bin/git (found version "2.25.1") CMake Warning at deps/corrade/src/Corrade/CMakeLists.txt:53 (message): Can't match Git version from v0.1.4-204-g2689aee1

-- Found Corrade: /home/zhuhao/OccupancyAnticipation/environments/habitat/habitat-sim/src/deps/corrade/src found components: Containers rc Utility -- Found OpenMP_C: -fopenmp (found version "4.5") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5")
-- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Looking for dlfcn.h -- Looking for dlfcn.h - found -- Looking for execinfo.h -- Looking for execinfo.h - found -- Looking for glob.h -- Looking for glob.h - found -- Looking for inttypes.h -- Looking for inttypes.h - found -- Looking for libunwind.h -- Looking for libunwind.h - not found -- Looking for memory.h -- Looking for memory.h - found -- Looking for pwd.h -- Looking for pwd.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stdlib.h -- Looking for stdlib.h - found -- Looking for string.h -- Looking for string.h - found -- Looking for strings.h -- Looking for strings.h - found -- Looking for sys/stat.h -- Looking for sys/stat.h - found -- Looking for sys/syscall.h -- Looking for sys/syscall.h - found -- Looking for sys/time.h -- Looking for sys/time.h - found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for sys/utsname.h -- Looking for sys/utsname.h - found -- Looking for syscall.h -- Looking for syscall.h - found -- Looking for syslog.h -- Looking for syslog.h - found -- Looking for ucontext.h -- Looking for ucontext.h - found -- Looking for unistd.h -- Looking for unistd.h - found -- Looking for unwind.h -- Looking for unwind.h - found -- Looking for C++ include ext/hash_map -- Looking for C++ include ext/hash_map - found -- Looking for C++ include ext/hash_set -- Looking for C++ include ext/hash_set - found -- Looking for C++ include ext/slist -- Looking for C++ include ext/slist - found -- Looking for C++ include tr1/unordered_map -- Looking for C++ include tr1/unordered_map - found -- Looking for C++ include tr1/unordered_set -- Looking for C++ include tr1/unordered_set - found -- Looking for C++ include unordered_map -- Looking for C++ include unordered_map - found -- Looking for C++ include unordered_set -- Looking for C++ include unordered_set - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of unsigned int16 -- Check size of unsigned int16 - failed -- Check size of u_int16_t -- Check size of u_int16_t - done -- Check size of uint16_t -- Check size of uint16_t - done -- Looking for dladdr -- Looking for dladdr - not found -- Looking for fcntl -- Looking for fcntl - found -- Looking for pread -- Looking for pread - found -- Looking for pwrite -- Looking for pwrite - found -- Looking for sigaction -- Looking for sigaction - found -- Looking for sigaltstack -- Looking for sigaltstack - found -- Performing Test HAVE_NO_DEPRECATED -- Performing Test HAVE_NO_DEPRECATED - Success -- Performing Test HAVE_NO_UNNAMED_TYPE_TEMPLATE_ARGS -- Performing Test HAVE_NO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed -- Looking for snprintf -- Looking for snprintf - found -- Looking for get_static_proc_name in unwind -- Looking for get_static_proc_name in unwind - not found -- Looking for UnDecorateSymbolName in dbghelp -- Looking for UnDecorateSymbolName in dbghelp - not found -- Performing Test HAVE_ATTRIBUTE_ -- Performing Test HAVEATTRIBUTE - Success -- Performing Test HAVE_ATTRIBUTEVISIBILITY_DEFAULT -- Performing Test HAVE_ATTRIBUTEVISIBILITY_DEFAULT - Success -- Performing Test HAVE_ATTRIBUTEVISIBILITY_HIDDEN -- Performing Test HAVE_ATTRIBUTEVISIBILITY_HIDDEN - Success -- Performing Test HAVE_BUILTINEXPECT -- Performing Test HAVEBUILTIN_EXPECT - Success -- Performing Test HAVE___SYNC_VAL_COMPARE_ANDSWAP -- Performing Test HAVESYNC_VAL_COMPARE_AND_SWAP - Success -- Performing Test HAVE_RWLOCK -- Performing Test HAVE_RWLOCK - Failed -- Performing Test HAVEDECLSPEC -- Performing Test HAVEDECLSPEC - Failed -- Performing Test STL_NO_NAMESPACE -- Performing Test STL_NO_NAMESPACE - Failed -- Performing Test STL_STD_NAMESPACE -- Performing Test STL_STD_NAMESPACE - Success -- Performing Test HAVE_USING_OPERATOR -- Performing Test HAVE_USING_OPERATOR - Success -- Performing Test HAVE_NAMESPACES -- Performing Test HAVE_NAMESPACES - Success -- Performing Test HAVE_GCC_TLS -- Performing Test HAVE_GCC_TLS - Success -- Performing Test HAVE_MSVC_TLS -- Performing Test HAVE_MSVC_TLS - Failed -- Performing Test HAVE_CXX11_TLS -- Performing Test HAVE_CXX11_TLS - Success -- Performing Test HAVE_LOCALTIME_R -- Performing Test HAVE_LOCALTIME_R - Success -- Shared libraries disabled -- Looking for ZLIB... -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Checking for module 'zzip-zlib-config' -- No package 'zzip-zlib-config' found -- Found ZLIB: optimized;/usr/lib/x86_64-linux-gnu/libz.so;debug;/usr/lib/x86_64-linux-gnu/libz.so -- Checking for module 'minizip' -- No package 'minizip' found CMake Warning (dev) at /snap/cmake/888/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (rt) does not match the name of the calling package (RT). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): deps/assimp/cmake-modules/FindRT.cmake:19 (find_package_handle_standard_args) deps/assimp/code/CMakeLists.txt:1013 (FIND_PACKAGE) This warning is for project developers. Use -Wno-dev to suppress it.

-- Found rt: /usr/lib/x86_64-linux-gnu/librt.so
-- Enabled importer formats: AMF 3DS AC ASE ASSBIN B3D BVH COLLADA DXF CSM HMP IRRMESH IRR LWO LWS MD2 MD3 MD5 MDC MDL NFF NDO OFF OBJ OGRE OPENGEX PLY MS3D COB BLEND IFC XGL FBX Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF 3MF MMD STEP -- Disabled importer formats: -- Enabled exporter formats: 3DS ASSBIN ASSXML COLLADA OBJ OPENGEX PLY FBX STL X X3D GLTF 3MF ASSJSON STEP -- Disabled exporter formats: -- Found Assimp: assimp
-- Found PythonInterp: /home/zhuhao/anaconda3/envs/oc_an/bin/python (found suitable version "3.7.10", minimum required is "3.6") -- Bindings being generated for python at /home/zhuhao/anaconda3/envs/oc_an/bin/python -- Found PythonInterp: /home/zhuhao/anaconda3/envs/oc_an/bin/python (found version "3.7.10") -- Found PythonLibs: /home/zhuhao/anaconda3/envs/oc_an/lib/libpython3.7m.so -- pybind11 v2.3.0 CMake Error at /snap/cmake/888/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find OpenGL (missing: OPENGL_INCLUDE_DIR) Call Stack (most recent call first): /snap/cmake/888/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) /snap/cmake/888/share/cmake-3.20/Modules/FindOpenGL.cmake:443 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) deps/magnum/CMakeLists.txt:236 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/zhuhao/OccupancyAnticipation/environments/habitat/habitat-sim/build/CMakeFiles/CMakeOutput.log". See also "/home/zhuhao/OccupancyAnticipation/environments/habitat/habitat-sim/build/CMakeFiles/CMakeError.log". Traceback (most recent call last): File "setup.py", line 382, in include_package_data=True, File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/site-packages/setuptools/init.py", line 153, in setup return distutils.core.setup(**attrs) File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/site-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 164, in run cmd = self.call_command('install_lib', warn_dir=0) File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command self.run_command(cmdname) File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/site-packages/setuptools/command/install_lib.py", line 11, in run self.build() File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/distutils/command/install_lib.py", line 107, in build self.run_command('build_ext') File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "setup.py", line 202, in run self.build_extension(ext) File "setup.py", line 271, in build_extension env=env, File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '-H/home/zhuhao/OccupancyAnticipation/environments/habitat/habitat-sim/src', '-Bbuild', '-DBUILD_PYTHON_BINDINGS=ON', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/zhuhao/OccupancyAnticipation/environments/habitat/habitat-sim/build/lib.linux-x86_64-3.7/habitat_sim/_ext', '-DPYTHON_EXECUTABLE=/home/zhuhao/anaconda3/envs/oc_an/bin/python', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DBUILD_GUI_VIEWERS=OFF', '-DTARGET_HEADLESS=ON', '-DBUILD_TEST=OFF', '-DBUILD_WITH_BULLET=OFF', '-DBUILD_DATATOOL=OFF', '-DBUILD_WITH_CUDA=ON']' returned non-zero exit status 1.

erikwijmans commented 3 years ago

To build from source you need development headers for things, running sudo apt install libgl1-mesa-dev (or your distro's equivalent) will get the OpenGL ones.

AgentEXPL commented 3 years ago

To build from source you need development headers for things, running sudo apt install libgl1-mesa-dev (or your distro's equivalent) will get the OpenGL ones.

Thanks a lot! After installing libgl1-mesa-dev, the install (python setup.py install --headless --with-cuda) works as follows.

Using /home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/site-packages Finished processing dependencies for habitat-sim==0.1.5 Processing ./build/deps/magnum-bindings/src/python DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default. pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555. Building wheels for collected packages: magnum Building wheel for magnum (setup.py) ... done Created wheel for magnum: filename=magnum-0.0.0-cp37-cp37m-linux_x86_64.whl size=2123022 sha256=410982c17fa6abbd9e0718fe548d9f5df134b78040f7435adcca9c71c538b112 Stored in directory: /tmp/pip-ephem-wheel-cache-4bxniui7/wheels/08/7e/b8/f366cc92f55daa836fe0e74a149f3989d08a51f096678023c9 Successfully built magnum Installing collected packages: magnum Successfully installed magnum-0.0.0

However, import error occurs as follows. Maybe the reason is that I am trying to install habitat-sim==0.1.5 in a conda environment, as discussed in #956 . What should I do to solve this issue?


Traceback (most recent call last): File "", line 1, in File "/home/zhuhao/OccupancyAnticipation/environments/habitat/habitat-sim/habitat_sim/init.py", line 14, in from habitat_sim import ( File "/home/zhuhao/OccupancyAnticipation/environments/habitat/habitat-sim/habitat_sim/agent/init.py", line 7, in from .agent import File "/home/zhuhao/OccupancyAnticipation/environments/habitat/habitat-sim/habitat_sim/agent/agent.py", line 10, in import magnum as mn File "/home/zhuhao/anaconda3/envs/oc_an/lib/python3.7/site-packages/magnum/init.py", line 28, in from _magnum import ImportError: /lib/x86_64-linux-gnu/libOpenGL.so.0: undefined symbol: _glapi_tls_Current

erikwijmans commented 3 years ago

Seems like this is the same as in https://github.com/facebookresearch/habitat-sim/issues/971

AgentEXPL commented 3 years ago

Since I install the habitat-sim in a server as a customer, I do not have the right to re-install CUDA which needs to uninstall the old version. Previously, I thought the problem is caused by installing habitat-sim in a conda env with unmatched command "python setup.py install --headless --with-cuda". Then, I tried to install habitat-sim in a conda env in the server with "conda install habitat-sim headless -c conda-forge -c aihabitat", but the same issue was occurred. Now I have no idea on what to do. The problem is that when I tried to import habitat_sim in a python file after the install, the following error was shown.

from _magnum import * ImportError: /lib/x86_64-linux-gnu/libOpenGL.so.0: undefined symbol: _glapi_tls_Current

erikwijmans commented 3 years ago

You'll need to talk with the admins for that server. This isn't something that can be fixed at the habitat-sim level as it's caused by a broken OpenGL install

AgentEXPL commented 3 years ago

Thanks for your suggestion and patient guidance.