pytorch / pytorch/executorch

Add upstream flatcc option to avoid installing under the source tree

Open
#8,867 0 comments 0 reactions 1 assignee View on GitHub

@tarun292 is already working on this.

Since Mar 1, 2025.

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

Description

The flatcc third party library builds its libraries and executables directly into its source tree (under bin/ and lib/) instead of into the cmake output directory. This causes problems for us, because we need to be able to build both host and cross-compiled target versions of flatcc. But since they both are built to the same directory, they can overwrite each other.

We have a hack at https://github.com/pytorch/executorch/blob/4f12131c0c57d903093b4d26f9eccea1f9545222/devtools/CMakeLists.txt#L105 to deal with this, but it'd be a lot easier if flatcc had a build option to install the binaries under the cmake build directory instead.

@dbort sent https://github.com/dvidelabs/flatcc/pull/306 to the upstream project, but there's been no further response for months.

https://github.com/pytorch/executorch/commit/db31f4961e8a576af93af34dbbc43965ee1edec9 is the simplification change we'll be able to make to ET. And that hack didn't work all the time anyway (e.g., #7260), so with this we should be able to permanently avoid the environment-specific build race conditions we've run into.

cc @larryliu0820 @lucylq

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.