[PATCH 2/2] Revert "CMake: don't install tablegen"

Hans Wennborg hans at chromium.org
Mon Sep 9 13:45:19 PDT 2013


+llvm-commits again

There seems to be three ways we could solve this

1. Just include llvm-tblgen in the install
  It is after all required for users of llvm's option parsing library.

2. Provide a cmake option to include it in the install.
  Having more flags is annoying, but this allows us to keep it out of
the default install, which is desirable because it's an llvm internal
tool.

3. Split out the option parsing table emission into llvm-opts-tblgen,
and install that.
  This avoids installing the internal llvm-tblgen tool, but adds the
complexity of yet another tablegen.

I'd be interested to hear if Reid and Chandler has any opinions here.

 - Hans


On Mon, Sep 2, 2013 at 6:39 AM, Johannes Obermayr
<johannesobermayr at gmx.de> wrote:
> To explain a bit how packaging works on Linux (here RPM based distros)
>
>
>
> %build
>
> cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
>
> -DCMAKE_INSTALL_PREFIX=%_prefix \
>
> %ifarch x86_64
>
> -DLLVM_LIBDIR_SUFFIX=64 \ # Doesn't work in upstream svn/git because it
> seems LLVM devs don't want to support it:
> http://llvm.org/bugs/show_bug.cgi?id=12230
>
> %endif
>
> -DLLVM_TARGETS_TO_BUILD="CppBackend;NVPTX;R600;X86;XCore" \
>
> -DBUILD_SHARED_LIBS=ON \
>
> -DLLVM_ENABLE_TIMESTAMPS=OFF \
>
> -DLLVM_ENABLE_FFI=ON \
>
> -DLLVM_USE_OPROFILE=ON \
>
> -DLLVM_BUILD_TESTS=OFF \
>
> -DLLVM_INCLUDE_TESTS=OFF \
>
> -DLLVM_BUILD_EXAMPLES=OFF \
>
> -DLLVM_INCLUDE_EXAMPLES=OFF \
>
> -DLLVM_BUILD_TOOLS=ON \
>
> -DLLVM_INCLUDE_TOOLS=ON \
>
> ..
>
> make %{?jobs:-j%jobs}
>
>
>
>
>
> %install
>
> make install DESTDIR=$RPM_BUILD_ROOT
>
> rm -rf $RPM_BUILD_ROOT%_libdir/BugpointPasses.*
>
>
>
>
>
> # Now distribute contents to the packages:
>
> %files # llvm package
>
> %defattr(-,root,root)
>
> %_bindir/llc
>
> %_bindir/lli
>
> %_bindir/llvm* # package all llvm* executables in llvm package
>
> %exclude %_bindir/llvm-tablegen # but not llvm-tablegen
>
> %_bindir/macho-dump
>
> %_bindir/opt
>
>
>
> %files -n libLLVM # libLLVM package
>
> %defattr(-,root,root)
>
> %_libdir/lib*.so
>
>
>
> %files devel # llvm-devel package
>
> %defattr(-,root,root)
>
> %_bindir/llvm-tablegen # instead package llvm-tablegen in llvm-devel package
>
> %_includedir/llvm
>
> %_includedir/llvm-c
>
> %_datadir/llvm
>
>
>
>
>
> Now some examples how dependencies work:
>
> 1. Mesa with LLVM support requires some .so and also installs libLLVM
> package (joe user)
>
> 2. llvm requires some .so and also installs libLLVM package (case?)
>
> 3. llvm-devel requires llvm and libLLVM for linking. So it also installs
> both. (devs choice)
>
>
>
> This way you can reduce overhead depending on your use case.
>
>
>
>
>
> As said putting it in a conditional if(CMAKE_SYSTEM_NAME MATCHES "Linux")
> could solve it:
>
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130826/186277.html
>
>
>
>
>
> Johannes
>
>
>
> Am Montag, 2. September 2013, 14:16:06 schrieben Sie:
>
>> I don't really have any strong preference here.
>
>>
>
>> Johannes: how is the llvm-devel package built? Would it solve the
>
>> problem if we had a flag for that build that made llvm-tblgen be
>
>> included?
>
>>
>
>> - Hans
>
>>
>
>> On Fri, Aug 30, 2013 at 9:09 PM, Jordan Rose <jordan_rose at apple.com>
>> wrote:
>
>> > It makes sense to include llvm-tblgen in llvm-devel, just not the main
>> > llvm package. What do you think?
>
>> >
>
>> > On Aug 30, 2013, at 12:08 , Johannes Obermayr <johannesobermayr at gmx.de>
>> > wrote:
>
>> >
>
>> >> This is not possible because on OBS I first compile a llvm git master
>> >> package and then a llvm-clang git master package which depends on llvm
>> >> libLLVM and llvm-devel packages on build time.
>
>> >>
>
>> >> So %_bindir/llvm-tablegen must be installed and included in llvm or
>> >> llvm-devel package to get clang compiled.
>
>> >>
>
>> >> But who cares about packaging on Linux distributions?
>
>> >>
>
>> >> Am Freitag, 30. August 2013, 11:47:40 schrieb Reid Kleckner:
>
>> >>> Please find a way to do this that doesn't install llvm-tblgen by
>> >>> default.
>
>> >>> We don't actually want to distribute it to end users.
>
>> >>>
>
>> >>> I believe we have some solution for supporting out-of-source builds
>> >>> using
>
>> >>> llvm-config, but Hans or Jordan Rose (I think he uses CMake+XCode out
>> >>> of
>
>> >>> source?) might know more.
>
>> >>>
>
>> >>>
>
>> >>> On Fri, Aug 30, 2013 at 11:14 AM, Johannes Obermayr
>> >>> <johannesobermayr at gmx.de
>
>> >>>> wrote:
>
>> >>>
>
>> >>>> This reverts commit b7f81d372a884453f821a3764028771c4896c3be.
>
>> >>>> SVN: r189130
>
>> >>>>
>
>> >>>> Fixes (out-of-tree build):
>
>> >>>> Scanning dependencies of target ClangCC1AsOptions
>
>> >>>> make[2]: *** No rule to make target `/usr/bin/llvm-tblgen', needed by
>
>> >>>> `include/clang/Driver/Options.inc.tmp'. Stop.
>
>> >>>> ---
>
>> >>>> cmake/modules/TableGen.cmake | 2 ++
>
>> >>>> 1 file changed, 2 insertions(+)
>
>> >>>>
>
>> >>>> diff --git a/cmake/modules/TableGen.cmake
>> >>>> b/cmake/modules/TableGen.cmake
>
>> >>>> index d315a42..bf75ce2 100644
>
>> >>>> --- a/cmake/modules/TableGen.cmake
>
>> >>>> +++ b/cmake/modules/TableGen.cmake
>
>> >>>> @@ -136,4 +136,6 @@ macro(add_tablegen target project)
>
>> >>>> if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD AND NOT BEOS )
>
>> >>>> target_link_libraries(${target} pthread)
>
>> >>>> endif()
>
>> >>>> +
>
>> >>>> + install(TARGETS ${target} RUNTIME DESTINATION bin)
>
>> >>>> endmacro()
>
>> >>>> --
>
>> >>>> 1.8.1.4



More information about the llvm-commits mailing list