[ NOTE: There is no "analysis" component in the Bugzilla menu. ] During compilation on MacOSX 10.5.8, GCC 4.0.1, the build of "analysis" fails: Compiling G4RootAnalysisManager.cc ... include/tools/wroot/../vdata: In function 'const T* tools::vec_data(const std::vector<T, std::allocator<_CharT> >&) [with T = double]': include/tools/wroot/named:164: instantiated from 'bool tools::wroot::Array_stream(tools::wroot::buffer&, const std::vector<T, std::allocator<_CharT> >&) [with T = double]' include/tools/wroot/streamers:81: instantiated from here include/tools/wroot/../vdata:17: error: 'const class std::vector<double, std::allocator<double> >' has no member named 'data' include/tools/wroot/../vdata: In function 'const T* tools::vec_data(const std::vector<T, std::allocator<_CharT> >&) [with T = float]': include/tools/wroot/named:164: instantiated from 'bool tools::wroot::Array_stream(tools::wroot::buffer&, const std::vector<T, std::allocator<_CharT> >&) [with T = float]' include/tools/wroot/streamers:207: instantiated from here include/tools/wroot/../vdata:17: error: 'const class std::vector<float, std::allocator<float> >' has no member named 'data' include/tools/wroot/../vdata: In function 'const T* tools::vec_data(const std::vector<T, std::allocator<_CharT> >&) [with T = int]': include/tools/wroot/named:164: instantiated from 'bool tools::wroot::Array_stream(tools::wroot::buffer&, const std::vector<T, std::allocator<_CharT> >&) [with T = int]' include/tools/wroot/tree:66: instantiated from here include/tools/wroot/../vdata:17: error: 'const class std::vector<int, std::allocator<int> >' has no member named 'data' gmake[1]: *** [/Users/kelsey/geant4/g4_SVN/geant4/tmp/Darwin-g++/G4analysis/G4RootAnalysisManager.o] Error 1 The error occurs because analysis/include/tools/vdata is using a non-standard construction, std::vector<>::data(). This problem has been seen and discussed elsewhere, for example http://gcc.gnu.org/ml/gcc-bugs/2008-10/msg02113.html http://lists.cs.uiuc.edu/pipermail/lldb-dev/2010-July/000165.html The fix is to eliminate the #if block in vdata, and use &(vector<>::front()) on all platforms. std::vector<>::data() is apparently part of "C++0x," which is the upcoming C++ new standard, but is not yet deployed consistently: http://stackoverflow.com/questions/6212572/whats-the-status-of-stdvectordata
On further investigation, GCC and Intel compilers define the macro __GXX_EXPERIMENTAL_CXX0X__ in order to use new C++0x language features, such as std::vector<>::data(). The code in analysis/include/tools/vdata should be rewritten to respect this macro: template <class T> inline const T* vec_data(const std::vector<T>& a_vec) { #ifdef __GXX_EXPERIMENTAL_CXX0X__ return a_vec.data(); #else return &(a_vec.front()); #endif }
Fix now included in tag "analysis-V09-04-05".