This is an archive of the discontinued LLVM Phabricator instance.

CMake: add LLVM_INSTALL_TOOLCHAIN_ONLY option
ClosedPublic

Authored by hans on Aug 16 2013, 11:26 AM.

Details

Summary

This variable allows for installing just the toolchain parts of LLVM.

Diff Detail

Event Timeline

rnk added a comment.Aug 16 2013, 3:01 PM

As discussed in person, let's go for a single option called LLVM_INSTALL_DEV_FILES (or DEV_RESOURCES or any other spelling).

This would basically cover libs, headers, cmake files, tablegen, and anything that a *developer* would need to build code against this package, ie what would go in a Debian libfoo-dev package.

hans updated this revision to Unknown Object (????).Aug 16 2013, 3:48 PM

Change option name to LLVM_INSTALL_DEV_FILES. Also move cmake files and llvm-lit under this flag.

(Not changing the code review title to hopefully keep this in the same email thread.)

rnk accepted this revision.Aug 16 2013, 3:58 PM

LGTM Nice!

hans added a comment.Aug 16 2013, 4:49 PM

Er, no?

OK, I've changed it.

So, first note that this changes users of 'make install' in addition to users of cpack.

Right. I think my patch description actually only mentioned the 'install' target, because I don't think a lot of folks use cpack. Anyway, I'll expand the commit message that it affects both.

There are two layers of this:

  1. install development tools / resources useful for developing other *LLVM* projects (tblgen, etc)
  1. install *anything* but executable binaries.

I think these should be different. I think #1 should be default-off and turned on for users of the stand-alone Clang cmake build. It should be called something about "development".

I think #2 should be default-on, because many many users of LLVM specifically want the core libraries. I think the best way is to negate the flag: make it INSTALL_TOOLCHAIN_BINARIES_ONLY or something, and when enabled, you only get the binaries used as part of a toolchain (llvm-{ar,nm,dwarfdump,...}, clang, clang-format, etc., but not opt or llc.

I don't think I'm following. You say #1 and #2 should be different. If #1 is development tools and resources (i.e. tablegen, headers and libraries), doesn't that overlap with #2 being anything but toolchain binaries?

I think my patch provides an good way to configure the install target. Currently, 'make install' installs everything. I don't want to change that default. My patch just adds the possibility to exclude the "dev stuff", i.e. the libraries and headers. Isn't that pretty intuitive?

hans updated this revision to Unknown Object (????).Aug 21 2013, 3:49 PM

New patch revision demonstrating a three-state variable for controlling what to include in the 'install' target.

hans updated this revision to Unknown Object (????).Aug 23 2013, 3:49 PM

After the discussion on the mailing list, go back to just having one option for this.

hans added a comment.Aug 23 2013, 3:56 PM

With this patch, the Clang side patch from http://llvm-reviews.chandlerc.com/D1498 and a corresponding patch to lld, using this option will result in the following install dir:

./bin/clang++.exe
./bin/clang-check.exe
./bin/clang-cl.exe
./bin/clang-format.exe
./bin/clang.exe
./bin/git-clang-format
./bin/libclang.dll
./bin/lld.exe
./bin/llvm-ar.exe
./bin/llvm-objdump.exe
./include/clang-c/CXCompilationDatabase.h
./include/clang-c/CXString.h
./include/clang-c/Index.h
./include/clang-c/Platform.h
./lib/clang/3.4/include
./lib/clang/3.4/include/altivec.h
./lib/clang/3.4/include/ammintrin.h
./lib/clang/3.4/include/arm_neon.h
./lib/clang/3.4/include/avx2intrin.h
./lib/clang/3.4/include/avxintrin.h
./lib/clang/3.4/include/bmi2intrin.h
./lib/clang/3.4/include/bmiintrin.h
./lib/clang/3.4/include/cpuid.h
./lib/clang/3.4/include/emmintrin.h
./lib/clang/3.4/include/f16cintrin.h
./lib/clang/3.4/include/float.h
./lib/clang/3.4/include/fma4intrin.h
./lib/clang/3.4/include/fmaintrin.h
./lib/clang/3.4/include/immintrin.h
./lib/clang/3.4/include/iso646.h
./lib/clang/3.4/include/limits.h
./lib/clang/3.4/include/lzcntintrin.h
./lib/clang/3.4/include/mm3dnow.h
./lib/clang/3.4/include/mmintrin.h
./lib/clang/3.4/include/mm_malloc.h
./lib/clang/3.4/include/module.map
./lib/clang/3.4/include/nmmintrin.h
./lib/clang/3.4/include/pmmintrin.h
./lib/clang/3.4/include/popcntintrin.h
./lib/clang/3.4/include/prfchwintrin.h
./lib/clang/3.4/include/rdseedintrin.h
./lib/clang/3.4/include/rtmintrin.h
./lib/clang/3.4/include/smmintrin.h
./lib/clang/3.4/include/stdalign.h
./lib/clang/3.4/include/stdarg.h
./lib/clang/3.4/include/stdbool.h
./lib/clang/3.4/include/stddef.h
./lib/clang/3.4/include/stdint.h
./lib/clang/3.4/include/stdnoreturn.h
./lib/clang/3.4/include/tgmath.h
./lib/clang/3.4/include/tmmintrin.h
./lib/clang/3.4/include/unwind.h
./lib/clang/3.4/include/varargs.h
./lib/clang/3.4/include/wmmintrin.h
./lib/clang/3.4/include/x86intrin.h
./lib/clang/3.4/include/xmmintrin.h
./lib/clang/3.4/include/xopintrin.h
./lib/clang/3.4/include/__wmmintrin_aes.h
./lib/clang/3.4/include/__wmmintrin_pclmul.h
./lib/libclang.lib

LGTM! Thanks for all of the iterations here.

Also, I'm trusting that libLTO.so is still installed here. as long as that's true, ship it!

hans added a comment.Aug 23 2013, 5:15 PM

Also, I'm trusting that libLTO.so is still installed here. as long as that's true, ship it!

It wasn't (we don't build it on Windows, so I didn't notice), but I'll fix this when committing.

hans closed this revision.Aug 23 2013, 5:23 PM

Closed by commit rL189155 (authored by @hans).