If you have more than two Pythons in your system,
such as in the case that Python2 and Python3 are installed in your system,
you may have to specify one explicitly to compile that with your application program,
which is written not in Python.
Here is how to specify PythonX.Y with the python version number X.Y
in a Makefile to build your application.
First, you need to find out compiler and linker options
specified at the time of installation of PythonX.Y:
% pythonX.Y-config --cflags
will show you the compiler options <CFLAGS> and
% pythonX.Y-config --ldflags
will show you the linker options <LDFLAGS>.
Second, you add lines in the Makefile to
include <CFLAGS> in the compilation
and load <LDFLAGS> in the linkage.
That's it!
Showing posts with label My cpplib. Show all posts
Showing posts with label My cpplib. Show all posts
7/14/2016
12/11/2014
How to CMake MyProject together with ROOT GUI
I have MyProject composed of source files
myProject/c++/src/myMain.cpp
myProject/c++/include/myMain.h
myProject/c++/include/myMainLinkDef.h
to run on ROOT GUI. In myMain.cpp, a class MyMainGUI is called in a loop of TApplication. In myMain.h, this class is declared with the first line
myMainLinkDef.h includes pragma comment lines which look like
where mylib::MyFunction is a class used in ROOT GUI and given in
/somewhere/myLibrary/myLib.h
/somewhere/myLibrary/libmyLib.a
Problem: Compose a cmake package to build MyProject in an arbitrary directory myWKDIR.
I describe a solution in the following.
1. Prepare myProject/c++/CMakeLists.txt (presupposition: ROOT version 5.34):
==========================================================
cmake_minimum_required(VERSION 2.8)
set(CMAKE_VERBOSE_MAKEFILE 1)
project(MyProject)
set(CMAKE_CXX_COMPILER g++)
# since I used g++ to compile libmyLib.a
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/..)
#since I'm going to build MyProject in myWKDIR/build/
#so that ${PROJECT_BINARY_DIR}/.. means myWKDIR.
)
> mkdir myWKDIR
> mkdir myWKDIR/build
cd myWKDIR/build
myWKDIR/build> cmake /directory_path_to/myProject/c++
myWKDIR/build> make
Any comments are welcome.
myProject/c++/src/myMain.cpp
myProject/c++/include/myMain.h
myProject/c++/include/myMainLinkDef.h
RQ_OBJECT("myMainGui").
#pragma link C++ class MyMainGUI;
#pragma link C++ class mylib::MyFunction;
/somewhere/myLibrary/myLib.h
/somewhere/myLibrary/libmyLib.a
I describe a solution in the following.
1. Prepare myProject/c++/CMakeLists.txt (presupposition: ROOT version 5.34):
==========================================================
cmake_minimum_required(VERSION 2.8)
set(CMAKE_VERBOSE_MAKEFILE 1)
#is convenient for debugging the make process.
set(CMAKE_CXX_COMPILER g++)
# since I used g++ to compile libmyLib.a
#since I'm going to build MyProject in myWKDIR/build/
#so that ${PROJECT_BINARY_DIR}/.. means myWKDIR.
#Prepare for the ROOT GUI
#-------------------------------------
#imitating geant4/examples/analysis/AnaEx02
#/////////////////////////////////////////////////////////////////////
find_package(ROOT REQUIRED)
find_program(ROOT_CINT_EXECUTABLE rootcint PATHS ${ROOT_DIR}/bin NO_DEFAULT_PATH})
#External Libraries to be linked
#---------------------------------------
set(myLibrary_DIR /somewhere/myLibrary)
add_library(MyLib STATIC IMPORTED)
set_property(TARGET MyLib PROPERTY
IMPORTED_LOCATION ${myLibrary_DIR}/libmyLib.a)
#Other ways to include libmyLib.a in the ld process is to specify this library in
#CMAKE_EXE_LINKER_FLAGS as
#-L${myLibrary_DIR} -lmyLib
#or find_library(MyLib myLib PATHS ${myLibrary_DIR})
#and include MyLib in target_link_libraries.
#building a dictionary for ROOT GUI
#------------------------------------------------
set(INCLUDE_DIRECTORIES
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
${myLibrary_DIR}
${ROOT_INCLUDE_DIR})
include_directories(${INCLUDE_DIRECTORIES})
#generate the dictionary
#the following part is imported from http://lcio.desy.de/v01-60/cmake/MacroRootDict.cmake
set(MAINPRGM "myMain")
set(headers include/myMain.h)
set( _dict_includes )
FOREACH( _inc ${INCLUDE_DIRECTORIES} )
SET( _dict_includes "${_dict_includes}\t-I${_inc}")
ENDFOREACH()
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MAINPRGM}Dict.cpp ${CMAKE_CURRENT_BINARY_DIR}/${MAINPRGM}Dict.h
COMMAND ${ROOT_CINT_EXECUTABLE} -f ${CMAKE_CURRENT_BINARY_DIR}/${MAINPRGM}Dict.cpp -c ${_dict_includes} ${headers} include/${MAINPRGM}LinkDef.h
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS ${headers} include/${MAINPRGM}LinkDef.h
COMMENT "generating: ${MAINPRGM}Dict.cpp ${MAINPRGM}Dict.h"
)
list(APPEND headers ${CMAKE_CURRENT_BINARY_DIR}/${MAINPRGM}Dict.h)
#build the target
#-------------------------
#prepare for the ld flag
execute_process(COMMAND root-config --glibs OUTPUT_VARIABLE
ROOT_LD_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_EXE_LINKER_FLAGS "${ROOT_LD_FLAGS}")
#destination
set(sources src/myMain.cpp
${CMAKE_CURRENT_BINARY_DIR}/${MAINPRGM}Dict.cpp
)
add_executable(${PROJECT_NAME}.exe ${sources} ${headers})
target_link_libraries(${PROJECT_NAME}.exe MyLib)
2. build MyProject in myWKDIR
============================> mkdir myWKDIR
> mkdir myWKDIR/build
cd myWKDIR/build
myWKDIR/build> cmake /directory_path_to/myProject/c++
myWKDIR/build> make
10/28/2013
gcc and gfortran on OS X 10.9 Marvericks
A new release of OS X 10.9 Marvericks was installed on my MacBook 15-inch Retina Pro 2012.
I kept all softwares previously installed on OS X 10.8 as they were. All of them are working
well without a change except for the following.
gcc 4.8.1
========
I needed to install the Command Line Tools by issuing
%xcode-select --install
to make gcc work. This is necessary regardless whether one has
already installed Xquartz or not.
gfortran
=========
I need
-fno-underscoring
option at the load time to use gnu extensions.
This was not required before in my case.
I kept all softwares previously installed on OS X 10.8 as they were. All of them are working
well without a change except for the following.
gcc 4.8.1
========
I needed to install the Command Line Tools by issuing
%xcode-select --install
to make gcc work. This is necessary regardless whether one has
already installed Xquartz or not.
gfortran
=========
I need
-fno-underscoring
option at the load time to use gnu extensions.
This was not required before in my case.
8/29/2013
A primitive way to pass a pointer to CINT macro
I have a TTree pointed to by *tree in my C++ program and want to pass it to MyMacro.C to use it in a CINT session invoked from the C++ program. Here is a primitive-but-it-does-work way as below.
Lines in my C++ program read
TTree *tree = ....
std::stringstream ss;
ss<< tree;
std::string macroName = "MyMacro.C("+'"'+ss.str()+'"'+")";
gROOT->Macro(macroName.c_str());
and in MyMacro.C, I have
void MyMacro(std::string &tp){
TTree *tree;
std::stringstream ss(tp);
ss>> tree;
int nentries = (Int_t)tree->GetEntries();
TObject *tobj;
...
}
Lines in my C++ program read
TTree *tree = ....
std::stringstream ss;
ss<< tree;
std::string macroName = "MyMacro.C("+'"'+ss.str()+'"'+")";
gROOT->Macro(macroName.c_str());
and in MyMacro.C, I have
void MyMacro(std::string &tp){
TTree *tree;
std::stringstream ss(tp);
ss>> tree;
int nentries = (Int_t)tree->GetEntries();
TObject *tobj;
...
}
8/27/2013
Using MyClass in a CINT macro
When I am evaluating something in my C++ program and calling a CINT macro by
gROOT->Macro(mymacro.C);
to draw figures, I need to pass parameters of the evaluation to this macro.
When the number of parameters increases and their structures get complicated, passing them by
mymacro.C(hard coded parameter list)
is not useful. In this case, I prepare a class MyClass to define a set of parameters to use
in my evaluation and pass it to the macro. Results of the evaluation kept in MyClass
can certainly be passed to the macro for drawings. The way to do this is well described in
The CINT Dictionary Generator.
Here I note my sample case where MyClass is stand alone and not inheriting from TObject class.
MyClass is defined in MyClass.h and implemented in MyClass.cpp
MyClass has a constructor without arguments.
Parameters are defined as static members of MyClass.
MyClass is called in mymacro.C as
MyClass passParams;
In the Makefile which I showed on Aug. 13, the following lines are added to create
a dictionary MyClassDict.o to compile with the main part:
CINTCLASS = MyClass
UOBJS := $(UOBJS) $(CINTCLASS).o $(CINTCLASS)Dict.o
$(CINTCLASS)Dict.cpp: $(CINTCLASS).h
<<tab>> rootcint -f $(CINTCLASS)Dict.cpp -c $(CINTCLASS).h
Now I can draw figures of results from a C++ computation interactively in CINT.
gROOT->Macro(mymacro.C);
to draw figures, I need to pass parameters of the evaluation to this macro.
When the number of parameters increases and their structures get complicated, passing them by
mymacro.C(hard coded parameter list)
is not useful. In this case, I prepare a class MyClass to define a set of parameters to use
in my evaluation and pass it to the macro. Results of the evaluation kept in MyClass
can certainly be passed to the macro for drawings. The way to do this is well described in
The CINT Dictionary Generator.
Here I note my sample case where MyClass is stand alone and not inheriting from TObject class.
MyClass is defined in MyClass.h and implemented in MyClass.cpp
MyClass has a constructor without arguments.
Parameters are defined as static members of MyClass.
MyClass is called in mymacro.C as
MyClass passParams;
In the Makefile which I showed on Aug. 13, the following lines are added to create
a dictionary MyClassDict.o to compile with the main part:
CINTCLASS = MyClass
UOBJS := $(UOBJS) $(CINTCLASS).o $(CINTCLASS)Dict.o
$(CINTCLASS)Dict.cpp: $(CINTCLASS).h
<<tab>> rootcint -f $(CINTCLASS)Dict.cpp -c $(CINTCLASS).h
Now I can draw figures of results from a C++ computation interactively in CINT.
8/16/2013
Geant 4.9.6 p02 installation
I use macports to install supplemental softwares:
sudo port -v install cmake (necessary)
sudo port -v install iAIDA (optional, I was just curious)
sudo port -v install xercesc3 (needed for GDML)
I downloaded the newest available source from cern Source Download Page.
I am going to install it in /usr/local/geant4:
$ sudo mkdir /usr/local/geant4
$ cd /usr/local/geant4
$ mkdir build4.9.6.p02
$ sudo mv ~/Downloads/geant* ./
$ sudo tar -xvf geant4.9.6.p02.tar
$ cd build4.9.6.p02
$ls -lO /
$sudo chflags nohidden /usr (to see files on finder)
$export G4INSTALL=/usr/local/geant4/geant4.9.6.p02
Now we use cmake
$sudo cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DXERCESC_ROOT_DIR=/opt/local -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_RAYTRACER_X11=ON -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON -DGEANT4_USE_QT=ON $G4INSTALLFor build options, refer to section 2.3 in geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/fo/BookInstalGuide.pdf
Now proceed usual make:
$sudo make -j4
$sudo make install
$ls -lO /
$sudo chflags hidden /usr (to hide /usr from finder)
$cd /my/private/directory
$mkdir B1-build
$cd B1-build
$source /usr/local/bin/geant4.sh
$cmake -DGeant4_DIR=/usr/local/lib/Geant4-9.6.2 $G4INSTALL/examples/basic/B1
$make
$./exampleB1
Build another example which requires a slight different targeting:
$cd ..
$mkdir rdecay01-build
$cd rdecay01-build
$cmake -DGeant4_DIR=/usr/local/lib/Geant4-9.6.2 $G4INSTALL/examples/extended/radioactivedecay/rdecay01
That's it.
#This installation was performed after an unsuccessful installation of a macports distribution of geant4.9.4 by
$sudo port -v install geant4 +aida +gdml +raytracerx
Precisely speaking, the installation process was successful. However, when I try to build an example, clang called in Darwin-g++.gmk couldn't find files such as libgcov.a in my OS X 10.8 system to generate a library. I therefore uninstalled the macports distributed geant4.9.4.p02 from my system.
8/13/2013
Makefile for my c++ lib with ROOT
For later reference, I put my Makefile in the following.
#===========================================================
#
## The Standard Makefile
#
#(Usage)
# make U=<program_name>; for compiling a single program
# <program_name> = bar for bar.cpp
# make ; for compiling all (listed below all:)
#
#(Default Library) ROOT
#
#(History)
# 130813 updated
#===========================================================
main:
make library
make compile PROGRAM=$(U)
all:
make compile_all PROGRAM=testReadAData
make compile_all PROGRAM=testA2RT
make compile_all PROGRAM=testReadTTree
make compile_all PROGRAM=testSetDoPrm
WRKDIR = tmp
ULIBOBJS = ReadAData-v03.2.o \
A2RT-v03.5.o \
ReadTTree-v03.3.o \
SetDoPrm-v01.8.o
LIBRARY_NAME = mycpplib
LIBRARY = lib${LIBRARY_NAME}.a
ULIBDIR = /My/cpplib/is/here
#====================================================
### INCLUDES ###
include /opt/local/etc/root/Makefile.arch
INCLUDE = -I/opt/local/include
#------ include user headers
ULIBINC = -I$(ULIBDIR)/include -Iinclude -I.
INCLUDE := $(INCLUDE) $(ULIBINC)
### LIBS ###
LIBS := -L./ -l${LIBRARY_NAME} $(ROOTGLIBS) -L/opt/local/lib -lgsl
UOBJS = <list your objects to be linked>
UOBJS =
LANGSFX=cpp
COMPILER = g++
LINKER = g++
COMPOPT = $(ROOTCFLAGS)
LINKOPT =
GOPTION = -DDEBUG
#====================================================
SRC = $(PROGRAM).$(LANGSFX)
OBJ = $(PROGRAM).o
TARGET = $(PROGRAM)_cxx
LDFLAGS = $(LIBS)
COMPOPT := $(COMPOPT) $(GOPTION)
LINKOPT := $(LINKOPT) $(GOPTION)
LIBSRCS = $(addprefix $(WRKDIR)/,$(ULIBOBJS))
ULIBSRC = $(ULIBDIR)/src
UOBJDIR = $(WRKDIR)
UOBJS := $(addprefix $(UOBJDIR)/,$(UOBJS))
#----------------------------------------------------
library:
@if [ ! -d $(WRKDIR) ]; then mkdir $(WRKDIR); \
echo "## --> tmp/ created...";fi
rm -f ${LIBRARY}
rm -f ${LIBSRCS}
make ${LIBRARY}
${LIBRARY}: ${LIBSRCS}
ar cru $@ ${LIBSRCS}
ranlib $@
compile:
@if [ -f $(SRC) ]; \
then make $(TARGET); \
rm $(OBJ); \
else make all; fi
compile_all:
rm -f $(TARGET)
make $(TARGET)
rm $(OBJ)
#----------------------------------------------------
.SUFFIXES: .exe .f .c .o .a .cpp .cxx .cc
#=================================================
$(TARGET): $(OBJ) $(UOBJS)
$(LINKER) $(LINKOPT) $(OBJ) $(UOBJS) -o $@ $(LDFLAGS)
$(ROOTLINKSRC)Dist.cpp: $(ROOTGUIHDRS).h $(ROOTLINKSRC)LinkDef.h
rootcint -f $(WRKDIR)/$(ROOTLINKSRC)Dist.cpp -c $(INCLUDE) $(ROOTGUIHDRS).h $(ROOTLINKSRC)LinkDef.h
#The following line must be the first one
$(UOBJDIR)/%.o : $(UOBJDIR)/%.cpp
$(COMPILER) -c $(COMPOPT) $< $(INCLUDE) -o $@
$(UOBJDIR)/%.o : $(ULIBSRC)/%.cpp
$(COMPILER) -c $(COMPOPT) $< $(INCLUDE) -o $@
$(UOBJDIR)/%.o : src/%.cpp
$(COMPILER) -c $(COMPOPT) $< $(INCLUDE) -o $@
$(UOBJDIR)/%.o : %.cpp
$(COMPILER) -c $(COMPOPT) $< $(INCLUDE) -o $@
.f.o:
$(FCOMPILE) -c $(FCMPOPT) $(FINCLUDE) $<
.c.o:
$(CCOMPILE) -c $(CCMPOPT) $(CINCLUDE) $<
#===========================================================
#
## The Standard Makefile
#
#(Usage)
# make U=<program_name>; for compiling a single program
# <program_name> = bar for bar.cpp
# make ; for compiling all (listed below all:)
#
#(Default Library) ROOT
#
#(History)
# 130813 updated
#===========================================================
main:
make library
make compile PROGRAM=$(U)
all:
make compile_all PROGRAM=testReadAData
make compile_all PROGRAM=testA2RT
make compile_all PROGRAM=testReadTTree
make compile_all PROGRAM=testSetDoPrm
WRKDIR = tmp
ULIBOBJS = ReadAData-v03.2.o \
A2RT-v03.5.o \
ReadTTree-v03.3.o \
SetDoPrm-v01.8.o
LIBRARY_NAME = mycpplib
LIBRARY = lib${LIBRARY_NAME}.a
ULIBDIR = /My/cpplib/is/here
#====================================================
### INCLUDES ###
include /opt/local/etc/root/Makefile.arch
INCLUDE = -I/opt/local/include
#------ include user headers
ULIBINC = -I$(ULIBDIR)/include -Iinclude -I.
INCLUDE := $(INCLUDE) $(ULIBINC)
### LIBS ###
LIBS := -L./ -l${LIBRARY_NAME} $(ROOTGLIBS) -L/opt/local/lib -lgsl
UOBJS = <list your objects to be linked>
UOBJS =
LANGSFX=cpp
COMPILER = g++
LINKER = g++
COMPOPT = $(ROOTCFLAGS)
LINKOPT =
GOPTION = -DDEBUG
#====================================================
SRC = $(PROGRAM).$(LANGSFX)
OBJ = $(PROGRAM).o
TARGET = $(PROGRAM)_cxx
LDFLAGS = $(LIBS)
COMPOPT := $(COMPOPT) $(GOPTION)
LINKOPT := $(LINKOPT) $(GOPTION)
LIBSRCS = $(addprefix $(WRKDIR)/,$(ULIBOBJS))
ULIBSRC = $(ULIBDIR)/src
UOBJDIR = $(WRKDIR)
UOBJS := $(addprefix $(UOBJDIR)/,$(UOBJS))
#----------------------------------------------------
library:
@if [ ! -d $(WRKDIR) ]; then mkdir $(WRKDIR); \
echo "## --> tmp/ created...";fi
rm -f ${LIBRARY}
rm -f ${LIBSRCS}
make ${LIBRARY}
${LIBRARY}: ${LIBSRCS}
ar cru $@ ${LIBSRCS}
ranlib $@
compile:
@if [ -f $(SRC) ]; \
then make $(TARGET); \
rm $(OBJ); \
else make all; fi
compile_all:
rm -f $(TARGET)
make $(TARGET)
rm $(OBJ)
#----------------------------------------------------
.SUFFIXES: .exe .f .c .o .a .cpp .cxx .cc
#=================================================
$(TARGET): $(OBJ) $(UOBJS)
$(LINKER) $(LINKOPT) $(OBJ) $(UOBJS) -o $@ $(LDFLAGS)
$(ROOTLINKSRC)Dist.cpp: $(ROOTGUIHDRS).h $(ROOTLINKSRC)LinkDef.h
rootcint -f $(WRKDIR)/$(ROOTLINKSRC)Dist.cpp -c $(INCLUDE) $(ROOTGUIHDRS).h $(ROOTLINKSRC)LinkDef.h
#The following line must be the first one
$(UOBJDIR)/%.o : $(UOBJDIR)/%.cpp
$(COMPILER) -c $(COMPOPT) $< $(INCLUDE) -o $@
$(UOBJDIR)/%.o : $(ULIBSRC)/%.cpp
$(COMPILER) -c $(COMPOPT) $< $(INCLUDE) -o $@
$(UOBJDIR)/%.o : src/%.cpp
$(COMPILER) -c $(COMPOPT) $< $(INCLUDE) -o $@
$(UOBJDIR)/%.o : %.cpp
$(COMPILER) -c $(COMPOPT) $< $(INCLUDE) -o $@
.f.o:
$(FCOMPILE) -c $(FCMPOPT) $(FINCLUDE) $<
.c.o:
$(CCOMPILE) -c $(CCMPOPT) $(CINCLUDE) $<
My c++ library with ROOT: test run
A Makefile to compile my c++ library with ROOT is adjusted for the new environment. A flag -m32 is removed, an include path for Makefile.arch is changed for the new ROOT set (which I needed to look for in /opt/local/etc,) a link path for gsl is explicitly added. (Specifying LD_LIBRARY_PATH in ~/.bashrc did not work. My make processes seem not referring to this env. variable.)
All sample programs included in my library were complied with ROOT and run without any problem. I was expecting some mysterious problems occur to bother me. But no mysterious thing happen. It's I call a miracle!
All sample programs included in my library were complied with ROOT and run without any problem. I was expecting some mysterious problems occur to bother me. But no mysterious thing happen. It's I call a miracle!
8/12/2013
Preparing for numerical works
After moved from the old 32-bit mode mac, the first thing to do is to recompile sources of my private c++ library with gcc without -m32 flag. This step is going well and will be finished in 3 hours.
4/10/2013
Plan for a new MacBookPro: Writing specification
When we have a plan to purchase something, our administrators require us to write a specification to open for a bidding. I can not, however, just write "I want a MacBook Pro quad-core Intel Core i7, 2.8 GHz model." They don't accept names of commercial products and I can not use words like "Mac" nor "Intel". They accept only descriptions of characteristics which I need for my purpose. So, only "quad-core" and "2.8 GHz" are accepted in the sentence above. This is something like
namespace admin{
class Specification{
public:
Specification & cpu_arch(std::string const& arg);
Specification & cpu_speed(double const& arg);
Specification & memory_size(double const& arg);
namespace admin{
class Specification{
public:
Specification & cpu_arch(std::string const& arg);
Specification & cpu_speed(double const& arg);
Specification & memory_size(double const& arg);
Specification & memory_speed(double const& arg);
Specification & storage_size(double const& arg);
........
};
} // admin namespace
to use it as
using namespace admin;
Specification I_want_a_MacBookPro(
Specification.cpu_arch(X86-64)
.cpu_speed(2.8)
.memory_size(16)
.memory_speed(1.6)
.storage_size(512));
ROOT5.22 doesn't have TFitResult
I was to include root/include/TFitResultPtr.h in my c/c++ fitting routine. But I was told "No such file..." I found this class was not included in the root version 5.22, which I got from fink! (Yes, I'm getting old.) I have 3 choces:
(1) to upgrade 5.22 in my current MacBookPro,
(2) to install a brand new 5.34, or
(3) to find another way in 5.22 without TFitResultPtr.
My estimate for required elapse time for each case is as follows.
(1) a week, (2) 3 days, (3) 1 day
I take (3).
....Result
I was right. It took a few 10 minuits to find the information I needed was
available through TF1 object used in the fit for TGraph.
lesson:
If you don't find an object in your old root, find another way to obtain the information you need. It can not be happen that there is no way in 5.22.
(1) to upgrade 5.22 in my current MacBookPro,
(2) to install a brand new 5.34, or
(3) to find another way in 5.22 without TFitResultPtr.
My estimate for required elapse time for each case is as follows.
(1) a week, (2) 3 days, (3) 1 day
I take (3).
....Result
I was right. It took a few 10 minuits to find the information I needed was
available through TF1 object used in the fit for TGraph.
lesson:
If you don't find an object in your old root, find another way to obtain the information you need. It can not be happen that there is no way in 5.22.
4/08/2013
Specifying a file path at runtime
1. In c/c++ source code, specify the file with an environment variable:
std::string fileName = getenv("package_SRCDIR");
fileName = fileName+"<file.name>";
doSomething(fileName.c_str());
2. Ask bash users to prepare a run.sh which reads
export package_SRCDIR=/users/share/package_dir
$package_SRCDIR/source_cxx
where source_cxx is an executable of the source code.
Environment: Mac OS X 10.6, bash
std::string fileName = getenv("package_SRCDIR");
fileName = fileName+"<file.name>";
doSomething(fileName.c_str());
2. Ask bash users to prepare a run.sh which reads
export package_SRCDIR=/users/share/package_dir
$package_SRCDIR/source_cxx
where source_cxx is an executable of the source code.
Environment: Mac OS X 10.6, bash
Subscribe to:
Posts (Atom)