This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Include openmp with add_llvm_external_project
ClosedPublic

Authored by pirama on Feb 28 2017, 12:20 PM.

Details

Summary

Include projects/openmp into the build using add_llvm_external_project
instead of add_subdirectory. This creates an option
LLVM_TOOL_OPENMP_BUILD that selects whether this project gets included
in an in-tree build.

Diff Detail

Repository
rL LLVM

Event Timeline

pirama created this revision.Feb 28 2017, 12:20 PM

For Android, we are building LLVM, Clang and OpenMP from a single checkout for both Linux and Windows (using MinGW). But we only build OpenMP for the Linux host and Android-supported targets. The LLVM_TOOL_OPENMP_BUILD option allows skipping OpenMP when building for Windows.

jlpeyton accepted this revision.Mar 6 2017, 1:59 PM

LGTM, but I don't know if somebody else needs to OK.

This revision is now accepted and ready to land.Mar 6 2017, 1:59 PM
pirama added a comment.Mar 6 2017, 3:09 PM

@beanz Chris, can you take a quick look and see if this is OK?

beanz accepted this revision.Mar 7 2017, 10:47 AM

This patch is fine, just be warned that eventually I really want to kill the projects subdirectory entirely.

In general there are two types of "projects" that need to be added to the LLVM build tree: (1) projects that produce tools or libraries that depend on LLVM in some way, or (2) runtime libraries that are part of LLVM's compiler distribution.

The "projects" subdirectory has been used for things that fall into both of those categories, and it is confusing and complicated. In the future the plan is to make a clear distinction between the two types. Projects that depend on LLVM and should be integrated with LLVM's build system will be included under LLVM's "tools" directory which has an auto-discovery mechanism and does not require changes to the build system to do what this patch does. Additionally projects that produce runtime libraries will be included under LLVM's "runtimes" subdirectory, which supports configuring and building runtime library projects using just-built compiler toolchains.

There is no timeline for the removal of the projects directory, but please consider where openmp should fit in the future.

Thanks for the comments Chris. I believe OpenMP would be considered a runtime, but I'll let one of the OpenMP owners chime in.

This revision was automatically updated to reflect the committed changes.

Yes, OpenMP would be under the runtimes/ directory.

Yes, OpenMP would be under the runtimes/ directory.

+1

I actually committed https://reviews.llvm.org/rL290978 some time ago and I'm already using this :-)