Tutorial 01: larcv installation

Posted on Wed 06 December 2017 in misc by Kazuhiro Terao

We'll practice installing larcv on your local machine (laptop, server, etc.) manually. An alternative option is to use a container (harass Kazu to make that work).

Requirement

  • ROOT v6.04.00 or later

larcv has extensive python API made available through pyroot. To make sure you have pyroot installed, try:

In [2]:
import ROOT

no error? great! You can use larcv without python API if you want to. But we have lots of python based useful scripts. So it is highly recommended to get pyroot working on your environment!

Cloning repository

OK let's clone the repository. I execute this from my notebook using shell command.

In [3]:
%%bash
git clone https://github.com/DeepLearnPhysics/larcv2
Cloning into 'larcv2'...

Make sure it's cloned. It should look like this:

In [4]:
%%bash
ls larcv2
GNUmakefile
Makefile
README.md
bin
configure.sh
doc
larcv
python
ups

Configure to use larcv

To use larcv, you need to execute one command:

source configure.sh

Only if this is the 1st time (it is!) you also have to run make. Let's configure and make.

In [5]:
%%bash
cd larcv2 && source configure.sh && make -j
LArCV FYI shell env. may useful for external packages:
    LARCV_INCDIR   = /Users/kazuhiro/PlayGit/larcv-tutorial/notebooks/larcv2/build/include
    LARCV_LIBDIR   = /Users/kazuhiro/PlayGit/larcv-tutorial/notebooks/larcv2/build/lib
    LARCV_BUILDDIR = /Users/kazuhiro/PlayGit/larcv-tutorial/notebooks/larcv2/build

Finish configuration. To build, type:
> cd $LARCV_BUILDDIR
> make 


Building core...


Compiling Base...
<< checking dependencies>>
<< generating dict >>
<< compiling ConfigManager.cxx >>
<< compiling LArCVBaseUtilFunc.cxx >>
<< compiling PSet.cxx >>
<< compiling Parser.cxx >>
<< compiling larcv_logger.cxx >>
<< compiling BaseDict.cxx >>
<< installing headers >>

Compiling DataFormat...
<< checking dependencies>>
<< generating dict >>
<< compiling BBox.cxx >>
<< compiling ChStatus.cxx >>
<< compiling DataProductFactory.cxx >>
<< compiling EventBBox.cxx >>
<< compiling EventBase.cxx >>
<< compiling EventChStatus.cxx >>
<< compiling EventImage2D.cxx >>
<< compiling EventMeta.cxx >>
<< compiling EventParticle.cxx >>
<< compiling EventVoxel2D.cxx >>
<< compiling EventVoxel3D.cxx >>
<< compiling IOManager.cxx >>
<< compiling Image2D.cxx >>
<< compiling ImageMeta.cxx >>
<< compiling Meta.cxx >>
<< compiling Particle.cxx >>
<< compiling ParticleMass.cxx >>
<< compiling Point.cxx >>
<< compiling Vertex.cxx >>
<< compiling Voxel.cxx >>
<< compiling Voxel2D.cxx >>
<< compiling Voxel3D.cxx >>
<< compiling Voxel3DMeta.cxx >>
<< compiling DataFormatDict.cxx >>
<< installing headers >>

Compiling Processor...
<< checking dependencies>>
<< generating dict >>
<< compiling ProcessBase.cxx >>
<< compiling ProcessDriver.cxx >>
<< compiling ProcessFactory.cxx >>
<< compiling ProcessorDict.cxx >>
<< installing headers >>

Compiling CPPUtil...
<< checking dependencies>>
<< generating dict >>
<< compiling CSVReader.cxx >>
<< compiling RandomGaus.cxx >>
<< compiling CPPUtilDict.cxx >>
<< installing headers >>

Compiling PyUtil...
<< checking dependencies>>
<< generating dict >>
<< compiling PyCluster3DMaker.cxx >>
<< compiling PyImageMaker.cxx >>
<< compiling PyImageStitcher.cxx >>
<< compiling PyTensor3DMaker.cxx >>
<< compiling PyUtils.cxx >>
<< compiling load_pyutil.cxx >>
<< compiling PyUtilDict.cxx >>
<< installing headers >>

Compiling CVUtil...
<< checking dependencies>>
<< generating dict >>
<< compiling CVUtil.cxx >>
<< compiling load_cvutil.cxx >>
<< compiling CVUtilDict.cxx >>
<< installing headers >>
Building app...

Compiling Filter...
<< checking dependencies>>
<< generating dict >>
<< compiling EmptyImageFilter.cxx >>
<< compiling EmptyTensorFilter.cxx >>
<< compiling EventIDFilter.cxx >>
<< compiling MCSingleParticleFilter.cxx >>
<< compiling ParticleCountFilter.cxx >>
<< compiling QSumFilter.cxx >>
<< compiling FilterDict.cxx >>
<< installing headers >>

Compiling ImageAna...
<< checking dependencies>>
<< generating dict >>
<< compiling HistADC.cxx >>
<< compiling HistTensor.cxx >>
<< compiling ImageAnaDict.cxx >>
<< installing headers >>

Compiling ImageMod...
<< checking dependencies>>
<< generating dict >>
<< compiling ADCScale.cxx >>
<< compiling ADCScaleAna.cxx >>
<< compiling ADCThreshold.cxx >>
<< compiling BBoxFromClusterVoxel3D.cxx >>
<< compiling Binarize.cxx >>
<< compiling BlurTensor3D.cxx >>
<< compiling Cluster2DFromCluster3D.cxx >>
<< compiling Cluster3DCompressor.cxx >>
<< compiling CombineImages.cxx >>
<< compiling CombineTensor3D.cxx >>
<< compiling CropBBox2D.cxx >>
<< compiling ImageCompressor.cxx >>
<< compiling ImageFromTensor2D.cxx >>
<< compiling MaskImage2D.cxx >>
<< compiling MaskTensor3D.cxx >>
<< compiling NormalizeTensor3D.cxx >>
<< compiling ParticleBBoxFromCluster.cxx >>
<< compiling ProdEventMeta2D.cxx >>
<< compiling ProdEventMeta3D.cxx >>
<< compiling RemoveDetectorInfo.cxx >>
<< compiling ResizeImage.cxx >>
<< compiling ScaleTensor.cxx >>
<< compiling SegLabelFromCluster3D.cxx >>
<< compiling SegWeightInstance2D.cxx >>
<< compiling SegWeightInstance3D.cxx >>
<< compiling Tensor2DFromTensor3D.cxx >>
<< compiling Tensor3DCompressor.cxx >>
<< compiling Tensor3DFromCluster3D.cxx >>
<< compiling ThresholdTensor3D.cxx >>
<< compiling VertexLabel3D.cxx >>
<< compiling VertexWeight3D.cxx >>
<< compiling WireMask.cxx >>
<< compiling ImageModDict.cxx >>
<< installing headers >>

Compiling ThreadIO...
<< checking dependencies>>
<< generating dict >>
<< compiling BatchData.cxx >>
<< compiling BatchDataStorage.cxx >>
<< compiling BatchDataStorageFactory.cxx >>
<< compiling BatchFillerImage2D.cxx >>
<< compiling BatchFillerMultiLabel.cxx >>
<< compiling BatchFillerPIDLabel.cxx >>
<< compiling BatchFillerTemplate.cxx >>
<< compiling BatchFillerTensor3D.cxx >>
<< compiling BatchHolder.cxx >>
<< compiling RandomCropper.cxx >>
<< compiling ThreadIOTypes.cxx >>
<< compiling ThreadProcessor.cxx >>
<< compiling ThreadIODict.cxx >>

Linking library...

Done!

Now you should find the build directory and built .so library for larcv.

In [6]:
%%bash
ls larcv2
ls larcv2/build/lib/*.so
GNUmakefile
Makefile
README.md
bin
build
configure.sh
doc
larcv
python
ups
larcv2/build/lib/liblarcv.so