Rebuild Polly

41 views
Skip to first unread message

Elouan Jeannot

unread,
Oct 15, 2021, 3:53:46 AM10/15/21
to Polly Development
Hello,
I am trying to rebuild Polly to see changes that I will make. For that, I use the command on the Polly get started website:
cmake -DCMAKE_PREFIX_PATH=/usr/lib/llvm-12/lib/cmake/llvm ../llvm_git/polly
But it's not working and I have these errors:

CMake Error at cmake/polly_macros.cmake:23 (add_library):
  add_library cannot create target "PollyISL" because an imported target with
  the same name already exists.
Call Stack (most recent call first):
  lib/External/CMakeLists.txt:284 (add_polly_library)


CMake Error at lib/External/CMakeLists.txt:312 (target_compile_options):
  target_compile_options may only set INTERFACE properties on IMPORTED
  targets


CMake Error at /usr/lib/llvm-12/lib/cmake/llvm/AddLLVM.cmake:517 (add_library):
  add_library cannot create target "Polly" because an imported target with
  the same name already exists.
Call Stack (most recent call first):
  /usr/lib/llvm-12/lib/cmake/llvm/AddLLVM.cmake:776 (llvm_add_library)
  /usr/lib/llvm-12/lib/cmake/llvm/AddLLVM.cmake:979 (add_llvm_library)
  lib/CMakeLists.txt:54 (add_llvm_pass_plugin)


CMake Error at /usr/lib/llvm-12/lib/cmake/llvm/AddLLVM.cmake:642 (target_link_libraries):
  Cannot specify link libraries for target "Polly" which is not built by this
  project.
Call Stack (most recent call first):
  /usr/lib/llvm-12/lib/cmake/llvm/AddLLVM.cmake:776 (llvm_add_library)
  /usr/lib/llvm-12/lib/cmake/llvm/AddLLVM.cmake:979 (add_llvm_library)
  lib/CMakeLists.txt:54 (add_llvm_pass_plugin)


-- Configuring incomplete, errors occurred!
See also "/home/elouan/llvm_build/CMakeFiles/CMakeOutput.log".
See also "/home/elouan/llvm_build/CMakeFiles/CMakeError.log".

I tried to resolve them or to change the command but it's not working.
Is someone can help me please?
Best regards

Michael Kruse

unread,
Oct 15, 2021, 10:30:22 AM10/15/21
to Elouan Jeannot, Polly Development, ro...@max.fan
Hi,

we recently updated the installation instructions, you can find the
new one here: https://polly.llvm.org/get_started.html

Using the polly/CMakeLists.txt would correspond to a standalone build,
linking to a pre-installed LLVM. Was this your intention? I haven't
tried this for a long time and might have stopped working. In any
case, the checked-out version of Polly must exactly correspond to the
version of LLVM. Since your distribution may have applied custom
patches to their version of LLVM, I would recommend using the
instructions on the get_started page.

Michael


Am Fr., 15. Okt. 2021 um 02:53 Uhr schrieb Elouan Jeannot
<elouan....@gmail.com>:
> --
> 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.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/polly-dev/a8ea0bec-46e0-4d75-bc2a-ce3f3a97b50cn%40googlegroups.com.



--
Tardyzentrismus verboten!

Elouan Jeannot

unread,
Oct 16, 2021, 5:27:55 AM10/16/21
to Polly Development
Hello,
Thanks for your answer.
I hadn't seen that the get started had changed. With the new one I get to build polly but I don't see my changes. For example, for now, I just add an "ok" at the end of a print like this in the line 776 of the DependenceInfo.cpp file during the last print of the  Dependences::print function :

void Dependences::print(raw_ostream &OS) const {
OS << "\tRAW dependences:\n\t\t";
printDependencyMap(OS, RAW);
OS << "\tWAR dependences:\n\t\t";
printDependencyMap(OS, WAR);
OS << "\tWAW dependences:\n\t\t";
printDependencyMap(OS, WAW);
OS << "\tReduction dependences:\n\t\t";
printDependencyMap(OS, RED);
OS << "\tTransitive closure of reduction dependences: OK\n\t\t";
printDependencyMap(OS, TC_RED);
}

And, when I execute polly, I see that:

' in function 'main':
RAW dependences:
{ Stmt1[i0, i1] -> Stmt2[i0, i1, o2] : 0 <= i0 <= 1499 and 0 <= i1 <= 1499 and 0 <= o2 <= 1499 }
WAR dependences:
{  }
WAW dependences:
{ Stmt1[i0, i1] -> Stmt2[i0, i1, o2] : 0 <= i0 <= 1499 and 0 <= i1 <= 1499 and 0 <= o2 <= 1499 }
Reduction dependences:
{ Stmt2[i0, i1, i2] -> Stmt2[i0, i1, 1 + i2] : 0 <= i0 <= 1499 and 0 <= i1 <= 1499 and 0 <= i2 <= 1498 }
Transitive closure of reduction dependences:
{ Stmt2[i0, i1, i2] -> Stmt2[i0, i1, o2] : 0 <= i0 <= 1499 and 0 <= i1 <= 1499 and ((i2 >= 0 and i2 < o2 <= 1499) or (i2 <= 1499 and 0 <= o2 < i2)) }

Do you know how can my changes be taken into account ?

Michael Kruse

unread,
Oct 18, 2021, 12:39:08 PM10/18/21
to Elouan Jeannot, Polly Development
Am Sa., 16. Okt. 2021 um 04:27 Uhr schrieb Elouan Jeannot
<elouan....@gmail.com>:
> I hadn't seen that the get started had changed. With the new one I get to build polly but I don't see my changes.

Hard to diagnose from a distance. A few things to check:
Did you confirm you are using the built executable, and not .e.g the
one that comes with you Linux distribution?
Did you rebuild with `ninja opt`?
After changing one of the source files,
Does `ninja opt` build anything?
Does `ninja opt -v -j1` show the expected command line?
In particular, does it use the correct DependenceInfo.cpp you were changing?
Does it build the `bin/opt` executable you were calling?
Does `ninja check-polly` fail if you change something more significant?

Michael

--
Tardyzentrismus verboten!

Elouan Jeannot

unread,
Oct 20, 2021, 3:15:31 AM10/20/21
to Polly Development

Hello, My computer was building the polly which is by default on my distribution. So I change it to use the good one and now it works.
Thank you for your help.
Reply all
Reply to author
Forward
0 new messages