LLVM/Polly build configurations

98 views
Skip to first unread message

Michael Kruse

unread,
Sep 28, 2018, 9:06:44 AM9/28/18
to polly-dev

Hi,


I tried which build configurations for Polly currently work and which don't which what reason. I thought this might be useful information to see whether new patches (such as D51963) regress and/or to know what needs to be fixed.  The version of LLVM/Polly used is r342650. I looked at 18 different build configurations.

 

Legend:

 

All test pass

 

Partially works

 

Doesn’t work

 

GNU/WSL

 

LLVM_POLLY_LINK_INTO_TOOLS=1

LLVM_POLLY_LINK_INTO_TOOLS=0

Out-of-source-tree

Static link

 

(1)

(1)

BUILD_SHARED_LIBS=1

 

 

(2)

LLVM_LINK_LLVM_DYLIB=1

 

 

 

 

Windows (msvc)

 

LLVM_POLLY_LINK_INTO_TOOLS=1

LLVM_POLLY_LINK_INTO_TOOLS=0

Out-of-source-tree

Static link

 

(3)

BUILD_SHARED_LIBS=1

(4)

LLVM_LINK_LLVM_DYLIB=1

(5)

 

(1)         opt: symbol lookup error: /home/meinersbur/build/polly/release_static/lib/LLVMPolly.so: undefined symbol: _ZN4llvm4json5parseENS_9StringRefE

 

The JSON parser is not used in LLVM, so the symbols from Support/JSON.cpp are not in the opt executable.

JSON is only needed for some regression tests, the others work.

 

(2)    Undefined references to gtest when linking unit tests

but “
opt -load LLVMPolly.so” works

(3)    -load mechanism cannot work on windows since library imports need to specify which library they are importing from (so LLVMPolly.so would need to know whether e.g. it is loaded into opt or clang)

(4)         LINK : fatal error LNK1181: cannot open input file 'lib\LLVMDemangle.lib'

 

Not supported according to http://lists.llvm.org/pipermail/llvm-dev/2018-September/126173.html

 

(5)    CMake Error at tools/llvm-shlib/CMakeLists.txt:15 (message):

  Generating libLLVM is not supported on MSVC

 

 Michael

Tobias Grosser

unread,
Sep 28, 2018, 9:51:01 AM9/28/18
to Michael Kruse, polly-dev
I feel we should drop support for everything except LLVM_POLLY_LINK_INTO_TOOLS=1.

Best,
Tobias
> --
> You received this message because you are subscribed to the Google
> Groups "Polly Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to polly-dev+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Philip Pfaffe

unread,
Sep 28, 2018, 10:05:24 AM9/28/18
to Tobias Grosser, Michael Kruse, polly-dev
I strongly disagree in general, because that breaks essentially all downstream users. That being said, I'm fine with dropping the support on Windows (native). LLVM itself doesn't support plugins on windows, so there's no point in supporting this in polly.

Tobias Grosser

unread,
Sep 28, 2018, 10:13:13 AM9/28/18
to Philip Pfaffe, Michael Kruse, polly-dev
Philip, you have a valid point. Could we then maybe may make sure to either get a clear error message for unsupported configurations (windows) or get the configurations green?

I feel for windows we could just report that this is a unsupported configuration. For linux, maybe we don't include the JSON import/export in case we build a plugin? For (2) we could also report an error that unit tests are not supported in this configuration?

Best,
Tobias

Michael Kruse

unread,
Sep 28, 2018, 11:02:08 AM9/28/18
to Tobias Grosser, Philip Pfaffe, Michael Kruse, polly-dev
Am Fr., 28. Sep. 2018 um 09:13 Uhr schrieb Tobias Grosser
<tobias....@inf.ethz.ch>:
> I feel for windows we could just report that this is a unsupported configuration. For linux, maybe we don't include the JSON import/export in case we build a plugin? For (2) we could also report an error that unit tests are not supported in this configuration?

It might be easy to fix (2) depending on why the linking fails. For
instance, it could be because more c/.cpp have been added to newer
versions to gtest. Haven't looked into the why.

Michael

Philip Pfaffe

unread,
Sep 30, 2018, 5:55:38 AM9/30/18
to Michael Kruse, Tobias Grosser, polly-dev
Micheal,

Can you share the exact steps configurations for (1) and (2), or a Dockerfile to reproduce this?

Cheers,
Philip

Michael Kruse

unread,
Sep 30, 2018, 3:46:34 PM9/30/18
to Philip Pfaffe, Michael Kruse, Tobias Grosser, polly-dev
Did you have problems reproducing the configurations? Setting the
cmake definitions should be sufficient.

Anyway, here are the configurations that I used:

The scripts assume to be in ~/build/llvm (respectively ~/build/polly)
and the llvm source in ~/src/llvm with clang/polly checked-out
(respectively ~/src/polly). You can either put them in the same path,
create a symlink to the real path or change the script.

(1) [LLVM_POLLY_LINK_INTO_TOOLS=0]

$ cd ~/build/llvm
$ ./release_static_loadpolly.sh
$ cd release_static_loadpolly
$ ninja check-polly

(2)

$ cd ~/build/llvm
$ ./release_shared_nopolly.sh
$ cd release_shared_nopolly
$ ninja install
$ cd ~/build/polly
$ ./release_shared.sh
$ cd release_shared
$ ninja check-polly

Michael
Am So., 30. Sep. 2018 um 04:55 Uhr schrieb Philip Pfaffe
<philip...@gmail.com>:
release_static_loadpolly.sh
release_shared.sh
release_shared_nopolly.sh

Michael Kruse

unread,
Jul 25, 2019, 2:33:42 PM7/25/19
to Michael Kruse, sgue...@redhat.com, polly-dev
I re-did the same test for Linux again (for  https://reviews.llvm.org/D61446) with the results below. The reason for (2) has changed. I split the out-of-source configurations into LLVM_DIR either pointing to LLVM's build directory and LLVM's install prefix (after filling it with ninja install).

  Works
  partially works
  broken
Linux
  LLVM_POLLY_LINK_INTO_TOOLS=1 LLVM_POLLY_LINK_INTO_TOOLS=0 Out-of-source-tree: builddir Out-of-source-tree: installdir
Static link   (1) (1) (1)
BUILD_SHARED_LIBS=1       (2)
LLVM_LINK_LLVM_DYLIB=1        


(1)
Failing Tests (1):
    Polly :: GPGPU/libdevice-functions-copied-into-kernel.ll
GPGPU/libdevice-functions-copied-into-kernel.ll fails: LLVMPolly.so: undefined symbol: _ZN4llvm6LinkerC1ERNS_6ModuleE

The llvm::Linker class is not used inside opt, such that the object file LinkModules.o is not included in the opt executable.
A fix is available here:  https://reviews.llvm.org/D65295

(2)    
Undefined references to gtest when linking unit tests
However, "clang -Xclang -load -Xclang LLVMPolly.so" works

Michael

Reply all
Reply to author
Forward
0 new messages