'Setting up CERN ROOT with an IDE
I'm interested in setting up an IDE (preferably Eclipse or Netbeans) for a project that uses C++ and ROOT and have it be able to compile for me. Is this possible?
Source code is available for ROOT, so there should be some way of hooking these things together...
Solution 1:[1]
Most of the ROOT users I know use emacs or vi.
That said, if you can specify the build, this should be possible. Make use of root-config commands to specify the paths and libraries.
ROOT_HEADERS_PATH=$(root-config --cflags)
and so on. Just root-config will give you a list of accepted arguments.
I'd guess that the most likely stumbling block for this is the generation of the rootcint files for classes that you want to incorporate into the root TObject tree and use in the cint shell.
Solution 2:[2]
For those working with a MAC's xcode IDE, you can see my answer here for setting up ROOT v6 in xcode v7.3. It shows how to at least get started writing C++ scripts that use ROOT classes in xcode.
Solution 3:[3]
I'd recommend now to use the QtCreator IDE. It works out the box by clicking on "File", "Open File or Project" and then double-clicking on the main CMakeLists.txt of the ROOT git repository.
More detailed instructions can be found on https://root.cern/blog/code-horsepower-f1/
It can also be used with any CMake/C++ projects that depends on ROOT libraries, and the integration is seamless.
Solution 4:[4]
You can use geany.
There, you can also customize the highlighter to format nicely ROOT classes. It is stored in $HOME/.config/geany/filedefs/filetypes.cpp
Find below a snippet of my edited version.
primary=alignas alignof and and_eq auto bitand bitor bool char char16_t char32_t class const constexpr decltype double enum explicit export extern false final float friend inline int int8_t int16_t int32_t int64
_t long mutable namespace noexcept not not_eq nullptr or or_eq override ptrdiff_t register short signed size_t static static_assert struct template thread_local true typedef typename union unsigned using virtual
void volatile wchar_t xor xor_eq TH1 TH1C TH1D TH1F TH1I TH1K TH1S TH2 TH2C TH2D TH2F TH2I TH2S TH3 TH3C TH3D TH3F TH3I TH3S TF1 TF2 TF3 THStack TGraph TGraph2D TRandom TLimit TLatex TNtuple TObject TTree TIter
TKey TRandom2 TShape TPad TMacro TString TLine TLegend TFile TRandom3 TMath TLeaf TLeafB TLeafC TLeafD TLeafElement TLeafF TLeafI TLeafL TLeafO TLeafObject TChain TDirectory TList TArc TChain TDirectory TList T
Arc TBox TEllipse TPolyLine TCurlyLine TCurlyArc TMinuit TFitter TLinearFitter TLorentzVector TLorentzRotation TVector3 TVector2 TRotation TGenPhaseSpace TFeldmanCousins TRobustEstimator TRolke TQuaternion TPost
Script TSVG TPDF TImageDump THtml TColor TStyle TComplex TPRegexp TObjArrayIter TMapIter TClass TEnv TGlobal TCint TROOT TDictionary TTime TTimer Double_t Int_t UInt_t Float_t Long_t Bool_t Byte_t char_t Marker_
t Double32_t Float16_t Long64_t Short_t Stat_t Style_t Text_t UShort_t ULong64_t Char_t UChar_t TBranch
secondary=asm break catch case continue compl const_cast dynamic_cast do default delete else for goto if new operator public private protected return reinterpret_cast sizeof static_cast switch this throw try typ
eid while NULL
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | dmckee --- ex-moderator kitten |
| Solution 2 | Community |
| Solution 3 | ferdymercury |
| Solution 4 |
