Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmake/SetupPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ if(ISAAC_TELEOP_PYTHON_CONFIGURED AND
message(FATAL_ERROR
"This build directory is configured for Python ${ISAAC_TELEOP_PYTHON_CONFIGURED}, "
"but ISAAC_TELEOP_PYTHON_VERSION is now ${ISAAC_TELEOP_PYTHON_VERSION}. The Python "
"version is baked into the CMake cache and the build venv; configure a different "
"build directory instead (cmake -B build-py${ISAAC_TELEOP_PYTHON_VERSION} "
"-DISAAC_TELEOP_PYTHON_VERSION=${ISAAC_TELEOP_PYTHON_VERSION}), or delete this one.")
"version is baked into the CMake cache and the build venv; delete this build "
"directory and configure again with "
"-DISAAC_TELEOP_PYTHON_VERSION=${ISAAC_TELEOP_PYTHON_VERSION}.")
endif()

# Guard to prevent multiple inclusions from overwriting our settings
Expand Down
16 changes: 8 additions & 8 deletions docs/source/getting_started/build_from_source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ Add any other options as ``-D`` flags on the configure line, for example

The Python version is baked into a build directory's CMake cache and its build
venv, so ``ISAAC_TELEOP_PYTHON_VERSION`` cannot be changed on an existing tree —
configuring again with a different value fails with an explanatory error. Give
each version its own directory:
configuring again with a different value fails with an explanatory error. Select
it on the first configure, and delete the tree to switch later:

.. code-block:: bash

cmake -B build-py3.12 -DISAAC_TELEOP_PYTHON_VERSION=3.12
cmake --build build-py3.12 --parallel
cmake -B build -DISAAC_TELEOP_PYTHON_VERSION=3.12
cmake --build build --parallel

This will:

Expand Down Expand Up @@ -260,13 +260,13 @@ The CMake options (defined in root :code-file:`CMakeLists.txt` and :code-file:`c
Examples
~~~~~~~~

Build for a different Python version — each needs its own build directory
(``3.11``, ``3.12``, ``3.13`` are supported):
Build for a different Python version (``3.11``, ``3.12``, ``3.13`` are supported;
delete ``build/`` first if it is already configured for another one):

.. code-block:: bash

cmake -B build-py3.12 -DISAAC_TELEOP_PYTHON_VERSION=3.12
cmake --build build-py3.12 --parallel
cmake -B build -DISAAC_TELEOP_PYTHON_VERSION=3.12
cmake --build build --parallel

Debug build:

Expand Down
6 changes: 3 additions & 3 deletions docs/source/references/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ two build paths therefore never share a directory:
- **classic CMake** → whatever you pass to ``-B``, ``build/`` by convention.
``ISAAC_TELEOP_PYTHON_VERSION`` selects the interpreter (default ``3.11``), and
changing it on an existing tree is rejected with an error rather than silently
reusing the old one — give each version its own directory.
reusing the old one — delete the tree to switch versions.

.. code-block:: bash

cmake -B build
cmake -B build # default 3.11
cmake --build build --parallel
cmake --install build

cmake -B build-py3.12 -DISAAC_TELEOP_PYTHON_VERSION=3.12 # a second version
cmake -B build -DISAAC_TELEOP_PYTHON_VERSION=3.12 # after rm -rf build

- **pip / scikit-build-core** → ``build-wheel/<cache-tag>/`` (e.g.
``build-wheel/cpython-312/``), set by ``build-dir`` in
Expand Down
2 changes: 1 addition & 1 deletion examples/mujoco_xr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ if(NOT _mujoco_probe_rc EQUAL 0)
# example, so it names the exact command. Configure CREATES that
# interpreter, hence the re-configure step in the README.
message(STATUS "mujoco_xr: skipped -- '${Python3_EXECUTABLE}' cannot import mujoco. "
"Install it and re-run cmake --preset with: "
"Install it and re-run cmake -B ${CMAKE_BINARY_DIR} with: "
"uv pip install --python ${Python3_EXECUTABLE} \"mujoco==${_mujoco_declared_pin}\"")
return()
endif()
Expand Down
12 changes: 6 additions & 6 deletions examples/mujoco_xr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,23 +174,23 @@ wheel is there.
```bash
# 1. Configure once to create the build venv. This first pass necessarily
# reports `-- mujoco_xr: skipped ...` — expected, not a failure.
cmake --preset py3.12 -DBUILD_VIZ=ON
cmake -B build -DBUILD_VIZ=ON

# 2. Install mujoco into the interpreter configure just created. `python -m pip`
# does not work: that venv has no pip.
uv pip install --python build/cmake-cpython-312/teleop_build_venv/bin/python "mujoco==3.11.0"
uv pip install --python build/teleop_build_venv/bin/python "mujoco==3.11.0"

# 3. Re-configure. NOW the probe finds mujoco and the example is added.
cmake --preset py3.12 -DBUILD_VIZ=ON
cmake -B build -DBUILD_VIZ=ON

# 4. Build. There is no `cmake --install` step for this example.
cmake --build --preset py3.12 --parallel
cmake --build build --parallel
```

A green build does **not** mean this example compiled. The reliable check:

```bash
cmake --preset py3.12 -DBUILD_VIZ=ON 2>&1 | grep '^-- mujoco_xr:'
cmake -B build -DBUILD_VIZ=ON 2>&1 | grep '^-- mujoco_xr:'
```

The `ON` line names the exact `libmujoco.so.*` that was linked. There is no
Expand Down Expand Up @@ -820,7 +820,7 @@ alpha. No C++ renderer change is needed or wanted for it.
## Tests

```bash
ctest --test-dir build/cmake-cpython-312 -L mujoco_xr --output-on-failure
ctest --test-dir build -L mujoco_xr --output-on-failure
```

| file | covers |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"and project.dependencies) must name one version, and reinstalling recompiles against it: "
"uv pip install --reinstall ./examples/mujoco_xr. (If you hit this from the in-tree ctest "
"path instead, the extension came from the root build: install that same version into "
"build/<preset-dir>/teleop_build_venv/bin/python and re-run cmake --preset.) "
"build/teleop_build_venv/bin/python and re-run cmake -B build.) "
"mjModel* / mjData* pointers cannot cross this boundary otherwise."
)

Expand Down
6 changes: 3 additions & 3 deletions examples/mujoco_xr/tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# file rather than this field.
name = "isaacteleop-examples-mujoco-xr-tests"
version = "0.0.0"
# Pinned because these tests import the ABI-specific _mujoco_xr*.so built by the
# preset's interpreter.
requires-python = "==3.12.*"
# Matches ../pyproject.toml. The ABI match with _mujoco_xr*.so comes from
# CMakeLists.txt passing the build interpreter to `uv run --python`.
requires-python = ">=3.11,<3.14"

[project.optional-dependencies]
dev = [
Expand Down
6 changes: 3 additions & 3 deletions src/python/isaacteleop/rig/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
_CMAKE_CACHE = "CMakeCache.txt"

#: Directories that hold build trees: a hand-made ``cmake -B build``, and the
#: managed preset/wheel trees, which are one level down (``build-cmake/
#: cpython-311``). Only used to sharpen an error message, so an unknown
#: layout costs nothing but a less specific remedy.
#: managed wheel trees, which are one level down (``build-wheel/cpython-311``).
#: Only used to sharpen an error message, so an unknown layout costs nothing
#: but a less specific remedy.
_BUILD_DIRS = ("build", "build-cmake", "build-wheel")


Expand Down
Loading