Skip to content

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

@swolchok

Description

@swolchok

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: build/installIssues related to the cmake and buck2 builds, and to installing ExecuTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions