Veccore compilation

Hello experts,
I cannot compile my standalone application with version 6.12.04 but I could do so with version 5.34.25.

When compiling cxx files to objects for linking, I get an error. The output of make is:
g++ -pthread -std=c++1y -m64 -I/usr/local/root-6.12.04-gcc-6.3.0/include -fPIC -O2 -L/usr/local/root-6.12.04-gcc-6.3.0/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -pthread -Wl,-rpath,/usr/local/root-6.12.04-gcc-6.3.0/lib -lm -ldl -rdynamic -lSpectrum -lMinuit -lMinuit2 -lTMVA -lMLP -lTreePlayer -lMathCore -lMathMore -lFumili -Wl,-rpath,/usr/local/root-6.12.04-gcc-6.3.0/lib -lTreePlayer -lFoam -lProof -lProofPlayer -pthread -std=c++1y -m64 -I/usr/local/root-6.12.04-gcc-6.3.0/include -m64 -c decayWidthForms.cxx
In file included from /usr/local/root-6.12.04-gcc-6.3.0/include/TFormula.h:24:0,
from /usr/local/root-6.12.04-gcc-6.3.0/include/TF1.h:27,
from headers.h:12,
from constants.h:1,
from decayWidthForms.h:2,
from decayWidthForms.cxx:2:
/usr/local/root-6.12.04-gcc-6.3.0/include/Math/Types.h:22:10: fatal error: VecCore/VecCore: No such file or directory
#include <VecCore/VecCore>
^~~~~~~~~~~~~~~~~
compilation terminated.
makefile:67: recipe for target ‘decayWidthForms.o’ failed

On my local machine, the include&lib paths are set when $ROOTSYS is set equal to /usr/local/root-6.12.04-gcc-6.3.0.
The make command works when I perform it on a different machine with $ROOTSYS set to point to the local root-5.34.25 installation location.

I have simplified it so the decayWidthForms.cxx is a trivial file

#include "decayWidthForms.h"
double debug_fn(double x, double y, double f1, double f2, double a, double b){
  return 0;
}

And decayWidthForms.h is

#pragma once
#include "TROOT.h"
#include "TMath.h"
#include "TFile.h"
#include "TF1.h"
#include "TF2.h"
#include "TMathBase.h"
#include <iomanip>
#include <string.h>
#include <fstream>
#include <cstdlib>
#include <iostream> 
#include <sstream>
#include <algorithm>    
#include <cmath>
#include "Math/WrappedMultiTF1.h"
#include <ctime>
#include <stdlib.h>
#include <TApplication.h>

using namespace std;
double debug_fn(double x, double y, double fv, double fa, double a, double b);

Can you please advise on how I can get my compilation working?
Perhaps SIMD/CUDA variable must be turned off in cmake lists when installing root? I hoped to use that though…:frowning:

Many thanks,
Mike

Hi, can you post the output of CMake -L?

In any case an easy solution would be to rebuild ROOT with the cmake option -Dveccore=OFF (if you don’t need it, of course).

Cheers,
Xavi

And I simplify things so that you don’t have to deal with my makefile leftovers…

The following command fails
g++ --std=c++11 main.cpp -I/usr/local/root-6.12.04-gcc-6.3.0/include -o test -L/usr/local/root-6.12.04-gcc-6.3.0/lib -lCore

Where main.cpp is

#include <iostream>
#include <TFile.h>
#include <TF1.h>
using std::cout;
using std::endl;

int main(int argc, char *argv[])
{
    return 0;
}

If I comment out the #include TF1.h then compilation succeeds, on all platforms I attempt.

And the platform that fails is root-6.12.04, installed on ubuntu 17.10

And as I write this i see the response from Xavi. Let me try.

Thank you!

You probably just don’t have VecCore installed in your system. You can try either to disable VecCore, as Xavi mentioned, or you can try to use -Dbuiltin_veccore=ON to get ROOT to build and install it for you. If you go for the second option, I recommend adding -Dbuiltin_vc=ON as well for SIMD support. Let us know if you encounter any problems.

I was able to resolve this by turning on VECCORE with cmake.

Thanks again!

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