git clone --branch stable https://github.com/facebookresearch/habitat-sim.git
cd habitat-sim
pip install . --no-build-isolation-
You can also allow pip to compile a specific version of Habitat. First clone the repo, then
pip install . --no-build-isolationin the current git root directory to start the compilation process. To quickly compile the latest main, runpip install git+https://github.com/facebookresearch/habitat-sim. -
Since pip builds out of tree by default, this process will copy quite a lot of data to your TMPDIR. You can change this location by modifying the TMPDIR env variable. For active development, use an editable install:
pip install -e . --no-build-isolation. -
By default, we build with GUI viewer support and Bullet physics enabled. Override any option via environment variables:
HABITAT_BUILD_GUI_VIEWERS=OFF pip install . --no-build-isolation # headless build (no GUI) HABITAT_WITH_BULLET=OFF pip install . --no-build-isolation # disable Bullet physics HABITAT_WITH_CUDA=ON pip install . --no-build-isolation # enable CUDA
We highly recommend installing a miniconda or Anaconda environment (note: python>=3.9 is required). Once you have Anaconda installed, here are the instructions.
-
Clone this github repository.
# Checkout the latest stable release git clone --branch stable https://github.com/facebookresearch/habitat-sim.git cd habitat-sim
List of stable releases is available here. Main branch contains 'bleeding edge' code and under active development.
-
Install Dependencies
Common
# We require python>=3.12 and cmake>=3.22 conda create -n habitat python=3.12 cmake=3.27 conda activate habitat pip install -r requirements.txtLinux (Tested with Ubuntu 18.04 with gcc 7.4.0)
sudo apt-get update || true # These are fairly ubiquitous packages and your system likely has them already, # but if not, let's get the essentials for EGL support: sudo apt-get install -y --no-install-recommends \ libjpeg-dev libglm-dev libgl1-mesa-glx libegl1-mesa-dev mesa-utils xorg-dev freeglut3-dev
See the github actions and workflow configs for a full list of dependencies that our CI installs on a clean Ubuntu VM. If you run into build errors later, this is a good place to check if all dependencies are installed.
-
Build Habitat-Sim
Default build (includes GUI viewers and Bullet physics)
# Assuming we're still within habitat conda environment pip install . --no-build-isolation
For headless systems (i.e. without an attached display, e.g. in a cluster)
HABITAT_BUILD_GUI_VIEWERS=OFF pip install . --no-build-isolationFor systems with CUDA (to build CUDA features)
HABITAT_WITH_CUDA=ON pip install . --no-build-isolationWith audio sensor via rlr-audio-propagation: To use Audio sensors (Linux only), enable the audio flag via:
HABITAT_WITH_AUDIO=ON pip install . --no-build-isolationNote1: Build options stack via environment variables, e.g. to build in headless mode with CUDA:
HABITAT_BUILD_GUI_VIEWERS=OFF HABITAT_WITH_CUDA=ON pip install . --no-build-isolationNote2: some Linux distributions might require an additional
--userflag to deal with permission issues.Note3: for active development in Habitat, use an editable install (
pip install -e . --no-build-isolation) or./build.shwhich wraps the editable install with convenience flags.Note4: Audio sensor is only available on Linux.
Environment Variable Default Description HABITAT_BUILD_GUI_VIEWERSONBuild GUI viewer applications (set OFFfor headless)HABITAT_WITH_BULLETONEnable Bullet physics simulation HABITAT_WITH_CUDAOFFEnable CUDA support HABITAT_WITH_AUDIOOFFEnable audio sensor (Linux only) HABITAT_LTOOFFEnable link-time optimization HABITAT_BUILD_TESTSOFFBuild C++ tests You can also pass CMake arguments directly via pip's
--config-settings:pip install . --no-build-isolation --config-settings=cmake.define.OPTION=VALUESince
HABITAT_BUILD_GUI_VIEWERSisONby default, the C++viewerandreplayerapplications are compiled alongside the Python bindings in a standard build.- After
pip install .: the executables are installed onPATHasviewerandreplayer. - After
pip install -e .(editable/development builds): convenience symlinks are created atbuild/viewerandbuild/replayerin the repo root. - Standalone CMake (no Python): you can build the C++ apps directly:
cmake -B build -S src \ -DBUILD_GUI_VIEWERS=ON \ -DBUILD_PYTHON_BINDINGS=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake --build build -j$(nproc) # Binaries at: build/utils/viewer/viewer and build/utils/replayer/replayer
- After
-
If your machine has a custom installation location for the nvidia OpenGL and EGL drivers, you may need to manually provide the
EGL_LIBRARYpath to cmake as follows. Add-DEGL_LIBRARY=/usr/lib/x86_64-linux-gnu/nvidia-opengl/libEGL.sovia--config-settings=cmake.define.EGL_LIBRARY=/usr/lib/x86_64-linux-gnu/nvidia-opengl/libEGL.so. When running any executable adjust the environment as follows:LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/nvidia-opengl:${LD_LIBRARY_PATH} examples/example.py. -
By default, the build process uses all cores available on the system to parallelize. On some virtual machines, this might result in running out of memory. You can limit parallelism via:
pip install . --no-build-isolation --config-settings=cmake.define.CMAKE_BUILD_PARALLEL_LEVEL=1 -
Build is tested on Tested with Ubuntu 18.04 with gcc 7.4.0 and MacOS 10.13.6 with Xcode 10 and clang-1000.10.25.5. If you experience compilation issues, please open an issue with the details of your OS and compiler versions.
We also have a dev slack channel, please follow this link to get added to the channel.