[PATCH] D32442: [Polly][CMake] Use object library to build two flavours of Polly.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 10:23:07 PDT 2017


Meinersbur created this revision.
Meinersbur added a project: Polly.
Herald added a subscriber: mgorny.

Polly comes in two library flavors: One loadable module to use the LLVM framework -load mechanism, and another one that host applications can link to. These have very different requirements for Polly's own dependencies.

The loadable module assumes that all its LLVM dependencies are already available in the address space of the host application, and is not allowed to bring in its own copy of any LLVM library (including the NVPTX backend in case of Polly-ACC).

The non-module library is intended to be linked to using target_link_libraries. CMake would then resolve all of its dependencies, including NVPTX and ensure that only a single instance of each library will be used.

This is a less invasive alternative to https://reviews.llvm.org/D32392.

I did not manage to make `LLVM_LINK_LLVM_DYLIB=ON` build work entirely. `check-polly` works, but trying to install it gives an error

  CMake Error at tools/polly/lib/cmake_install.cmake:40 (file):
    file INSTALL cannot find
    "/root/build/llvm/release_loadpolly_dylib/tools/polly/lib/CMakeFiles/CMakeRelink.dir/LLVMPolly.so".
  Call Stack (most recent call first):
    tools/polly/cmake_install.cmake:46 (include)
    tools/cmake_install.cmake:37 (include)
    cmake_install.cmake:62 (include)

According to http://public.kitware.com/pipermail/cmake/2016-July/063992.html this has might not be Polly's fault. It occures with lld as well.

Using `LLVM_ROOT_DIR` (i.e. an out-of-LLVM-tree build) to an LLVM build configured that way also does not work with unittests because its `llvm-config --system-libs` returns nothing.


https://reviews.llvm.org/D32442

Files:
  lib/CMakeLists.txt
  unittests/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32442.96416.patch
Type: text/x-patch
Size: 5627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170424/f50bafec/attachment.bin>


More information about the llvm-commits mailing list