pytorch / pytorch/executorch

EXECUTORCH_BUILD_TESTS=ON shouldn't require CMAKE_INSTALL_PREFIX=cmake-out for executorch/schema/program_generated.h

Open
#7,582 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module: build/install triaged
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

🐛 Describe the bug

https://github.com/pytorch/executorch/blob/main/test/run_oss_cpp_tests.sh#L31 sets -DCMAKE_INSTALL_PREFIX=cmake-out . I attempted to use cmake manually, because that should let incremental builds work, and since I wasn't installing anything I left -DCMAKE_INSTALL_PREFIX out, but the build failed:

In file included from /Users/swolchok/src/executorch/runtime/executor/test/tensor_parser_test.cpp:9:
/Users/swolchok/src/executorch/../executorch/runtime/executor/tensor_parser.h:15:10: fatal error: 'executorch/schema/program_generated.h' file not found
   15 | #include <executorch/schema/program_generated.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

I believe this reflects a problem with our cmake setup around this generated header.

Versions

Collecting environment information...
PyTorch version: 2.6.0.dev20241218
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 15.2 (arm64)
GCC version: Could not collect
Clang version: 16.0.0 (clang-1600.0.26.6)
CMake version: version 3.31.2
Libc version: N/A

Python version: 3.12.7 (main, Oct 1 2024, 02:05:46) [Clang 16.0.0 (clang-1600.0.26.3)] (64-bit runtime)
Python platform: macOS-15.2-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Apple M1 Pro

Versions of relevant libraries:
[pip3] executorch==0.5.0a0+db8f1eb
[pip3] numpy==1.26.4
[pip3] torch==2.6.0.dev20241218
[pip3] torchao==0.8.0+git2e032c6b
[pip3] torchaudio==2.6.0.dev20241218
[pip3] torchsr==1.0.4
[pip3] torchvision==0.22.0.dev20241218
[conda] Could not collect

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/run_oss_cpp_tests.sh at line 31 and trace how CMake makes executorch/schema/program_generated.h available to runtime/executor/tensor_parser_test.cpp. Reproduce the manual CMake configuration with EXECUTORCH_BUILD_TESTS=ON and without CMAKE_INSTALL_PREFIX. Done means the C++ tests configure and build successfully while resolving the generated header.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.