Seeking Assistance with Allpix2 Mesh Converter and CPP File Compilation Issue

Hello everyone,
I am currently working with Allpix2, and I can run simulations without any issues. However, when I try to use certain tools, particularly the Mesh Converter, I encounter difficulties.
Firstly, I’m trying to obtain the executable for the MeshConverter.cpp file using the command g++ -o MeshConverter MeshConverter.cpp , but I’m getting an error indicating that it cannot find the file in the inclusion directory.
In file included from /usr/local/include/ROOT/RConfig.hxx:23,
from /usr/local/include/RtypesCore.h:23,
from /usr/local/include/Compression.h:15,
from /usr/local/include/TTree.h:29,
from MeshConverter.cpp:24:
/usr/local/include/RConfigure.h:30:4: warning: #warning “The C++ standard in this build does not match ROOT configuration (201703L); this might cause unexpected issues” [-Wcpp]
30 | # warning “The C++ standard in this build does not match ROOT configuration (201703L); this might cause unexpected issues”
| ^~~~~~~
MeshConverter.cpp:26:10: fatal error: Eigen/Eigen: No such file or directory
26 | #include <Eigen/Eigen>
| ^~~~~~~~~~~~~
compilation terminated.
I have tried replacing the path with the complete access path:
#include <Math/Vector3D.h>
#include <TTree.h>
#include </usr/include/eigen3/Eigen/Eigen>
#include “/allpix-squared/include/core/config/ConfigReader.hpp”
#include “/allpix-squared/include/core/config/Configuration.hpp”
#include “/allpix-squared/include/core/config/exceptions.h”
#include “/allpix-squared/include/core/module/ThreadPool.hpp”
#include “/allpix-squared/include/core/utils/log.h”
#include “/allpix-squared/include/tools/units.h”
But I still face the same problem:
In file included from /usr/local/include/ROOT/RConfig.hxx:23,
from /usr/local/include/RtypesCore.h:23,
from /usr/local/include/Compression.h:15,
from /usr/local/include/TTree.h:29,
from MeshConverter.cpp:24:
/usr/local/include/RConfigure.h:30:4: warning: #warning “The C++ standard in this build does not match ROOT configuration (201703L); this might cause unexpected issues” [-Wcpp]
30 | # warning “The C++ standard in this build does not match ROOT configuration (201703L); this might cause unexpected issues”
| ^~~~~~~
In file included from /allpix-squared/include/core/config/ConfigReader.hpp:22,
from MeshConverter.cpp:28:
/allpix-squared/include/core/config/Configuration.hpp:24:10: fatal error: core/config/exceptions.h: No such file or directory
24 | #include “core/config/exceptions.h”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Could you please assist me with this issue?

Thank you in advance for your help!

Hi @Silvia

I’d be glad to hello you out! Could you provide some additional information on how exactly you installed Allpix Squared and the dependencies (ROOT, Geant4)?

What machine are you running on? Your laptop or some computing clusters?

Cheers
Simon

Hi Simon,
Thank you for your reply! I am working on a computing station running Ubuntu 20.04. Here’s how I installed ROOT, Geant4, and Allpix Squared: For ROOT installation:

mkdir root/
cd root/
wget -c https://root.cern/download/root_v6.28.00.source.tar.gz
tar -xzvf root_v6.28.00.source.tar.gz
cd root_v6.28.00
mkdir build-root
cd build-root
cmake .. \
  -DCMAKE_CXX_STANDARD=17
make
make install                          

For Geant4 installation:

mkdir geant4              
cd geant4/
wget -c http://cern.ch/geant4-data/releases/geant4-v11.2.1.tar.gz
tar -zxf geant4-v11.2.1.tar.gz
cd geant4-v11.2.1
mkdir build
mkdir install
cd build
cmake .. \
  -DCMAKE_INSTALL_PREFIX=/geant4/geant4-v11.2.1/install \
  -DGEANT4_INSTALL_DATA=ON \
  -DGEANT4_USE_GDML=ON \
  -DGEANT4_USE_QT=ON \
  -DGEANT4_USE_XM=ON \
  -DGEANT4_USE_OPENGL_X11=ON \
  -DCMAKE_CXX_STANDARD=17 \
  -DGEANT4_BUILD_MULTITHREADED=ON \
  -DGEANT4_BUILD_BUILTIN_BACKTRACE=OFF
make
make install
                                                                                                                                              After that, I sourced ROOT and Geant4.

For Allpix Squared installation:

git clone https://gitlab.cern.ch/allpix-squared/allpix-squared
cd allpix-squared
mkdir build
cd build
cmake .. 
make
make install

It’s all good now. I was able to solve the problem by using the command /allpixsquared/bin/mesh_converter instead of just mesh_converter because I am working on a computing station.

2 Likes