bondhugula / pluto

Pluto: An automatic polyhedral parallelizer and locality optimizer
http://pluto-compiler.sourceforge.net
MIT License
268 stars 65 forks source link

pet build error: /usr/include/c++/9/bits/stl_tree.h:785:8: error: static assertion failed: comparison object must be invocable as const #99

Closed pal-stdr closed 8 months ago

pal-stdr commented 1 year ago

Hello

I am trying to make the pluto, but ended up with repeated following error triggered from pet

make[4]: Entering directory '/media/username/EXTERNAL/compiler-projects/pluto-master-test/pet'
  CXX      inlined_calls.lo
  CXX      scan.lo
  CXX      scop_plus.lo
  CXX      pet.lo
  CC       libdep_a-all.o
  AR       libdep.a
ar: `u' modifier ignored since `D' is the default (see `U')
In file included from /usr/include/c++/9/set:60,
                 from scop_plus.cc:36:
/usr/include/c++/9/bits/stl_tree.h: In instantiation of ‘static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type) [with _Key = isl_id_list*; _Val = isl_id_list*; _KeyOfValue = std::_Identity<isl_id_list*>; _Compare = array_desc_less; _Alloc = std::allocator<isl_id_list*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<isl_id_list*>*]’:
/usr/include/c++/9/bits/stl_tree.h:1934:36:   required from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_lower_bound(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr, const _Key&) [with _Key = isl_id_list*; _Val = isl_id_list*; _KeyOfValue = std::_Identity<isl_id_list*>; _Compare = array_desc_less; _Alloc = std::allocator<isl_id_list*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<isl_id_list*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<isl_id_list*>*; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr = std::_Rb_tree_node_base*]’
/usr/include/c++/9/bits/stl_tree.h:2562:16:   required from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::find(const _Key&) [with _Key = isl_id_list*; _Val = isl_id_list*; _KeyOfValue = std::_Identity<isl_id_list*>; _Compare = array_desc_less; _Alloc = std::allocator<isl_id_list*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<isl_id_list*>]’
/usr/include/c++/9/bits/stl_set.h:795:29:   required from ‘std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) [with _Key = isl_id_list*; _Compare = array_desc_less; _Alloc = std::allocator<isl_id_list*>; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<isl_id_list*>; std::set<_Key, _Compare, _Alloc>::key_type = isl_id_list*]’
scop_plus.h:44:16:   required from here
/usr/include/c++/9/bits/stl_tree.h:785:8: error: static assertion failed: comparison object must be invocable as const
  785 |        is_invocable_v<const _Compare&, const _Key&, const _Key&>,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[4]: *** [Makefile:1205: scop_plus.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from /usr/include/c++/9/set:60,
                 from scan.cc:39:
...
.....
/usr/include/c++/9/bits/stl_tree.h:785:8: error: static assertion failed: comparison object must be invocable as const
  785 |        is_invocable_v<const _Compare&, const _Key&, const _Key&>,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/stl_tree.h: In instantiation of ‘static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type) [with _Key = clang::TypedefNameDecl*; _Val = clang::TypedefNameDecl*; _KeyOfValue = std::_Identity<clang::TypedefNameDecl*>; _Compare = less_name; _Alloc = std::allocator<clang::TypedefNameDecl*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<clang::TypedefNameDecl*>*]’:
.....

Configure was done without any major error or failure, except in config.log

conftest.c:12:10: fatal error: ac_nonexistent.h: No such file or directory
   12 | #include <ac_nonexistent.h>
compilation terminated.
configure:10252: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "pluto"
| #define PACKAGE_TARNAME "pluto"
| #define PACKAGE_VERSION "0.12.0"
....
...

I have a rough guess, this has something to do with gcc version.

I am using Pluto: master branch OS: Ubuntu 20.04 llvm: 16.0.6 (locally build and added to $PATH) gcc: 9.4.0 g++: 9.4.0

My config command

./configure --prefix=/path/to/compiler-projects/pluto-master-test/installation --with-clang-prefix=$LLVM_ROOT --enable-portable-binary --enable-debug --enable-static

Help would be much much appreciated! 🙏 🙏🙏🙏

Thanks in advance!

pal-stdr commented 10 months ago

Last night, I had tried with clang-14, and then the PET build worked!!! Previously I was trying with clang-16 because I found this answer in one of the issue thread saying, Pluto works for clang-14, clang-15 & clang-16.

bondhugula commented 10 months ago

Last night, I had tried with clang-14, and then the PET build worked!!! Previously I was trying with clang-16 because I found this answer in one of the issue thread saying, Pluto works for clang-14, clang-15 & clang-16.

Sorry, looks like I might have been mistaken in that response. clang-14 was tested, and it works fine. I just tried with clang-16.0.6 and pet doesn't build with it.

bondhugula commented 10 months ago

Updated pet and isl to their latest release versions. It now builds with clang 16 as well (tested with clang-16.0.6).

bondhugula commented 10 months ago

https://github.com/bondhugula/pluto/commit/001cb37676520fa5c1e87c163b1f4cb9f4bbeb80