Skip to content

Use pip package of nanovdb-editor#580

Merged
phapalova merged 6 commits into
openvdb:mainfrom
phapalova:phapalova/editor-pip-deps
Apr 9, 2026
Merged

Use pip package of nanovdb-editor#580
phapalova merged 6 commits into
openvdb:mainfrom
phapalova:phapalova/editor-pip-deps

Conversation

@phapalova

@phapalova phapalova commented Mar 31, 2026

Copy link
Copy Markdown
Contributor
  • Default fVDB build optionally uses nanovdb-editor from pip instead of always building it from source. EDITOR_FORCE and EDITOR_SKIP has been discarded.
  • NanoVDB Editor headers remain pinned to a specific CPM commit.
  • Local editor source builds are now triggered by cmake.define.CPM_nanovdb_editor_SOURCE

Signed-off-by: Petra Hapalova <phapalova@nvidia.com>
@phapalova phapalova requested a review from Copilot March 31, 2026 12:31
@phapalova phapalova requested a review from a team as a code owner March 31, 2026 12:31
@phapalova phapalova requested review from harrism and sifakis March 31, 2026 12:31
@phapalova phapalova added Viewer Issues related to the viewer in fvdb cmake/build Issues related to building and CMake documentation Improvements or additions to documentation labels Mar 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR shifts fVDB’s NanoVDB Editor integration to use CPM-pinned headers at build time while relying on the nanovdb-editor PyPI package for runtime binaries by default, with an opt-in path to build/install the editor from a local source checkout.

Changes:

  • Make nanovdb-editor a required Python dependency (no longer an optional extra).
  • Refactor the CMake NanoVDB Editor fetch/install flow to pin headers via CPM and only build from source when CPM_nanovdb_editor_SOURCE is set.
  • Update build.sh and docs to remove the old editor_skip / editor_force modifiers and document the new local-source override mechanism.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/tests/CMakeLists.txt Removes the NANOVDB_EDITOR_SKIP gating block and leaves the viewer test commented out.
src/cmake/get_nanovdb_editor.cmake Pins editor headers via CPM; detects installed pip package for runtime binaries; builds/install from source only when CPM source override is set.
README.md Documents the new default behavior and local-source override flag.
pyproject.toml Promotes nanovdb-editor from optional extra to required dependency.
docs/installation.rst Updates the source installation command (but still contains outdated viewer-extra guidance elsewhere).
build.sh Removes editor_* modifiers; installs nanovdb-editor via pip on install builds unless a local editor source override is used.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build.sh Outdated
Comment thread docs/installation.rst
Signed-off-by: Petra Hapalova <phapalova@nvidia.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/cmake/get_nanovdb_editor.cmake
Comment thread src/cmake/get_nanovdb_editor.cmake
Comment thread build.sh
Comment thread src/cmake/get_nanovdb_editor.cmake
Signed-off-by: Petra Hapalova <phapalova@nvidia.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

build.sh:363

  • PASS_THROUGH_ARGS is built using printf %q and then later expanded unquoted in the pip ... $PIP_ARGS invocations. %q escaping does not survive bash word-splitting (e.g., paths with spaces will still be split), so -C cmake.define.CPM_nanovdb_editor_SOURCE=/path with spaces will be parsed incorrectly despite the “handling potential spaces safely” comment. Consider switching to a bash array for pip arguments (accumulate tokens into an array and invoke pip with "${args[@]}") instead of a space-delimited string with %q escaping.
    case "$1" in
      -C)
        shift
        if [ "$#" -eq 0 ] || [[ "$1" == -* ]]; then
          echo "Error: -C requires a value argument." >&2
          exit 1
        fi
        record_nanovdb_editor_source_override "$1"
        PASS_THROUGH_ARGS+=" -C $(printf "%q" "$1")"
        is_config_arg_handled=true
        ;;
      -C*)
        record_nanovdb_editor_source_override "${1#-C}"
        PASS_THROUGH_ARGS+=" $(printf "%q" "$1")"
        is_config_arg_handled=true
        ;;
      --config-settings=*)
        record_nanovdb_editor_source_override "${1#--config-settings=}"
        PASS_THROUGH_ARGS+=" $(printf "%q" "$1")"
        is_config_arg_handled=true
        ;;
      --cuda-arch-list=*)
        CUDA_ARCH_LIST_ARG="${1#*=}"
        is_config_arg_handled=true
        ;;
      --cuda-arch-list)
        shift
        CUDA_ARCH_LIST_ARG="$1"
        is_config_arg_handled=true
        ;;
      *)
        # Append other arguments, handling potential spaces safely
        PASS_THROUGH_ARGS+=" $(printf "%q" "$1")"
        ;;
    esac
  fi
  shift
done

NINJA_PATH=$(command -v ninja 2>/dev/null || command -v ninja-build 2>/dev/null)
if [ -n "$NINJA_PATH" ]; then
    CONFIG_SETTINGS+=" --config-settings=cmake.define.CMAKE_MAKE_PROGRAM=$NINJA_PATH"
fi

# Construct PIP_ARGS with potential CMake args and other pass-through args
export PIP_ARGS="--no-build-isolation$CONFIG_SETTINGS$PASS_THROUGH_ARGS"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Petra Hapalova <phapalova@nvidia.com>
Signed-off-by: Petra Hapalova <phapalova@nvidia.com>
phapalova added a commit that referenced this pull request Apr 9, 2026
Prerequisite to pass tests in #580
---------

Signed-off-by: Petra Hapalova <phapalova@nvidia.com>
…deps

Signed-off-by: Petra Hapalova <phapalova@nvidia.com>
@phapalova phapalova enabled auto-merge (squash) April 9, 2026 12:24
@phapalova phapalova merged commit 2d6f7a4 into openvdb:main Apr 9, 2026
38 checks passed
@phapalova phapalova deleted the phapalova/editor-pip-deps branch April 9, 2026 12:30
@swahtz swahtz added this to the v0.5 milestone Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmake/build Issues related to building and CMake documentation Improvements or additions to documentation Viewer Issues related to the viewer in fvdb

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants