Issue249

Title Compilation errors on new versions of Ubuntu
Priority bug Status resolved
Superseder Nosy List haz, jendrik, malte, moritz
Assigned To malte Keywords
Optional summary

Created on 2011-07-19.16:47:17 by haz, last changed by jendrik.

Messages
msg2095 (view) Author: jendrik Date: 2012-04-09.22:44:27
Done :)
msg2094 (view) Author: malte Date: 2012-04-09.20:24:27
I should have read more closely that this is about the preprocessor. Yes, of
course that should be done. I'm surprised it's not already done.

Can you do this?
msg2093 (view) Author: jendrik Date: 2012-04-09.19:05:02
I think we need to use the fix from search/Makefile and apply it in 
preprocess/Makefile, i.e. replace

CCOPT += -I/usr/include/c++/4.4/i686-linux-gnu

with

HAVE_GCC_4_4 := $(shell expr "$$(gcc -dumpversion)" : \\\(4\.4\.\\\))
HAVE_GCC_4_5 := $(shell expr "$$(gcc -dumpversion)" : \\\(4\.5\.\\\))

ifdef HAVE_GCC_4_4
     CCOPT += -I/usr/include/c++/4.4/i686-linux-gnu
endif

ifdef HAVE_GCC_4_5
     CCOPT += -I/usr/include/c++/4.5/i686-linux-gnu
endif
msg2092 (view) Author: malte Date: 2012-04-09.18:52:53
You might also symlink "g++" to "echo". If the planner then fails to compile,
it's not necessarily a Fast Downward bug, though.

So the conclusion is we need to add another special case for gcc 4.6?
msg2091 (view) Author: jendrik Date: 2012-04-09.18:50:03
Normally they give the same result, but nobody stops me from linking the 
g++ executable to a different g++ version. Then they give me different 
results. Maybe this is not really sane, however ;)

jendrik@SAMEEE:~$ g++ -dumpversion
4.6
jendrik@SAMEEE:~$ gcc -dumpversion
4.6
jendrik@SAMEEE:~$ sudo ln -fs /usr/bin/g++-4.5 /usr/bin/g++
jendrik@SAMEEE:~$ g++ -dumpversion
4.5.3
jendrik@SAMEEE:~$ gcc -dumpversion
4.6
msg2090 (view) Author: malte Date: 2012-04-09.18:05:33
I had read that this bug had been fixed with recent Ubuntus. :-(

Regarding use of "gcc -dumpversion" vs. "g++ -dumpversion": do they give you
different results? What do you get, respectively?

"g++" (the C++ compiler) is a part (or rather, front end) of "gcc" (the GNU
compiler collection) and it would be very weird to have different default
versions of them in use, i.e. gcc and g++ being different versions.

g++ isn't really a separare thing from gcc; e.g., on my machine, "man g++" gives
me the gcc man page. The reason to prefer gcc over g++ for things like dumping
the version is that it's the canonical executable; e.g. the man page only
documents the options for gcc and for g++ states that "g++ accepts mostly the
same options as gcc".
msg2089 (view) Author: jendrik Date: 2012-04-09.12:21:22
On my netbook running Ubuntu Precise I get similar strange error messages when I 
try to compile the preprocessor. As previously for haz the errors get fixed when 
I replace 

CCOPT += -I/usr/include/c++/4.4/i686-linux-gnu

with 

CCOPT += -I/usr/include/c++/4.6/i686-linux-gnu

It seems this can be fixed in the same way as in search/Makefile. Looking at the 
solution there I wondered why you used "gcc -dumpversion" instead of "g++ -
dumpversion"?
msg1823 (view) Author: malte Date: 2011-10-18.13:29:30
Merged something along the lines of what Moritz suggested. Thanks, everyone!
msg1808 (view) Author: moritz Date: 2011-10-16.22:17:10
Something like the following could work (but it's not beautiful):

#gcc version extraction from
http://stackoverflow.com/questions/5188267/checking-the-gcc-version-in-a-makefile
GCCMAJORLTEQ4 := $(shell expr 4 \<= `gcc -dumpversion | cut -f1 -d.`)
GCCMINORGTEQ6 := $(shell expr 6 \<= `gcc -dumpversion | cut -f2 -d.`)
GCCMINORGTEQ5 := $(shell expr 5 \<= `gcc -dumpversion | cut -f2 -d.`)

ifeq "$(GCCMAJORLTEQ4)" "1"
    ifeq "$(GCCMINORGTEQ6)" "0" #for gcc >= 4.6, this hack is not necessary anymore
        ifeq "$(GCCMINORGTEQ5)" "0"
			CCOPT += -I/usr/include/c++/4.4/i686-linux-gnu #for gcc 4.4.*
        else
			CCOPT += -I/usr/include/c++/4.5/i686-linux-gnu #for gcc 4.5.*
		endif
	endif
endif
msg1431 (view) Author: haz Date: 2011-07-29.21:21:25
No luck. The some error occurs.
msg1430 (view) Author: malte Date: 2011-07-29.19:47:33
Looking for a workaround for this that doesn't break our systems, but
unfortunately I don't have access to g++ 4.5.

Can you check if the following works?

 1. Revert to the original Makefile, then *add* an additional line

CCOPT += -I/usr/include/c++/4.5/i686-linux-gnu

before

CCOPT += -I/usr/include/c++/4.4/i686-linux-gnu

rather than replacing it. Then make distclean; make
msg1423 (view) Author: haz Date: 2011-07-19.16:47:16
On my current OS [1], I found that I needed to replace this (in 
{preprocess,search}/Makefile)...

CCOPT += -I/usr/include/c++/4.4/i686-linux-gnu

...with this...

CCOPT += -I/usr/include/c++/4.5/i686-linux-gnu

  The errors were extremely cryptic [2], and I think it may be due to the bump 
in g++ version number that is used.

[0]: uname -a
Linux mini-meee 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:05:41 UTC 2011 
i686 i686 i386 GNU/Linux

[1]:
haz@mini-meee:~/Projects/fast-downward/src/preprocess$ make
g++  -m32 -g -Wall -W -Wno-sign-compare -Wno-deprecated -ansi -pedantic -Werror 
-I/usr/include/c++/4.4/i686-linux-gnu -O3 -DNDEBUG -fomit-frame-pointer -c 
planner.cc -o .obj/planner.o
In file included from /usr/include/c++/4.5/bits/ios_base.h:43:0,
                 from /usr/include/c++/4.5/ios:43,
                 from /usr/include/c++/4.5/ostream:40,
                 from /usr/include/c++/4.5/iostream:40,
                 from state.h:4,
                 from helper_functions.h:4,
                 from planner.cc:9:
/usr/include/c++/4.5/bits/locale_classes.h:394:5: error: ‘_GLIBCXX_CONST’ does 
not name a type
In file included from /usr/include/c++/4.5/bits/locale_facets.h:2601:0,
                 from /usr/include/c++/4.5/bits/basic_ios.h:39,
                 from /usr/include/c++/4.5/ios:45,
                 from /usr/include/c++/4.5/ostream:40,
                 from /usr/include/c++/4.5/iostream:40,
                 from state.h:4,
                 from helper_functions.h:4,
                 from planner.cc:9:
/usr/include/c++/4.5/bits/locale_facets.tcc:136:3: error: ‘_GLIBCXX_PURE’ does 
not name a type
/usr/include/c++/4.5/bits/locale_facets.tcc: In member function ‘_InIter 
std::num_get<_CharT, _InIter>::_M_extract_float(_InIter, _InIter, 
std::ios_base&, std::ios_base::iostate&, std::string&) const’:
/usr/include/c++/4.5/bits/locale_facets.tcc:357:16: error: ‘__verify_grouping’ 
is not a member of ‘std’
/usr/include/c++/4.5/bits/locale_facets.tcc: In member function ‘_InIter 
std::num_get<_CharT, _InIter>::_M_extract_int(_InIter, _InIter, std::ios_base&, 
std::ios_base::iostate&, _ValueT&) const’:
/usr/include/c++/4.5/bits/locale_facets.tcc:554:11: error: ‘__verify_grouping’ 
is not a member of ‘std’
In file included from /usr/include/c++/4.5/map:60:0,
                 from state.h:5,
                 from helper_functions.h:4,
                 from planner.cc:9:
/usr/include/c++/4.5/bits/stl_tree.h: At global scope:
/usr/include/c++/4.5/bits/stl_tree.h:140:3: error: ‘_GLIBCXX_PURE’ does not name 
a type
/usr/include/c++/4.5/bits/stl_tree.h:143:3: error: ‘_GLIBCXX_PURE’ does not name 
a type
/usr/include/c++/4.5/bits/stl_tree.h:146:3: error: ‘_GLIBCXX_PURE’ does not name 
a type
/usr/include/c++/4.5/bits/stl_tree.h:149:3: error: ‘_GLIBCXX_PURE’ does not name 
a type
/usr/include/c++/4.5/bits/stl_tree.h: In member function 
‘std::_Rb_tree_iterator<_Tp>::_Self& std::_Rb_tree_iterator<_Tp>::operator++()’:
/usr/include/c++/4.5/bits/stl_tree.h:184:38: error: there are no arguments to 
‘_Rb_tree_increment’ that depend on a template parameter, so a declaration of 
‘_Rb_tree_increment’ must be available
/usr/include/c++/4.5/bits/stl_tree.h:184:38: note: (if you use ‘-fpermissive’, 
G++ will accept your code, but allowing the use of an undeclared name is 
deprecated)
/usr/include/c++/4.5/bits/stl_tree.h: In member function 
‘std::_Rb_tree_iterator<_Tp>::_Self std::_Rb_tree_iterator<_Tp>::operator++
(int)’:
/usr/include/c++/4.5/bits/stl_tree.h:192:38: error: there are no arguments to 
‘_Rb_tree_increment’ that depend on a template parameter, so a declaration of 
‘_Rb_tree_increment’ must be available
/usr/include/c++/4.5/bits/stl_tree.h: In member function 
‘std::_Rb_tree_iterator<_Tp>::_Self& std::_Rb_tree_iterator<_Tp>::operator--()’:
/usr/include/c++/4.5/bits/stl_tree.h:199:38: error: there are no arguments to 
‘_Rb_tree_decrement’ that depend on a template parameter, so a declaration of 
‘_Rb_tree_decrement’ must be available
/usr/include/c++/4.5/bits/stl_tree.h: In member function 
‘std::_Rb_tree_iterator<_Tp>::_Self std::_Rb_tree_iterator<_Tp>::operator--
(int)’:
/usr/include/c++/4.5/bits/stl_tree.h:207:38: error: there are no arguments to 
‘_Rb_tree_decrement’ that depend on a template parameter, so a declaration of 
‘_Rb_tree_decrement’ must be available
/usr/include/c++/4.5/bits/stl_tree.h: In member function 
‘std::_Rb_tree_const_iterator<_Tp>::_Self& 
std::_Rb_tree_const_iterator<_Tp>::operator++()’:
/usr/include/c++/4.5/bits/stl_tree.h:259:38: error: there are no arguments to 
‘_Rb_tree_increment’ that depend on a template parameter, so a declaration of 
‘_Rb_tree_increment’ must be available
/usr/include/c++/4.5/bits/stl_tree.h: In member function 
‘std::_Rb_tree_const_iterator<_Tp>::_Self 
std::_Rb_tree_const_iterator<_Tp>::operator++(int)’:
/usr/include/c++/4.5/bits/stl_tree.h:267:38: error: there are no arguments to 
‘_Rb_tree_increment’ that depend on a template parameter, so a declaration of 
‘_Rb_tree_increment’ must be available
/usr/include/c++/4.5/bits/stl_tree.h: In member function 
‘std::_Rb_tree_const_iterator<_Tp>::_Self& 
std::_Rb_tree_const_iterator<_Tp>::operator--()’:
/usr/include/c++/4.5/bits/stl_tree.h:274:38: error: there are no arguments to 
‘_Rb_tree_decrement’ that depend on a template parameter, so a declaration of 
‘_Rb_tree_decrement’ must be available
/usr/include/c++/4.5/bits/stl_tree.h: In member function 
‘std::_Rb_tree_const_iterator<_Tp>::_Self 
std::_Rb_tree_const_iterator<_Tp>::operator--(int)’:
/usr/include/c++/4.5/bits/stl_tree.h:282:38: error: there are no arguments to 
‘_Rb_tree_decrement’ that depend on a template parameter, so a declaration of 
‘_Rb_tree_decrement’ must be available
/usr/include/c++/4.5/bits/stl_tree.h: At global scope:
/usr/include/c++/4.5/bits/stl_tree.h:1549:3: error: ‘_GLIBCXX_PURE’ does not 
name a type
make: *** [.obj/planner.o] Error 1
haz@mini-meee:~/Projects/fast-downward/src/preprocess$
History
Date User Action Args
2012-04-09 22:44:27jendriksetstatus: chatting -> resolved
messages: + msg2095
2012-04-09 20:24:27maltesetmessages: + msg2094
2012-04-09 19:05:02jendriksetmessages: + msg2093
2012-04-09 18:52:53maltesetmessages: + msg2092
2012-04-09 18:50:03jendriksetmessages: + msg2091
2012-04-09 18:05:33maltesetmessages: + msg2090
2012-04-09 12:21:23jendriksetstatus: resolved -> chatting
nosy: + jendrik
messages: + msg2089
2011-10-18 13:29:30maltesetstatus: chatting -> resolved
assignedto: malte
messages: + msg1823
2011-10-16 22:17:10moritzsetnosy: + moritz
messages: + msg1808
2011-07-29 21:21:25hazsetmessages: + msg1431
2011-07-29 19:47:34maltesetstatus: unread -> chatting
messages: + msg1430
2011-07-20 14:39:09maltesetnosy: + malte
2011-07-19 16:47:17hazcreate