Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to compile on Ubuntu 20.04LTS #10

Open
jbx1 opened this issue Jul 18, 2020 · 11 comments
Open

Fails to compile on Ubuntu 20.04LTS #10

jbx1 opened this issue Jul 18, 2020 · 11 comments

Comments

@jbx1
Copy link

jbx1 commented Jul 18, 2020

Hi,

Not sure if this issue is related to Issue #5

After going through the painful process of getting all the dependencies and downgrading Mppp to version 0.9 to get Piranha to build and install, now I am faced with this. I am using Ubuntu 20.04LTS.

In file included from /root/SMTPlan/SMTPlan/src/SMTPlan.cpp:8:
/root/SMTPlan/SMTPlan/include/SMTPlan/EncoderHappening.h: In member function ‘z3::expr SMTPlan::EncoderHappening::mk_expr(pexpr, int, int)’:
/root/SMTPlan/SMTPlan/include/SMTPlan/EncoderHappening.h:147:14: error: no match for ‘operator[]’ (operand types are ‘boost::container::flat_set<std::__cxx11::basic_string<char> >’ and ‘int’)
  147 |       if(args[i].get_name() != "hasht") {
      |              ^
/root/SMTPlan/SMTPlan/include/SMTPlan/EncoderHappening.h:148:48: error: no match for ‘operator[]’ (operand types are ‘boost::container::flat_set<std::__cxx11::basic_string<char> >’ and ‘int’)
  148 |        if(algebraist->function_id_map.find(args[i].get_name()) == algebraist->function_id_map.end()) {
      |                                                ^
/root/SMTPlan/SMTPlan/include/SMTPlan/EncoderHappening.h:150:40: error: no match for ‘operator[]’ (operand types are ‘boost::container::flat_set<std::__cxx11::basic_string<char> >’ and ‘int’)
  150 |         sym = z3_context->real_val(args[i].get_name().c_str());
      |                                        ^
/root/SMTPlan/SMTPlan/include/SMTPlan/EncoderHappening.h:153:51: error: no match for ‘operator[]’ (operand types are ‘boost::container::flat_set<std::__cxx11::basic_string<char> >’ and ‘int’)
  153 |         int fID = algebraist->function_id_map[args[i].get_name()];
      |                                                   ^
In file included from /root/SMTPlan/SMTPlan/src/SMTPlan.cpp:9:
/root/SMTPlan/SMTPlan/include/SMTPlan/EncoderFluent.h: In member function ‘z3::expr SMTPlan::EncoderFluent::mk_expr(pexpr, int, int)’:
/root/SMTPlan/SMTPlan/include/SMTPlan/EncoderFluent.h:153:14: error: no match for ‘operator[]’ (operand types are ‘boost::container::flat_set<std::__cxx11::basic_string<char> >’ and ‘int’)
  153 |       if(args[i].get_name() != "hasht") {
      |              ^
/root/SMTPlan/SMTPlan/include/SMTPlan/EncoderFluent.h:154:48: error: no match for ‘operator[]’ (operand types are ‘boost::container::flat_set<std::__cxx11::basic_string<char> >’ and ‘int’)
  154 |        if(algebraist->function_id_map.find(args[i].get_name()) == algebraist->function_id_map.end()) {
      |                                                ^
/root/SMTPlan/SMTPlan/include/SMTPlan/EncoderFluent.h:156:40: error: no match for ‘operator[]’ (operand types are ‘boost::container::flat_set<std::__cxx11::basic_string<char> >’ and ‘int’)
  156 |         sym = z3_context->real_val(args[i].get_name().c_str());
      |                                        ^
/root/SMTPlan/SMTPlan/include/SMTPlan/EncoderFluent.h:159:51: error: no match for ‘operator[]’ (operand types are ‘boost::container::flat_set<std::__cxx11::basic_string<char> >’ and ‘int’)
  159 |         int fID = algebraist->function_id_map[args[i].get_name()];
      |                                                   ^
make[2]: *** [CMakeFiles/SMTPlan.dir/build.make:63: CMakeFiles/SMTPlan.dir/src/SMTPlan.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/SMTPlan.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Any idea how to fix this?

@jbx1
Copy link
Author

jbx1 commented Jul 18, 2020

Downgraded Piranha to commit 7e42042.
Had to downgrade libboost to 1.55

Those errors disappeared but now I have new ones.

In file included from /usr/include/c++/9/set:62,
                 from /root/SMTPlan/SMTPlan/src/VALfiles/include/TimSupport.h:32,
                 from /root/SMTPlan/SMTPlan/src/VALfiles/src/TimSupport.cpp:28:
/usr/include/c++/9/bits/stl_multiset.h: In instantiation of ‘std::multiset<_Key, _Compare, _Alloc>::multiset(_InputIterator, _InputIterator) [with _InputIterator = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >; _Key = TIM::Property*; _Compare = std::less<TIM::Property*>; _Alloc = std::allocator<TIM::Property*>]’:
/root/SMTPlan/SMTPlan/src/VALfiles/include/TimSupport.h:273:67:   required from ‘TIM::PropertyState::PropertyState(TIM::TIMAnalyser*, TI, TI) [with TI = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >]’
/root/SMTPlan/SMTPlan/src/VALfiles/include/TimSupport.h:281:9:   required from ‘static TIM::PropertyState* TIM::PropertyState::retrieve(TIM::TIMAnalyser*, TI, TI) [with TI = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >]’
/root/SMTPlan/SMTPlan/src/VALfiles/src/TimSupport.cpp:1392:36:   required from here
/usr/include/c++/9/bits/stl_multiset.h:189:4: error: no matching function for call to ‘std::_Rb_tree<TIM::Property*, TIM::Property*, std::_Identity<TIM::Property*>, std::less<TIM::Property*>, std::allocator<TIM::Property*> >::_M_insert_range_equal(TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >&, TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >&)’
  189 |  { _M_t._M_insert_range_equal(__first, __last); }
      |    ^~~~
In file included from /usr/include/c++/9/map:60,
                 from /root/SMTPlan/SMTPlan/src/VALfiles/include/ptree.h:55,
                 from /root/SMTPlan/SMTPlan/src/VALfiles/include/FastEnvironment.h:36,
                 from /root/SMTPlan/SMTPlan/src/VALfiles/src/TimSupport.cpp:27:
/usr/include/c++/9/bits/stl_tree.h:1126:2: note: candidate: ‘template<class _InputIterator> std::__enable_if_t<std::is_same<_Val, typename std::iterator_traits<_InputIterator>::value_type>::value> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_range_equal(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = TIM::Property*; _Val = TIM::Property*; _KeyOfValue = std::_Identity<TIM::Property*>; _Compare = std::less<TIM::Property*>; _Alloc = std::allocator<TIM::Property*>]’
 1126 |  _M_insert_range_equal(_InputIterator __first, _InputIterator __last)
      |  ^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/stl_tree.h:1126:2: note:   template argument deduction/substitution failed:
/usr/include/c++/9/bits/stl_tree.h: In substitution of ‘template<class _InputIterator> std::__enable_if_t<std::is_same<TIM::Property*, typename std::iterator_traits<_Iterator>::value_type>::value, void> std::_Rb_tree<TIM::Property*, TIM::Property*, std::_Identity<TIM::Property*>, std::less<TIM::Property*>, std::allocator<TIM::Property*> >::_M_insert_range_equal<_InputIterator>(_InputIterator, _InputIterator) [with _InputIterator = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >]’:
/usr/include/c++/9/bits/stl_multiset.h:189:4:   required from ‘std::multiset<_Key, _Compare, _Alloc>::multiset(_InputIterator, _InputIterator) [with _InputIterator = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >; _Key = TIM::Property*; _Compare = std::less<TIM::Property*>; _Alloc = std::allocator<TIM::Property*>]’
/root/SMTPlan/SMTPlan/src/VALfiles/include/TimSupport.h:273:67:   required from ‘TIM::PropertyState::PropertyState(TIM::TIMAnalyser*, TI, TI) [with TI = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >]’
/root/SMTPlan/SMTPlan/src/VALfiles/include/TimSupport.h:281:9:   required from ‘static TIM::PropertyState* TIM::PropertyState::retrieve(TIM::TIMAnalyser*, TI, TI) [with TI = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >]’
/root/SMTPlan/SMTPlan/src/VALfiles/src/TimSupport.cpp:1392:36:   required from here
/usr/include/c++/9/bits/stl_tree.h:1126:2: error: no type named ‘value_type’ in ‘struct std::iterator_traits<TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> > >’
/usr/include/c++/9/bits/stl_multiset.h: In instantiation of ‘std::multiset<_Key, _Compare, _Alloc>::multiset(_InputIterator, _InputIterator) [with _InputIterator = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >; _Key = TIM::Property*; _Compare = std::less<TIM::Property*>; _Alloc = std::allocator<TIM::Property*>]’:
/root/SMTPlan/SMTPlan/src/VALfiles/include/TimSupport.h:273:67:   required from ‘TIM::PropertyState::PropertyState(TIM::TIMAnalyser*, TI, TI) [with TI = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >]’
/root/SMTPlan/SMTPlan/src/VALfiles/include/TimSupport.h:281:9:   required from ‘static TIM::PropertyState* TIM::PropertyState::retrieve(TIM::TIMAnalyser*, TI, TI) [with TI = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >]’
/root/SMTPlan/SMTPlan/src/VALfiles/src/TimSupport.cpp:1392:36:   required from here
/usr/include/c++/9/bits/stl_tree.h:1135:2: note: candidate: ‘template<class _InputIterator> std::__enable_if_t<(! std::is_same<_Val, typename std::iterator_traits<_InputIterator>::value_type>::value)> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_range_equal(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = TIM::Property*; _Val = TIM::Property*; _KeyOfValue = std::_Identity<TIM::Property*>; _Compare = std::less<TIM::Property*>; _Alloc = std::allocator<TIM::Property*>]’
 1135 |  _M_insert_range_equal(_InputIterator __first, _InputIterator __last)
      |  ^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/stl_tree.h:1135:2: note:   template argument deduction/substitution failed:
/usr/include/c++/9/bits/stl_tree.h: In substitution of ‘template<class _InputIterator> std::__enable_if_t<(! std::is_same<TIM::Property*, typename std::iterator_traits<_Iterator>::value_type>::value), void> std::_Rb_tree<TIM::Property*, TIM::Property*, std::_Identity<TIM::Property*>, std::less<TIM::Property*>, std::allocator<TIM::Property*> >::_M_insert_range_equal<_InputIterator>(_InputIterator, _InputIterator) [with _InputIterator = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >]’:
/usr/include/c++/9/bits/stl_multiset.h:189:4:   required from ‘std::multiset<_Key, _Compare, _Alloc>::multiset(_InputIterator, _InputIterator) [with _InputIterator = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >; _Key = TIM::Property*; _Compare = std::less<TIM::Property*>; _Alloc = std::allocator<TIM::Property*>]’
/root/SMTPlan/SMTPlan/src/VALfiles/include/TimSupport.h:273:67:   required from ‘TIM::PropertyState::PropertyState(TIM::TIMAnalyser*, TI, TI) [with TI = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >]’
/root/SMTPlan/SMTPlan/src/VALfiles/include/TimSupport.h:281:9:   required from ‘static TIM::PropertyState* TIM::PropertyState::retrieve(TIM::TIMAnalyser*, TI, TI) [with TI = TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> >]’
/root/SMTPlan/SMTPlan/src/VALfiles/src/TimSupport.cpp:1392:36:   required from here
/usr/include/c++/9/bits/stl_tree.h:1117:16: error: no type named ‘value_type’ in ‘struct std::iterator_traits<TIM::getConditionally<std::_Rb_tree_const_iterator<TIM::Property*> > >’
 1117 |  __enable_if_t<!__same_value_type<_InputIterator>::value>
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/SMTPlan.dir/build.make:180: CMakeFiles/SMTPlan.dir/src/VALfiles/src/TimSupport.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/SMTPlan.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

@m312z
Copy link
Contributor

m312z commented Jul 20, 2020

Hello Josef,

I've not seen that second error - it's coming from the VAL code, which is unlikely to be the most recent version. If you need it, I think I have a binary that I can send you, which might work. I don't have time to look into the code at the moment - but if you do, and manage to find a fix, please let me know what you did or make a pull request!

@jbx1
Copy link
Author

jbx1 commented Jul 20, 2020

I recall I saw something similar in OPTIC 2018 IPC version, which I solved by downgrading the singularity file to Ubuntu 16.04. If it is the same error, it might be an incompatibility with Ubuntu 20.04.

Will try to create a similar singularity file for this too and if it works I will submit a pull request.

Fixing it long term is going up be harder. Piranha, which was only compatible with mp++ 0.9 (now 0.22) is discontinued in favour of another project Oblake.

@DerekLong101
Copy link

DerekLong101 commented Jul 20, 2020 via email

@jbx1
Copy link
Author

jbx1 commented Jul 20, 2020

Hi Derek,

I am just trying to get SMTPlan compiled, so in this case the VAL code base is the one bundled with SMTPlan here.
I presume it wasn't merged at any point with the updated one we had fixed (that also works on Mac) that SLB is hosting right?

In the meantime I will try the Singularity approach too, should hopefully be straightforward.

best regards,

Josef

@m312z
Copy link
Contributor

m312z commented Jul 20, 2020

Hello both, I think it's a version from before it was moved to a KCL-Planning repository, prossibly from the POPF source. Since then another contributor fixed the auto_ptr issue, but otherwise it's an old version.

@jbx1
Copy link
Author

jbx1 commented Jul 20, 2020

I have managed to create a Singularity file that builds the planner and all its dependencies with the versions it uses.

I don't seem to have permissions to push my branch and create a pull request though.
If you add me as collaborator I can push it.

@jdekarske
Copy link

Would you be willing to share the Singularity file (or image)? I'm struggling to get it to compile and it would be a good inclusion in planutils.

@jbx1
Copy link
Author

jbx1 commented Jul 21, 2021

Yeah, nothing special about it. Will try to find it and post it here.

@jbx1
Copy link
Author

jbx1 commented Jul 21, 2021

You are right, I remember getting all the dependencies, and their dependencies all in place was painful.

Here it is. Remove the extension, because github didn't allow me to post it without it. Hopefully it works for you.

Singularity.txt

@hatfield-c
Copy link

hatfield-c commented Jul 25, 2021

Have you tried downgrading your gcc version?

I was recently able to get SMTPlan to successfully compile and run. I detailed the environment that I used to successfully compile in #5 just a moment ago. I used Debian instead of Ubuntu, but honestly I don't think it should matter save for the fact that Ubuntu comes with boost 1.7 or 1.8 pre-installed, which might present issues when downgrading to boost 1.55 or 1.56.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants