Importing a c++/root based analysis framework in pyroot

Hi,
I am working with an analysis framework written in c++ heavily depending on ROOT classes and funcions. The framework is made of several c++ classes and it works like a charm when used in a root shell.
When i try importing it in python3 then the problems arise. I normally import ROOT, but when i try doing “ROOT.Diana” (diana is the name of the framework) or “from ROOT import Diana” it sends out a series of errors (which to me, a not very expert eye, look like compilation or linking errors).
The installation folder of the framework seems to be correctly found.
If needed i can post the whole errors but it is going to be lengthy,
Thank you,
Giorgio

ROOT Version: 6.22
Python Version: 3.6.12
Platform: Linux
Compiler: g++ 4.9.2


I actually appeared to have solved the issue by explicitly loading fftw3.h in the python shell via root.

>>> ROOT.gSystem.Load("/usr/lib/x86_64-linux-gnu/libfftw3.so")

Great! You can alternatively fix that by telling the maintainers of Diana to link explicitly against libfftw3 - which is the recommended way these days.

Thank you for the advice. Actually besides being a user of the software I am also one of the developers (even though I am not even close to be one of the main developers).
Can you give me any advice on how to perform the linking ?
Sorry I am more expert in writing code than compilations beyond the usual call to make or g++.
Thank you in advance

Hi Giorgio!

Most linkers today will accept -lFoo to link against libFoo.so, so to build say “libDiana.so” you’d use g++ -shared -o libDiana.so ... -lfftw3

Axel

Ok thank you, I will look into that.
The weird thing is that i do not have to load fftw3 when i run the classes in the root shell.
Thank you
Giorgio

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.