Installation issue - DataBaseAPI.cc and read/write
I tried installing MAUS on an Arch-Linux 64-bit system, and there seems to be an issue of read, write and close not being declared:
g++ -o src/legacy/Interface/DataBaseAPI.os -c -Wall -Dlong32='int' "-Dlong64='long long'" -O3 -m64 -pthread -rdynamic -fPIC -Ithird_party/install/include -Ithird_party/install/include/python2.7 -Ithird_party/install/include/root -Isrc/legacy -Isrc/common_cpp -Ithird_party/build/root_v5.30.03/include -Ithird_party/build/geant4.9.2.p04/include -I. src/legacy/Interface/DataBaseAPI.cc
src/legacy/Interface/DataBaseAPI.cc: In member function 'XMLMessage DataBaseAPI::sendQuery(const XMLMessage&)':
src/legacy/Interface/DataBaseAPI.cc:87:56: error: 'write' was not declared in this scope
src/legacy/Interface/DataBaseAPI.cc:101:43: error: 'read' was not declared in this scope
src/legacy/Interface/DataBaseAPI.cc:120:18: error: 'close' was not declared in this scope
src/legacy/Interface/DataBaseAPI.cc: In member function 'bool DataBaseAPI::openConnection()':
src/legacy/Interface/DataBaseAPI.cc:179:20: error: 'close' was not declared in this scope
Now I am not sure where C libraries store their functions, but the file "include"d sstream as a header file. sstream was in /third_party/build/root_v5.30.03/cint/cint/include/ which seemed to link to iostream.h in the same folder, in which I couldn't find any read or write functions. Any suggestions for a work-around?
Updated by Pradhan, Neetish over 9 years ago
Now it's produced a more obscure error, can't make anything of it - attaching the log. It seems to start with this:
./src/common_cpp/JsonCppProcessors/ArrayProcessors-inl.hh: In instantiation of 'std::vector<ArrayContents*>* MAUS::PointerArrayProcessor<ArrayContents>::JsonToCpp(const Json::Value&) [with ArrayContents = MAUS::Trigger]':
./src/common_cpp/JsonCppProcessors/SpillProcessor.hh:42:7: required from here
./src/common_cpp/JsonCppProcessors/ArrayProcessors-inl.hh:63:21: warning: deleting object of polymorphic class type 'MAUS::Trigger' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
Updated by Rogers, Chris over 9 years ago
The warnings are actually not the problem. What happened here - when we run ROOT macro to make classes ROOT-aware (Rtypes ClassDef macro) ROOT sneakily adds virtual functions to the classes. So now we need a virtual destructor. My compiler didn't warn me about this, I only found out when I got a complaint. So I fixed it in the latest version.
The error is
g++ -o src/common_cpp/JsonCppProcessors/HitProcessor.os -c -Wall -Dlong32='int' "-Dlong64='long long'" -O3 -m64 -pthread -rdynamic -fPIC -Ithird_party/install/include -Ithird_party/install/include/python2.7 -Ithird_party/install/include/root -Isrc/legacy -Isrc/common_cpp -Ithird_party/build/root_v5.30.03/include -Ithird_party/build/geant4.9.2.p04/include -I. src/common_cpp/JsonCppProcessors/HitProcessor.cc In file included from src/common_cpp/JsonCppProcessors/HitProcessor.cc:17:0: ./src/common_cpp/JsonCppProcessors/HitProcessor.hh: In instantiation of 'void MAUS::HitProcessor<ChannelId>::RegisterBranches() [with ChannelId = MAUS::SciFiChannelId]': src/common_cpp/JsonCppProcessors/HitProcessor.cc:28:5: required from here ./src/common_cpp/JsonCppProcessors/HitProcessor.hh:54:5: error: 'RegisterValueBranch' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] ./src/common_cpp/JsonCppProcessors/HitProcessor.hh:54:5: note: declarations in dependent base 'MAUS::ObjectProcessor<MAUS::Hit<MAUS::SciFiChannelId> >' are not found by unqualified lookup ./src/common_cpp/JsonCppProcessors/HitProcessor.hh:54:5: note: use 'this->RegisterValueBranch' instead
Let me have a dig...
Updated by Rogers, Chris over 9 years ago
nb: you can just run
source env.sh; scons to build now - the third party libraries have all built okay I think so no need to go through all that again (scons takes ~5 minutes to compile everything, otherwise you have to rebuild G4 and ROOT which takes ~ 1 hour). Run the tests using