Additional libraries - ATTPC/ATTPCROOTv2 GitHub Wiki

This page is out of date. Please refer to the readme for up to date information

We are introducing support for the Point Clouds Library (PCL - http://pointclouds.org/) in ATTPCROOTv2. Several additional packages will be needed in order to compile and run this new version. The ATTPCROOTv2 folder contains a script folder which can be used to download and build each package from the source.

Pre-requisites for installation: boost, cmake, (ccmake for pcl recommended).

  • The minimal install consists of flann, eigen, pcl, and hdf5.
  • The full installation (with visualization) requires also Qt4/5 and VTK (these are explained at the bottom of this page and are NOT necessary for most users).

I recommend to follow the minimal install. Follow the instructions below for flann (don't forget to delete static libraries as explained in PCL section) and eigen. For PLC, I recommend to install ccmake (cmake curses interface) to disable the optional libraries. To install ccmake you can do sudo apt-get install cmake-curses-gui or sudo dnf install ccmake. Once you install flann and eigen following the instructions below just proceed manually (as explained below) for PCL but instead of typing the cmake command from the build folder, just type ccmake ../ (from build). You will see the menu (with several pages that can be navigated with scroll down) where you can disable/enable the cmake options. To build PCL without Qt and VTk just disable (OFF): BUILD_surface (page 2), WITH_QT and WITH_VTK (page 5). Alternatively, you can just use the command line procedure with -D (for example -DWITH_QT=OFF) for all of them as explained below, if you do not want to install ccmake.

Minimal Install

Flann library

FLANN= Fast Library for Approximate Nearest Neighbors

Download the tar from http://www.cs.ubc.ca/research/flann/

Unpack and compile with:

cd ~/path_to_flann/flann-X.X.X
mkdir build
cd build
cmake ../
make install

Eigen3

mplate library for linear algebra: matrices, vectors, numerical solvers, and related algorithms

Download at http://eigen.tuxfamily.org/index.php?title=Main_Page

Same procedure as Flann (except make is not needed as Eigen3 is a header library, sudo make install is needed though).

IMPORTANT: PCL MUST be linked with the dynamic version of FLANN (libflann_cpp.so). The easiest way is to delete the static libraries if they are not needed (libflann_cpp_s.a). This is similiar to the OpenCV implementation of FLANN.

In addition, boost libraries are needed to compile pcl. With a previous installation of ATTCROOT we just run the config.sh script on the build folder. For a fresh installation, one can run the same script on the FairRoot installation folder or install boost manually (with yum, apt-get, dnf, brew...). For the latter, just try to chose the latest version and be cautious which boost library will the ATTPCROOT cmake will find (it is always better to use the same version to compile PCL and ATTCROOT).

PCL

Download source code from https://github.com/PointCloudLibrary/pcl/releases

Note: Support for visulization must be enabled here though not mandatory

tar xvfj pcl-pcl-1.X.X.tar.gz
cd pcl-pcl-1.X.X 
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../ (or ccmake ../)  
make -j(number of cores)
sudo make -j(number of cores) install   

PCL Cmake command for custom installation folders:

cmake ../  -DEIGEN_INCLUDE_DIR=/mnt/simulations/attpcroot/fair_install_2020/eigen-3.3.6/include/eigen3/ -DFLANN_LIBRARY=/mnt/simulations/attpcroot/fair_install_2020/flann_1.9.1_inst/lib/libflann.so.1.9.1 -DFLANN_INCLUDE_DIR=/mnt/simulations/attpcroot/fair_install_2020/flann_1.9.1_inst/include/ -DCMAKE_INSTALL_PREFIX=/mnt/simulations/attpcroot/fair_install_2020/pcl_1.9.1_inst/ -DBOOST_ROOT=/mnt/simulations/attpcroot/fair_install_2020/FairSoft/basics/boost/ ../

hdf5 library

Download the source code from https://www.hdfgroup.org/downloads/hdf5/source-code/

Unpack and compile with:

cd ~/path_to_hdf5/hdf5-X.X.X
mkdir build
cd build
cmake ../
make -j(number of cores)
make install

Full Install

For the full install, just follow the instructions below to install VTK (http://www.vtk.org/Wiki/VTK/Configure_and_Build) with QT (version 4.8.6 tested):

cd ~  
mkdir qt-X.X.X-build
cd qt-X.X.X-build
wget http://download.qt-project.org/official_releases/qt/X.X/X.X.X/qt-everywhere-opensource-src-X.X.X.tar.gz
tar xzf qt-everywhere-opensource-src-X.X.X.tar.gz
cd qt-everywhere-opensource-src-X.X.X
./configure # go through the dialogue 
make -j(number of cores)
sudo make install
cd ~/
git clone git://vtk.org/VTK.git
cd VTK
mkdir build
cmake -DQT_QMAKE_EXECUTABLE:PATH=/path/to/qt-X.X.X-build/qt-everywhere-opensource-src-X.X.X/bin/qmake \
      -DVTK_Group_Qt:BOOL=ON \
      -DBUILD_SHARED_LIBRARIES:BOOL=ON \
      /path/to/VTK
make -j(number of cores)
sudo make install