testdockerwcsim / XTriggerApplication

Other
2 stars 3 forks source link

Error when building from source #21

Closed ast0815 closed 4 years ago

ast0815 commented 4 years ago

When trying to run ./GetToolDAQ.sh it runs into this error after a while:

*************** Making  lib/libStore.so ****************
cp src/Store/*.h include/
g++  -shared -fPIC -I include src/Store/*.cpp -o lib/libStore.so -L ../boost_1_66_0/install/lib -lboost_date_time -lboost_serialization  -lboost_iostreams -I ../boost_1_66_0/install/include/
src/Store/BoostStore.cpp: In member function ‘bool BoostStore::GetEntry(long unsigned int)’:
src/Store/BoostStore.cpp:300:7: error: expected ‘;’ before ‘delete’
       delete arch;
       ^
make[1]: *** [lib/libStore.so] Error 1
make[1]: Leaving directory `/opt/ppd/scratch/kdf77245/hk_software/TriggerApplication/ToolDAQ/ToolDAQFramework'
make: *** [lib/libStore.so] Error 2
ast0815 commented 4 years ago

Fixing this by manually adding the ; in the source code, later leads to this error (on CentOS7):

*************** Making  lib/libDataModel.so ****************
cp DataModel/*.h include/
g++ -g -fPIC -shared DataModel/*.cpp -I include -L lib -lStore  -lLogging  -o lib/libDataModel.so -I/usr/include/root -I/include -L/usr/lib64/root -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTDataFrame -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -pthread -lm -ldl -rdynamic -L -lWCSimRoot -L ToolDAQ/zeromq-4.0.7/lib -lzmq  -I ToolDAQ/zeromq-4.0.7/include/   -L ToolDAQ/boost_1_66_0/install/lib -lboost_date_time -lboost_serialization -lboost_iostreams -I ToolDAQ/boost_1_66_0/install/include
In file included from /usr/include/root/RtypesCore.h:23:0,
                 from /usr/include/root/Rtypes.h:23,
                 from /usr/include/root/Compression.h:15,
                 from /usr/include/root/TTree.h:29,
                 from /usr/include/root/TChain.h:24,
                 from DataModel/DataModel.h:8,
                 from DataModel/DataModel.cpp:1:
/usr/include/root/ROOT/RConfig.hxx:48:4: error: #error "ROOT requires support for C++11 or higher."
 #  error "ROOT requires support for C++11 or higher."
    ^
/usr/include/root/ROOT/RConfig.hxx:50:5: error: #error "Pass `-std=c++11` as compiler argument."
 #   error "Pass `-std=c++11` as compiler argument."
     ^
In file included from /usr/include/c++/4.8.2/atomic:38:0,
                 from /usr/include/root/Rtypes.h:29,
                 from /usr/include/root/Compression.h:15,
                 from /usr/include/root/TTree.h:29,
                 from /usr/include/root/TChain.h:24,
                 from DataModel/DataModel.h:8,
                 from DataModel/DataModel.cpp:1:
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
In file included from DataModel/DataModel.cpp:1:0:
DataModel/DataModel.h:10:31: fatal error: WCSimRootOptions.hh: No such file or directory
 #include "WCSimRootOptions.hh"
tdealtry commented 4 years ago

#include "WCSimRootOptions.hh" suggests that either one or both of the following aren't working: https://github.com/HKDAQ/TriggerApplication/blob/95e8a45d920826908741d7e84514b10facc77b60/Dockerfile.base#L5 https://github.com/HKDAQ/TriggerApplication/blob/95e8a45d920826908741d7e84514b10facc77b60/Dockerfile.base#L32-L43

The WCSim image should get ROOT 5 (not 6) so shouldn't be complaining about C++11 https://github.com/WCSim/WCSim/blob/develop/Dockerfile.base#L42

So could it be to do with the WCSim dockerfile not getting past the 2nd step? https://github.com/WCSim/WCSim/blob/9d136c258216aa6c667b03a5496907433e60470e/Dockerfile.base#L6-L7

And ROOT 6 then maybe comes from the CERN SL6 image https://github.com/WCSim/WCSim/blob/9d136c258216aa6c667b03a5496907433e60470e/Dockerfile.base#L3-L4

This is all speculation. But I think it would be worth attempting to getting a working WCSim image for singularity, before continuing with TriggerApplication

ast0815 commented 4 years ago

I am not sure how docker plays into this. I just checked out the git repo and then ran ./GetToolDAQ.sh. Does that use docker in the background?

tdealtry commented 4 years ago

19 should fix it

I've also put in a PR for the semicolon in ToolDAQFramework ToolDAQ/ToolDAQFramework#8

ast0815 commented 4 years ago

I have tried to build from your hotfix branch, after sourcing my WCSim setup. I am not sure it worked. The whole ./GetToolDAQ.sh thing ends with the following error message:

gcc.link.dll bin.v2/libs/iostreams/build/gcc-gnu-4.8.5/debug/threadapi-pthread/libboost_iostreams.so.1.66.0
...updated 15267 targets...
current directory
/home/ppd/kdf77245/scratch/hk_software/TriggerApplication

*************** Cleaning up ****************
rm -f include/*.h
rm -f lib/*.so
rm -f main
rm -f RemoteControl
rm -f NodeDaemon
rm -f UserTools/CUDA/*.o
make: *** No rule to make target `ToolDAQ/ToolDAQFramework/src/Store/*', needed by `lib/libStore.so'.  Stop.

Does that mean it failed, or does that mean it worked, but screwed up the clean-up? It seems to me like it was trying top build libStore, but could not.

brichards64 commented 4 years ago

Sorry for being late to the party, iv had a lot on my plate.

you do look to be in a pickle. I thought i had left it plug and play (minus the recent semicolon that Tom noticed).

i'm a little lost as to what your exactly doing? are you using the docker image or building from source?

ast0815 commented 4 years ago

Here I am trying to build from source, following the instructions in the README. I tried the docker image first, but that requires root to run, i.e. it does not work with singularity (as far as I understand it).

tdealtry commented 4 years ago

After the prerequesits are built, GetToolDAQ.sh does

    make clean
    source Setup.sh
    make 

And lib/libStore.so should be the first thing to be built according to the Makefile.

So we have the make clean working, but the make failing at the first hurdle.

I don't know what's going on really - it just works for me (SL6). For reference, here's the first few lines from my build output (after I did a make clean in ToolDAQ/ToolDAQFramework).

Did you rerun Setup.sh after you sourced WCSim? (I've edited the message now to make it explicit that you should do)

$ ./GetToolDAQ.sh --Final
Compiling ToolDAQ
current directory
/t2k/hyperk/software/TriggerApplication_test/TriggerApplication

*************** Cleaning up ****************
rm -f include/*.h
rm -f lib/*.so
rm -f main
rm -f RemoteControl
rm -f NodeDaemon
rm -f UserTools/CUDA/*.o
cd ToolDAQ/ToolDAQFramework && make lib/libStore.so
make[1]: Entering directory `/t2k/hyperk/software/TriggerApplication_test/TriggerApplication/ToolDAQ/ToolDAQFramework'

*************** Making  lib/libStore.so ****************
cp src/Store/*.h include/
g++  -shared -fPIC -I include src/Store/*.cpp -o lib/libStore.so -L ../boost_1_66_0/install/lib -lboost_date_time -lboost_serialization  -lboost_iostreams -I ../boost_1_66_0/install/include/
make[1]: Leaving directory `/t2k/hyperk/software/TriggerApplication_test/TriggerApplication/ToolDAQ/ToolDAQFramework'

*************** Copying  lib/libStore.so ****************
cp ToolDAQ/ToolDAQFramework/src/Store/*.h include/
cp ToolDAQ/ToolDAQFramework/lib/libStore.so lib/
#g++ -g -fPIC -shared  -I include ToolDAQ/ToolDAQFramework/src/Store/*.cpp -o lib/libStore.so -L ToolDAQ/boost_1_66_0/install/lib -lboost_date_time -lboost_serialization -lboost_iostreams -I ToolDAQ/boost_1_66_0/install/include
cd ToolDAQ/ToolDAQFramework && make lib/libLogging.so
make[1]: Entering directory `/t2k/hyperk/software/TriggerApplication_test/TriggerApplication/ToolDAQ/ToolDAQFramework'
ast0815 commented 4 years ago

Ok, so I re-did things from scratch and this time it went past the libStore, but it failed at libDataModel:

*************** Making  lib/libDataModel.so ****************
cp DataModel/*.h include/
g++ -g -fPIC -shared DataModel/*.cpp -I include -L lib -lStore  -lLogging  -o lib/libDataModel.so -I/home/ppd/kdf77245/scratch/hk_software/root/include -I/home/ppd/kdf77245/scratch/hk_software/WCSim_E61/include -L/home/ppd/kdf77245/scratch/hk_software/root/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic -L/home/ppd/kdf77245/scratch/hk_software/WCSim_E61 -lWCSimRoot -L ToolDAQ/zeromq-4.0.7/lib -lzmq  -I ToolDAQ/zeromq-4.0.7/include/   -L ToolDAQ/boost_1_66_0/install/lib -lboost_date_time -lboost_serialization -lboost_iostreams -I ToolDAQ/boost_1_66_0/install/include
In file included from DataModel/DataModel.cpp:1:0:
DataModel/DataModel.h:10:31: fatal error: WCSimRootOptions.hh: No such file or directory
 #include "WCSimRootOptions.hh"

Do I need a specific version of WCSim for this to work? The one I have might be a bit outdated.

tdealtry commented 4 years ago

Yeah a recent version is required. https://github.com/tdealtry/WCSim/tree/trigger or the head should both work

tdealtry commented 4 years ago

Jusy to follow up - you need my branch if you're comparing output directly from WCSim with output from TriggerApplication. If not, the head should work (it runs fine for me) See WCSim/WCSim#272 for details

ast0815 commented 4 years ago

Ok, I think I managed to build everything now. The README instructions should be updated though. They say I need to source Setup.sh again and then do a make. It seems like GetToolDAQ.sh is already doing everything though.