It might be a bug in my code, sure. But I had the exact same code working on my previous computer (Leopard, 32bit, GCC 4.0). And I can’t even include libraries in my C++ files, much less use any features of ROOT.
But you do bring up a good point. If ROOT has changed in the last few years since I last installed, that might be part of the problem. I hadn’t thought of that.
- Starting R O O T - S T R E S S test suite with 1000 events
Test 1 : Functions, Random Numbers, Histogram Fits… OK
Test 2 : Check size & compression factor of a Root file… OK
Test 3 : Purge, Reuse of gaps in TFile… OK
Test 4 : Test of 2-d histograms, functions, 2-d fits… OK
Test 5 : Test graphics & Postscript… OK
Test 6 : Test subdirectories in a Root file… OK
Test 7 : TNtuple, selections, TCut, TCutG, TEventList… OK
Test 8 : Trees split and compression modes… OK
Test 9 : Analyze Event.root file of stress 8… OK
Test 10 : Create 10 files starting from Event.root… OK
Test 11 : Test chains of Trees using the 10 files… OK
Test 12 : Compare histograms of test 9 and 11… OK
Test 13 : Test merging files of a chain… OK
Test 14 : Check correct rebuilt of Event.root in test 13… OK
Test 15 : Divert Tree branches to separate files… OK
Test 16 : CINT test (3 nested loops) with LHCb trigger… OK
stress : Total I/O = 549.8 Mbytes, I = 406.3, O = 143.5
stress : Compr I/O = 387.9 Mbytes, I = 284.7, O = 103.2
stress : Real Time = 24.41 seconds Cpu Time = 20.82 seconds
- ROOTMARKS =1783.3 * Root5.26/00 20091214/1543
So it looks like the stress test worked… Now I am confused…
I made a very simple code to try things out:
#include <iostream>
#include <cstdlib>
#include <string>
#include <cmath>
#include <vector>
#include <fstream>
#include <stdio.h>
#include <sstream>
using namespace std;
int main()
{
cout << "Test" << endl;
return 0;
}
Then I run in the terminal:
g++ -c test.cpp
g++ -o test test.o
./test
That works just fine.
Then I added this:
#include <iostream>
#include <cstdlib>
#include <string>
#include <cmath>
#include <vector>
#include <fstream>
#include <stdio.h>
#include <sstream>
[b]#include "TGraphErrors.h"
#include "TCanvas.h"
#include "TPad.h"
#include "TH1.h"
#include "TLegend.h"
#include "TColor.h"
[/b]
using namespace std;
int main()
{
cout << "Test" << endl;
return 0;
}
And I compile it with the makefile that links the libraries.
NAME = test.exe
OBJECTS = $(NAME:.exe=.o)
CPPFLAGS = -I/usr/local/include -I$(shell root-config --incdir)
ROOTLIBS = $(shell root-config --libs)
HEADERS =
all: $(NAME)
$(OBJECTS): $(HEADERS)
$(NAME): $(OBJECTS)
g++ -o $(NAME) -O $(OBJECTS) $(ROOTLIBS) -L/usr/local/lib
.cpp.o:
g++ -c -O $(CPPFLAGS) -I$(ROOTSYS)/include $*.cpp
And that is when it won’t run.
I never thought it might be the makefile and the code, since it does still run on my old laptop. Thanks again for the help and suggestions! Much appreciated!