[SERVER-16103] compilation problem caused by boost dependency Created: 12/Nov/14  Updated: 01/Dec/14  Resolved: 01/Dec/14

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 2.6.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Allen K Assignee: Andrew Morrow (Inactive)
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

hi,
The binary packet of mongodb from the website won't run in my linux and it says as below:
mongo: /lib64/libgcc_s.so.1: version `GCC_4.0.0' not found (required by mongo)
mongo: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.1' not found (required by mongo)
so I decide to compile mongo myself. An error occured:
src/mongo/platform/unordered_map.h:52:29: tr1/unordered_map: No such file or directory
it seems that gcc cannot found the boost header files. but I have set --cpppath param for the scons. I noticed that the path of "unordered_map" is "boost/include/boost/tr1/tr1/unordered_map", and in the source file of mongodb "mongo/platform/unordered_map.h" line 52."#include <tr1/unordered_map>" indicate the path of "unordered_map" is "boost/include/boost/tr1/unordered_map" , so how can i solve the problem?

Thank you very much.
Allen



 Comments   
Comment by Ramon Fernandez Marina [ 01/Dec/14 ]

mizzler, we haven't heard back from you for some time, so we're closing this ticket. If this is still an issue for you please re-open it and provide the additional information requested above.

Comment by Andrew Morrow (Inactive) [ 14/Nov/14 ]

What is the output of gcc -v?

Comment by Allen K [ 14/Nov/14 ]

sorry , I dont know how to attach the file, error is as blow. besides , I cant find version 2.6.5 in github.
[work@m1-search-c11-zhixin-august-29.m1.baidu.com mongodb-src-r2.6.5]$ scons
scons: Reading SConscript files ...

scons: warning: EnsureSConsVersion is ignored for development version
File "/home/work/mongodb-src-r2.6.5/SConstruct", line 34, in <module>
scons version: 2.3.3
python version: 2 7 8 'final' 0

scons: warning: EnsureSConsVersion is ignored for development version
File "/home/work/mongodb-src-r2.6.5/site_scons/site_tools/gch.py", line 32, in <module>
Checking whether the C++ compiler works... yes
Checking whether the C compiler works... yes
Checking if C++ compiler "g++" is GCC... yes
Checking if C compiler "gcc" is GCC... yes
Checking if C compiler supports -Wno-unused-local-typedefs... no
Checking if C compiler supports -Wno-unused-function... yes
Checking if C compiler supports -Wno-unused-private-field... no
Checking if C compiler supports -Wno-deprecated-declarations... yes
Checking if C compiler supports -Wno-tautological-constant-out-of-range-compare... no
Checking if C compiler supports -Wno-unused-const-variable... yes
Checking if C compiler supports -fno-builtin-memcmp... yes
Checking for __thread... yes
Checking for C header file unistd.h... yes
Checking whether clock_gettime is declared... yes
Checking for C library rt... yes
Checking for C++ header file execinfo.h... yes
Checking whether backtrace is declared... yes
Checking whether backtrace_symbols is declared... yes
Checking whether backtrace_symbols_fd is declared... yes
Checking for C library pcap... yes
Checking if __malloc_hook is declared volatile... no
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/linux2/normal/mongo/db/db.o -c -Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-const-variable -fno-builtin-memcmp -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -DMONGO_OPTIMIZED_BUILD -D_FILE_OFFSET_BITS=64 -DMONGO_HAVE___THREAD -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_EXECINFO_BACKTRACE -Ibuild/linux2/normal/third_party/snappy -Isrc/third_party/snappy -Ibuild/linux2/normal/third_party/libstemmer_c/include -Isrc/third_party/libstemmer_c/include -Ibuild/linux2/normal/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/normal/third_party/boost -Isrc/third_party/boost -Ibuild/linux2/normal/third_party/pcre-8.30 -Isrc/third_party/pcre-8.30 -Ibuild/linux2/normal -Isrc -Ibuild/linux2/normal/mongo -Isrc/mongo -Ibuild/linux2/normal/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/normal/third_party/snappy -Isrc/third_party/snappy -Ibuild/linux2/normal/third_party/v8/include -Isrc/third_party/v8/include -Ibuild/linux2/normal/third_party/yaml-cpp-0.5.1/include -Isrc/third_party/yaml-cpp-0.5.1/include src/mongo/db/db.cpp
In file included from src/mongo/logger/log_manager.h:23,
from src/mongo/logger/logger.h:20,
from src/mongo/util/log.h:22,
from src/mongo/pch.h:81,
from src/mongo/db/db.cpp:31:
src/mongo/platform/unordered_map.h:52:29: tr1/unordered_map: No such file or directory
In file included from src/mongo/logger/log_manager.h:23,
from src/mongo/logger/logger.h:20,
from src/mongo/util/log.h:22,
from src/mongo/pch.h:81,
from src/mongo/db/db.cpp:31:
src/mongo/platform/unordered_map.h:56: error: `std::tr1' has not been declared
src/mongo/platform/unordered_map.h:56: error: expected nested-name-specifier before "unordered_map"
src/mongo/platform/unordered_map.h:56: error: `unordered_map' has not been declared
In file included from src/mongo/logger/logger.h:20,
from src/mongo/util/log.h:22,
from src/mongo/pch.h:81,
from src/mongo/db/db.cpp:31:
src/mongo/logger/log_manager.h:50: error: ISO C++ forbids declaration of `unordered_map' with no type
src/mongo/logger/log_manager.h:50: error: expected `;' before '<' token
src/mongo/logger/log_manager.h:52: error: `DomainsByNameMap' does not name a type
In file included from src/mongo/logger/logger.h:21,
from src/mongo/util/log.h:22,
from src/mongo/pch.h:81,
from src/mongo/db/db.cpp:31:
src/mongo/logger/rotatable_file_manager.h:71: error: ISO C++ forbids declaration of `unordered_map' with no type
src/mongo/logger/rotatable_file_manager.h:71: error: expected `;' before '<' token
src/mongo/logger/rotatable_file_manager.h:73: error: `WriterByNameMap' does not name a type
In file included from src/mongo/base/initializer_dependency_graph.h:26,
from src/mongo/base/initializer.h:23,
from src/mongo/base/init.h:31,
from src/mongo/db/db.cpp:37:
src/mongo/platform/unordered_set.h:52:29: tr1/unordered_set: No such file or directory
In file included from src/mongo/base/initializer_dependency_graph.h:26,
from src/mongo/base/initializer.h:23,
from src/mongo/base/init.h:31,
from src/mongo/db/db.cpp:37:
src/mongo/platform/unordered_set.h:56: error: `std::tr1' has not been declared
src/mongo/platform/unordered_set.h:56: error: expected nested-name-specifier before "unordered_set"
src/mongo/platform/unordered_set.h:56: error: `unordered_set' has not been declared
In file included from src/mongo/base/initializer.h:23,
from src/mongo/base/init.h:31,
from src/mongo/db/db.cpp:37:
src/mongo/base/initializer_dependency_graph.h:94: error: ISO C++ forbids declaration of `unordered_set' with no type
src/mongo/base/initializer_dependency_graph.h:94: error: expected `;' before '<' token
src/mongo/base/initializer_dependency_graph.h:97: error: ISO C++ forbids declaration of `unordered_map' with no type
src/mongo/base/initializer_dependency_graph.h:97: error: expected `;' before '<' token
src/mongo/base/initializer_dependency_graph.h:98: error: `NodeMap' has not been declared
src/mongo/base/initializer_dependency_graph.h:98: error: ISO C++ forbids declaration of `value_type' with no type
src/mongo/base/initializer_dependency_graph.h:98: error: expected `;' before "Node"
src/mongo/base/initializer_dependency_graph.h:104: error: expected `,' or `...' before '&' token
src/mongo/base/initializer_dependency_graph.h:108: error: ISO C++ forbids declaration of `NodeMap' with no type
src/mongo/base/initializer_dependency_graph.h:115: error: `NodeMap' does not name a type
In file included from src/mongo/db/auth/role_name.h:39,
from src/mongo/db/auth/authz_manager_external_state.h:37,
from src/mongo/db/auth/authz_manager_external_state_local.h:37,
from src/mongo/db/auth/authz_manager_external_state_d.h:37,
from src/mongo/db/db.cpp:41:
src/mongo/platform/hash_namespace.h:56:26: tr1/functional: No such file or directory
In file included from src/mongo/db/auth/authz_manager_external_state.h:37,
from src/mongo/db/auth/authz_manager_external_state_local.h:37,
from src/mongo/db/auth/authz_manager_external_state_d.h:37,
from src/mongo/db/db.cpp:41:
src/mongo/db/auth/role_name.h:146: error: `hash' is not a template
src/mongo/db/auth/role_name.h:146: error: explicit specialization of non-template `std::tr1::hash'
src/mongo/db/auth/role_name.h: In member function `size_t std::tr1::hash::operator()(const mongo::RoleName&) const':
src/mongo/db/auth/role_name.h:148: error: `std::tr1::hash' is not a template
src/mongo/db/auth/role_name.h:148: error: no match for call to `(std::tr1::hash) (const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
src/mongo/db/auth/role_name.h:147: note: candidates are: size_t std::tr1::hash::operator()(const mongo::RoleName&) const
In file included from src/mongo/db/jsobj.h:42,
from src/mongo/db/auth/authz_manager_external_state.h:39,
from src/mongo/db/auth/authz_manager_external_state_local.h:37,
from src/mongo/db/auth/authz_manager_external_state_d.h:37,
from src/mongo/db/db.cpp:41:
src/mongo/bson/bson-inl.h: At global scope:
src/mongo/bson/bson-inl.h:208: warning: inline function 'void mongo::BSONObj::_assertInvalid() const' given attribute noinline
src/mongo/bson/bson-inl.h:225: warning: inline function 'mongo::BSONObj mongo::BSONObj::copy() const' given attribute noinline
In file included from src/mongo/db/auth/privilege.h:23,
from src/mongo/db/auth/role_graph.h:36,
from src/mongo/db/auth/authz_manager_external_state_local.h:38,
from src/mongo/db/auth/authz_manager_external_state_d.h:37,
from src/mongo/db/db.cpp:41:
src/mongo/db/auth/resource_pattern.h: In member function `size_t mongo::ResourcePattern::hash() const':
src/mongo/db/auth/resource_pattern.h:171: error: `std::tr1::hash' is not a template
src/mongo/db/auth/resource_pattern.h:171: error: no match for call to `(std::tr1::hash) (const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
src/mongo/db/auth/role_name.h:147: note: candidates are: size_t std::tr1::hash::operator()(const mongo::RoleName&) const
src/mongo/db/auth/resource_pattern.h: At global scope:
src/mongo/db/auth/resource_pattern.h:205: error: `hash' is not a template
src/mongo/db/auth/resource_pattern.h:205: error: redefinition of `struct std::tr1::hash'
src/mongo/db/auth/role_name.h:146: error: previous definition of `struct std::tr1::hash'
In file included from src/mongo/db/auth/authz_manager_external_state_local.h:38,
from src/mongo/db/auth/authz_manager_external_state_d.h:37,
from src/mongo/db/db.cpp:41:
src/mongo/db/auth/role_graph.h:265: error: `unordered_set' has not been declared
src/mongo/db/auth/role_graph.h:265: error: expected `,' or `...' before '<' token
src/mongo/db/auth/role_graph.h:265: error: ISO C++ forbids declaration of `parameter' with no type
src/mongo/db/auth/role_graph.h:299: error: ISO C++ forbids declaration of `unordered_map' with no type
src/mongo/db/auth/role_graph.h:299: error: expected `;' before '<' token
src/mongo/db/auth/role_graph.h:301: error: ISO C++ forbids declaration of `unordered_map' with no type
src/mongo/db/auth/role_graph.h:301: error: expected `;' before '<' token
src/mongo/db/auth/role_graph.h:303: error: `EdgeSet' does not name a type
src/mongo/db/auth/role_graph.h:304: error: ISO C++ forbids declaration of `unordered_map' with no type
src/mongo/db/auth/role_graph.h:304: error: expected `;' before '<' token
src/mongo/db/auth/role_graph.h:305: error: `EdgeSet' does not name a type
src/mongo/db/auth/role_graph.h:306: error: `RolePrivilegeMap' does not name a type
src/mongo/db/auth/role_graph.h:307: error: `RolePrivilegeMap' does not name a type
In file included from src/mongo/db/auth/authorization_manager.h:44,
from src/mongo/db/db.cpp:42:
src/mongo/db/auth/user.h:54: error: ISO C++ forbids declaration of `unordered_map' with no type
src/mongo/db/auth/user.h:54: error: expected `;' before '<' token
src/mongo/db/auth/user.h:82: error: ISO C++ forbids declaration of `ResourcePrivilegeMap' with no type
src/mongo/db/auth/user.h:82: error: expected `;' before '&' token
src/mongo/db/auth/user.h:87: error: expected `;' before "const"
src/mongo/db/auth/user.h:211: error: `ResourcePrivilegeMap' does not name a type
src/mongo/db/auth/user.h:214: error: ISO C++ forbids declaration of `unordered_set' with no type
src/mongo/db/auth/user.h:214: error: expected `;' before '<' token
In file included from src/mongo/db/auth/authorization_manager.h:46,
from src/mongo/db/db.cpp:42:
src/mongo/db/auth/user_name_hash.h:26: error: `hash' is not a template
src/mongo/db/auth/user_name_hash.h:26: error: redefinition of `struct std::tr1::hash'
src/mongo/db/auth/role_name.h:146: error: previous definition of `struct std::tr1::hash'
In file included from src/mongo/db/db.cpp:42:
src/mongo/db/auth/authorization_manager.h:488: error: ISO C++ forbids declaration of `unordered_map' with no type
src/mongo/db/auth/authorization_manager.h:488: error: expected `;' before '<' token
In file included from src/mongo/db/catalog/index_catalog_entry.h:37,
from src/mongo/db/catalog/index_catalog.h:35,
from src/mongo/db/db.cpp:44:
src/mongo/db/diskloc.h: In member function `size_t mongo::DiskLoc::Hasher::operator()(mongo::DiskLoc) const':
src/mongo/db/diskloc.h:194: error: `unordered_set' was not declared in this scope
src/mongo/db/diskloc.h:194: error: expected primary-expression before '>' token
src/mongo/db/diskloc.h:194: error: `::hasher' has not been declared
src/mongo/db/diskloc.h:195: error: expected primary-expression before '>' token
src/mongo/db/diskloc.h:195: error: `::hasher' has not been declared
In file included from src/mongo/db/db.cpp:44:
src/mongo/db/catalog/index_catalog.h: At global scope:
src/mongo/db/catalog/index_catalog.h:271: error: ISO C++ forbids declaration of `unordered_map' with no type
src/mongo/db/catalog/index_catalog.h:271: error: expected `;' before '<' token
src/mongo/db/catalog/index_catalog.h:339: error: `InProgressIndexesMap' does not name a type
In file included from src/mongo/db/server_options.h:19,
from src/mongo/util/net/hostandport.h:21,
from src/mongo/db/client_basic.h:33,
from src/mongo/db/client.h:41,
from src/mongo/db/db.cpp:46:
src/mongo/platform/process_id.h:107: error: `hash' is not a template
src/mongo/platform/process_id.h:107: error: redefinition of `struct std::tr1::hash'
src/mongo/db/auth/role_name.h:146: error: previous definition of `struct std::tr1::hash'
In file included from src/mongo/db/clientcursor.h:35,
from src/mongo/db/db.cpp:47:
src/mongo/db/keypattern.h:195: error: ISO C++ forbids declaration of `unordered_set' with no type
src/mongo/db/keypattern.h:195: error: expected `;' before '<' token
src/mongo/db/keypattern.h: In member function `bool mongo::KeyPattern::hasField(const mongo::StringData&) const':
src/mongo/db/keypattern.h:78: error: `_prefixes' was not declared in this scope
In file included from src/mongo/db/exec/plan_stage.h:32,
from src/mongo/db/exec/collection_scan.h:33,
from src/mongo/db/query/internal_plans.h:33,
from src/mongo/db/db.cpp:64:
src/mongo/db/exec/working_set.h: At global scope:
src/mongo/db/exec/working_set.h:102: error: ISO C++ forbids declaration of `unordered_set' with no type
src/mongo/db/exec/working_set.h:102: error: expected `;' before '<' token
src/mongo/db/exec/working_set.h:126: error: ISO C++ forbids declaration of `unordered_set' with no type
src/mongo/db/exec/working_set.h:126: error: expected `;' before '<' token
In file included from src/mongo/db/catalog/collection.h:36,
from src/mongo/db/index/index_descriptor.h:38,
from src/mongo/db/index/btree_index_cursor.h:38,
from src/mongo/db/exec/index_scan.h:33,
from src/mongo/db/query/internal_plans.h:35,
from src/mongo/db/db.cpp:64:
src/mongo/db/catalog/collection_cursor_cache.h:132: error: ISO C++ forbids declaration of `unordered_set' with no type
src/mongo/db/catalog/collection_cursor_cache.h:132: error: expected `;' before '<' token
src/mongo/db/catalog/collection_cursor_cache.h:133: error: `RunnerSet' does not name a type
In file included from src/mongo/db/catalog/collection_info_cache.h:35,
from src/mongo/db/catalog/collection.h:42,
from src/mongo/db/index/index_descriptor.h:38,
from src/mongo/db/index/btree_index_cursor.h:38,
from src/mongo/db/exec/index_scan.h:33,
from src/mongo/db/query/internal_plans.h:35,
from src/mongo/db/db.cpp:64:
src/third_party/boost/boost/unordered/detail/allocator_helpers.hpp: In instantiation of `boost::unordered::detail::allocator_traits<std::allocator<boost::unordered::detail::ptr_node<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > > > >':
src/third_party/boost/boost/unordered/detail/unique.hpp:107: instantiated from `boost::unordered::detail::pick_node<std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > >, std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > >'
src/third_party/boost/boost/unordered/detail/unique.hpp:152: instantiated from `boost::unordered::detail::map<std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > >, mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> >, boost::hash<std::string>, std::equal_to<mongo::PlanCacheKey> >'
src/third_party/boost/boost/unordered/unordered_map.hpp:60: instantiated from `boost::unordered::unordered_map<mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> >, boost::hash<std::string>, std::equal_to<mongo::PlanCacheKey>, std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > > >'
src/mongo/db/query/lru_key_value.h:76: instantiated from `mongo::LRUKeyValue<mongo::PlanCacheKey, mongo::PlanCacheEntry>'
src/mongo/db/query/plan_cache.h:398: instantiated from here
src/third_party/boost/boost/unordered/detail/allocator_helpers.hpp:411: error: `template<class T> static typename boost::disable_if_c< boost::unordered::detail::has_construct<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_node<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > > >]' and `template<class T> static typename boost::enable_if_c< boost::unordered::detail::has_construct<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_node<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > > >]' cannot be overloaded
src/third_party/boost/boost/unordered/detail/allocator_helpers.hpp:427: error: `template<class T> static typename boost::disable_if_c< boost::unordered::detail::has_destroy<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_node<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > > >]' and `template<class T> static typename boost::enable_if_c< boost::unordered::detail::has_destroy<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_node<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > > >]' cannot be overloaded
src/third_party/boost/boost/unordered/detail/allocator_helpers.hpp: In instantiation of `boost::unordered::detail::allocator_traits<std::allocator<boost::unordered::detail::ptr_bucket> >':
src/third_party/boost/boost/unordered/detail/unique.hpp:107: instantiated from `boost::unordered::detail::pick_node<std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > >, std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > >'
src/third_party/boost/boost/unordered/detail/unique.hpp:152: instantiated from `boost::unordered::detail::map<std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > >, mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> >, boost::hash<std::string>, std::equal_to<mongo::PlanCacheKey> >'
src/third_party/boost/boost/unordered/unordered_map.hpp:60: instantiated from `boost::unordered::unordered_map<mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> >, boost::hash<std::string>, std::equal_to<mongo::PlanCacheKey>, std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > > >'
src/mongo/db/query/lru_key_value.h:76: instantiated from `mongo::LRUKeyValue<mongo::PlanCacheKey, mongo::PlanCacheEntry>'
src/mongo/db/query/plan_cache.h:398: instantiated from here
src/third_party/boost/boost/unordered/detail/allocator_helpers.hpp:411: error: `template<class T> static typename boost::disable_if_c< boost::unordered::detail::has_construct<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_bucket>]' and `template<class T> static typename boost::enable_if_c< boost::unordered::detail::has_construct<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_bucket>]' cannot be overloaded
src/third_party/boost/boost/unordered/detail/allocator_helpers.hpp:427: error: `template<class T> static typename boost::disable_if_c< boost::unordered::detail::has_destroy<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_bucket>]' and `template<class T> static typename boost::enable_if_c< boost::unordered::detail::has_destroy<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_bucket>]' cannot be overloaded
src/third_party/boost/boost/unordered/detail/allocator_helpers.hpp: In instantiation of `boost::unordered::detail::allocator_traits<std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > > >':
src/third_party/boost/boost/unordered/unordered_map.hpp:66: instantiated from `boost::unordered::unordered_map<mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> >, boost::hash<std::string>, std::equal_to<mongo::PlanCacheKey>, std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > > >'
src/mongo/db/query/lru_key_value.h:76: instantiated from `mongo::LRUKeyValue<mongo::PlanCacheKey, mongo::PlanCacheEntry>'
src/mongo/db/query/plan_cache.h:398: instantiated from here
src/third_party/boost/boost/unordered/detail/allocator_helpers.hpp:411: error: `template<class T> static typename boost::disable_if_c< boost::unordered::detail::has_construct<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > >]' and `template<class T> static typename boost::enable_if_c< boost::unordered::detail::has_construct<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > >]' cannot be overloaded
src/third_party/boost/boost/unordered/detail/allocator_helpers.hpp:427: error: `template<class T> static typename boost::disable_if_c< boost::unordered::detail::has_destroy<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > >]' and `template<class T> static typename boost::enable_if_c< boost::unordered::detail::has_destroy<Alloc,T>::value, void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<std::pair<const mongo::PlanCacheKey, std::_List_iterator<std::pair<mongo::PlanCacheKey, mongo::PlanCacheEntry*> > > >]' cannot be overloaded
In file included from src/mongo/db/catalog/collection_info_cache.h:36,
from src/mongo/db/catalog/collection.h:42,
from src/mongo/db/index/index_descriptor.h:38,
from src/mongo/db/index/btree_index_cursor.h:38,
from src/mongo/db/exec/index_scan.h:33,
from src/mongo/db/query/internal_plans.h:35,
from src/mongo/db/db.cpp:64:
src/mongo/db/query/query_settings.h:136: error: ISO C++ forbids declaration of `unordered_map' with no type
src/mongo/db/query/query_settings.h:136: error: expected `;' before '<' token
src/mongo/db/query/query_settings.h:137: error: `AllowedIndexEntryMap' does not name a type
In file included from src/mongo/db/exec/index_scan.h:33,
from src/mongo/db/query/internal_plans.h:35,
from src/mongo/db/db.cpp:64:
src/mongo/db/index/btree_index_cursor.h:95: error: ISO C++ forbids declaration of `unordered_set' with no type
src/mongo/db/index/btree_index_cursor.h:95: error: expected `;' before '<' token
In file included from src/mongo/db/query/internal_plans.h:35,
from src/mongo/db/db.cpp:64:
src/mongo/db/exec/index_scan.h:142: error: ISO C++ forbids declaration of `unordered_set' with no type
src/mongo/db/exec/index_scan.h:142: error: expected `;' before '<' token
scons: *** [build/linux2/normal/mongo/db/db.o] Error 1
scons: building terminated because of errors.

Comment by Allen K [ 14/Nov/14 ]

i am using 2.6.5 source files donwloaded from "http://www.mongodb.org/downloads", I found out that in this source files, src/third-party/boost is incomplete, I cannot find "tr1/tr1/unordered_set" in the directory. I think that is why compilation failed. Error hint is provided in the attachment.
I also donwload "mongo-master" from https://github.com/mongodb/mongo, and when i finsheded the compilation , "mongod -version" show the version is "db version v2.8.0-rc1-pre". In this version ,boost-1.56.0 is provided, and " "tr1/tr1/unordered_set" can be found. So I want to make sure if there is any problem in source packet donwloaded from "http://www.mongodb.org/downloads".
Thanks a lot.

Comment by Andrew Morrow (Inactive) [ 13/Nov/14 ]

Sorry, forgot to say, please also let us know which version of mongodb you are trying to build.

Comment by Andrew Morrow (Inactive) [ 13/Nov/14 ]

Please provide your SCons invocation and the output of the configure checks. Also, please make sure to force a reconfigure if you have updated the compiler under the same path by running SCons with --config=force.

Comment by Allen K [ 13/Nov/14 ]

hi Andrew,
thanks very much. as my CentOS version is too old, I update gcc to 4.8, but i got compilation problem that mongo cant find boost header files. how could I fix that problem?

Comment by Andrew Morrow (Inactive) [ 12/Nov/14 ]

MongoDB 2.6 does not support CentOS 4.3. The MongoDB packages require RedHat 5.5 compatible (or better) runtime ABI support, meaning at least GCC 4.1 ABI. CentOS 4.3 is based on the GCC 3 runtime library which is too old.

Comment by Allen K [ 12/Nov/14 ]

ps:my system info is:
uname -a
Linux m1 2.6.32_1-15-0-0 #1 SMP Fri Sep 19 15:37:59 CST 2014 x86_64 GNU/Linux
lsb_release -a
LSB Version: :core-3.0-amd64:core-3.0-ia32:core-3.0-noarch:graphics-3.0-amd64:graphics-3.0-ia32:graphics-3.0-noarch
.Distributor ID: CentOS
Description: CentOS release 4.3 (Final)
Release: 4.3
Codename: Final

boost :boost_1_57_0.tar.bz2

Generated at Thu Feb 08 03:39:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.