Hi, i wrote this very simple code in C++:
#include <iostream>
#include "/home/casa/root/include/TRandom.h"
#include "/home/casa/root/include/TRandom3.h"
using namespace std;
int main() {
TRandom *casuale = new TRandom3();
for(int i=0;i<100;i++){
int a = casuale -> Integer(1000);
cout << a << endl;
}
return 0;
}
and compiling with:
g++ prova.C -o b.exe `~/root/bin/root-config --cflags --glibs`
And it works!
But now i want to implement the same code with cuda, so i type:
nvcc prova_cuda.cu -o b.exe `root-config -std=c++11 -m64 -I/home/casa/root/include -L/home/casa/root/lib -lGui -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -lm -ldl -rdynamic`
I used this because inside of “–cflags --glibs” there is “-pthread” that CUDA don’t know, so i specified all components without -pthread.
But it gives to me this error:
Unknown argument "-std=c++11"!
Usage: root-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--auxcflags] [--ldflags] [--new] [--nonew] [--libs] [--glibs] [--evelibs] [--bindir] [--libdir] [--incdir] [--etcdir] [--srcdir] [--noauxcflags] [--noauxlibs] [--noldflags] [--has-<feature>] [--arch] [--platform] [--config] [--features] [--ncpu] [--git-revision] [--python-version] [--cc] [--cxx] [--f77] [--ld ] [--help]
In file included from /home/casa/root/include/Rtypes.h:23:0,
from /home/casa/root/include/TObject.h:17,
from /home/casa/root/include/TNamed.h:25,
from /home/casa/root/include/TRandom.h:25,
from prova_cuda.cu:3:
/home/casa/root/include/RtypesCore.h:23:10: fatal error: ROOT/RConfig.h: File o directory non esistente
#include <ROOT/RConfig.h>
^~~~~~~~~~~~~~~~
compilation terminated.
What i have to do?