Progress and Task Log for Daniel
- Finalize/clean-up build instructions.
- DONE - Figure-out how to add elements to GUI
- DONE - Steal Kyle's rather spiffy wiki formatting
- Get rid of red lines
- Add way to change material of target in GUI
- Add way to change particle beam in GUI
- Display commands issued by GUI
- Need to be able to turn on magnetic fields
- DONE - Need command interface
- Ability to list/change variables
- Need list/glossary of GEANT4 commands (linked from JLAB wiki)
- ^Plus, need our changes
- Document XML
- Make simple, limited XML description
- Model single chip
- Make nice macros
- Are SVT5 and SVT6 micromegas? Is Sim12 model still accurate?
- Are material descriptions incomplete? If so, should we fill-out?
- Get sanitized version of Sim12 source
- Understand how SVT works
- Write summary of how SVT works
- nTrigger is the number of times the beam is fired.
- Sim12/Material_HDDS.xml says that XML spec is at http://www.gluex.org/hdds, but get a 404. Maybe $HDDSROOT/HDDS-1_0.xsd is what was there?
Started working 3PM, had Freshman Physics in the middle. Left at 6:30PM. Experienced crash hitting Uranium target. Start trying other materials. Barium crashes too. Is Barium's (for example) small definition a problem? Barium crash generates "Unknown Hit Type on SVT1" (for each SVT) error message. Frustrating that GEANT4 is seemingly so specialized that google returns few people talking about it. Read on GEANT4 site that ALL particles must be specified (seems reasonable). Possibly the interactions are generating undefined particles? Should search code for error message tomorrow. Reorganized/expanded my bits of the wiki. Added GUI elements to Batch Guide.
Started working 12:45. Left 13:45 for Linguistics, back at 16:00. Searched for Magnetic Field definition. Looks like we need to make it. Searched for error message having to do with Unknown Hits. Didn't find it. Could have to do with using the default "geantino" particle? Looked around code for place to add handy things to menus (such as particle type) and found a reference to visTutor/gui.mac. It has exactly the sorts of things I would add! Why is it not getting read? Maybe should set-up breakpoints in Sim12.cc? You can apparently run macros from within the GUI, which I tried. At first I thought it didn't work, but it did. The first few lines of the macros I tried set the verbosity to 0, so I didn't see them running commands. Further, the addMenu etc. commands seem not to work. Why? Probably something to do with pointers... Not speaking of which, why does the source of Sim12 say that Batch Mode is the default, when it clearly is not? Also, there's something funky with that whole area of command line parsing. GUI mode should have ability to run commands. Batch mode should be able to run headless, dump data. Forget the pictures. Need to figure-out what the mode-selection code is actually doing.
Worked from 10:00-11:00, and 15:00-18:00 Trying to understand mode code. Think I've got pointers now, but I need to try using them. Thought of a way to turn on/off magnetic fields, change materials, etc. on the fly: Can change in-memory copy of XML file, then re-load that new copy. With this we could add buttons to toggle fields, change target materials, etc. On second thought, maybe we don't care about being able to do this. Meeting with Maurik. Sounds like priority is getting real data out of the program on particle trajectories etc. Tonight should polish build guide and run through the GEANT4 Application Developer's Guide in order to understand Sim12.
Saturday and Sunday, 26-27
Off the clock. Re-made build guide, building on MacOS X on Alice for hints. Should mention that I needed to install expat, motif, svn. Also, EVIO Makfile hack. Realized that GUI mode has a command line!!! It was there all the time, but we thought it was a meaningless box!
Started working through GEANT4 Application Developer's Guide: http://geant4.web.cern.ch/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/Examples/NoviceCodes.html
Worked with Sam, deciphering output code.
In at 10:30, out at 12:00. Working on getting Sim12 to log to a file.
Trying to get GEMC to compile. First compiled QT4, installed into ~/QT4 Installed SCons into ~/CLAS12/SCons Copied GEMC (from Maurik's dir on Taro) to ~/CLAS12/GEMC Tried to compile GEMC, which failed. After many successive failures, found the following things: Need to get qt4.py from http://www.iua.upf.es/~dgarcia/Codders/sconstools.html and copy it to $SCONS_ROOT_DIR/lib/scons-$SCONS_version/SCons/Tool/ Need to add pyscripts dir (from SVN/Maurik's dir) to PYTHONPATH, a la: export PYTHONPATH="/net/home/dan/CLAS12/pyscripts" Need to add SCons bin dir to PATH, a la: PATH="$PATH:/net/home/dan/CLAS12/SCons/bin" Need to add directory installed QT to to environment, a la: export QTDIR="/net/home/dan/QT4" And add PKG_CONFIG_PATH="/net/home/dan/QT4/lib/pkgconfig" to environment Current error message: [dan@benfranklin GEMC]$ scons scons: Reading SConscript files ... Loading qt4 tool... KeyError: 'MYSQL': File "/net/home/dan/CLAS12/GEMC/SConstruct", line 27: loadmysql(env) File "/net/home/dan/CLAS12/pyscripts/loadmysql.py", line 9: MYSQL = OSENV['MYSQL'] File "/usr/lib/python2.3/UserDict.py", line 19: def __getitem__(self, key): return self.data[key] So re-compiled QT4 with -qt-sql-mysql configure option.
Got past previous error with new QT4, but now get: [dan@benfranklin GEMC]$ scons scons: Reading SConscript files ... Loading qt4 tool... NameError: global name 'fullpath1' is not defined: File "/net/home/dan/CLAS12/GEMC/SConstruct", line 14: env = Environment(tools=['default','qt4'], options = opts) File "/net/home/dan/CLAS12/SCons/lib/scons-0.97.0d20070918/SCons/Environment.py", line 874: apply_tools(self, tools, toolpath) File "/net/home/dan/CLAS12/SCons/lib/scons-0.97.0d20070918/SCons/Environment.py", line 101: env.Tool(tool) File "/net/home/dan/CLAS12/SCons/lib/scons-0.97.0d20070918/SCons/Environment.py", line 1491: tool(self) File "/net/home/dan/CLAS12/SCons/lib/scons-0.97.0d20070918/SCons/Tool/__init__.py", line 175: apply(self.generate, ( env, ) + args, kw) File "/net/home/dan/CLAS12/SCons/lib/scons-0.97.0d20070918/SCons/Tool/qt4.py", line 218: QT4_MOC = locateQt4Command(env,'moc', env['QTDIR']), File "/net/home/dan/CLAS12/SCons/lib/scons-0.97.0d20070918/SCons/Tool/qt4.py", line 201: raise "Qt4 command '" + command + "' not found. Tried: " + fullpath1 + " and "+ fullpath2 Found that I accidentally installed into a funky directory. Blah. Fixed, then ran into another error message. Realized I had to export MYSQL="/" Ridiculous. Also, need to add MYSQL lib dir to LD_PATH It works!
GEMC thoughts: Not all the buttons work Text output works with ./gemc -OUTPUT="txt,blahlog" Need command line Is there a batch mode? Over vacation, read through all of it, work through C++ tutorials, and GEANT4 developer's guide. Make Glossary! (CLARA, GEMC, SIM12,
In at 10:15, out at 11:15 In at 12:00, out at 13:00 In at 15:30, out at Got new gemc code from Maurik Need to export EVIO=$EVIOROOT Also, typo in current version of pyscripts/loadevio.py. Change to point to something sane for include dir. Had to further mutilate the lib section to get it to compile. Working on adding command line to GUI Added text box (to old version)by adding #include <QLineEdit> QLineEdit *commandLineEdit = new QLineEdit(); viewLayout->addWidget(commandLineEdit); to gui/src/gemc_MainGui.cc. Still haven't gotten it to compile.
Trying to add a command line box. QT Learning curve indeed! Learning about Slots and Signals. Didn't try to get new gemc to compile today, though Maurik got us the latest pyscripts. How can I pass an arbitrary
MUAHAHAHAHAHAHAHAAAA! Finally got the command box working. Also, new gemc compiles. Code is ugly, though. I want to clean it up before letting others see it. Also, must document how to get gemc to compile (difficulty is evio, I had to hack loadevio.py). Email Maurizio and Maurik tonight. The thing holding-up my command box was that I was having difficulty converting the QString I got back from the QLineEdit box into a string I could print/etc. It seems like it should have been so simple...
Worked on adding command history, fixed a segfault, made layout flow
12:15-13:15 Polished command history, started synching with upstream.
13:15-17:15 Making new CLAS12 suite in /net/data/pumpkin2/taro/CLAS12 For EL5-x64, added -b 64 option during XERCESC build. Should we add -s?
14:00-16:45 Worked on building CLAS12 suite. Intending to build on Pumpkin for RHEL5-x64, Parity/Ben Franklin for RHEL4-x32, and Corn for RHEL5-x32. Think that Maurik is pulling the production tree of gemc, while we probably want the development version. Even so, new production gemc fails to build against old GEANT4. Corn keeps going down.
12:45-14:30, 17:00-17:30 Building things on Corn. ./configure -qt-sql-mysql --prefix=/net/data/pumpkin2/taro/CLAS12/RHEL5_x32/QT Network storage went down.
13:30-16:30 ./runConfigure -p linux -c gcc -x g++ -b 64 -s Building QT on Taro with instructions from wiki, got errors g++ -c -include .pch/release-shared/QtGui -m64 -pipe -g -fno-exceptions -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -O2 -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_GUI_LIB -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_44_API_QSQLQUERY_FINISH -DQT_MOC_COMPAT -DQT_RASTER_IMAGEENGINE -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP -DQ_INTERNAL_QAPP_SRC -DQT_NO_DEBUG -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++-64 -I. -I../../include/QtCore -I../../include/QtCore -I../../include -I../../include/QtGui -I/usr/include/freetype2 -I../3rdparty/harfbuzz/src -Idialogs -I.moc/release-shared -I/usr/X11R6/include -I.uic/release-shared -o .obj/release-shared/qstylesheetstyle.o styles/qstylesheetstyle.cpp ^C../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h: In member function `virtual QRect QStyleSheetStyle::subControlRect(QStyle::ComplexControl, const QStyleOptionComplex*, QStyle::SubControl, const QWidget*) const': ../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h:118: error: inconsistent operand constraints in an `asm' ../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h:118: error: inconsistent operand constraints in an `asm' ../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h:118: error: inconsistent operand constraints in an `asm' ../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h:118: error: inconsistent operand constraints in an `asm' make: *** Deleting file `.obj/release-shared/qstylesheetstyle.o' make: *** [.obj/release-shared/qstylesheetstyle.o] Interrupt make: *** [sub-gui-make_default-ordered] Interrupt Incidentally, used the following command to configure, with CLAS12ROOT set: ./configure -qt-gif -no-cups -no-qt3support -prefix $CLAS12ROOT/QT -qt-sql-mysql -no-exceptions
09:30-10:00 Googling QT build message yielded someone claiming it was due to a broken compiler. As the change will at worse result in slightly poorer performance, I take the suggestion at http://lists.trolltech.com/qt-interest/2007-05/thread01156-0.html and remove the -02 optimization flag from mkspecs/common/g++.conf Trying on Corn (which Maurik says should be stable now) and Taro. *sigh* Corn crashed right after I untarred QT. ~15:30 Taro finished building though! Now try again on Corn. Bah, Corn needs mysql!
Monday, 28 09:15-09:45
Started compile of GEANT4 9.1, using configure script.
00:15-01:30, 16:45-19:05 Well, I'm sick of this. SSH in to Parity. Start new tree under /net/data/pumpkin2/CLAS12 Untar CLHEP to Build and run export CLAS12ROOT=/net/data/pumpkin2/CLAS12/RHEL4_x32 ./configure --prefix=/net/data/pumpkin2/CLAS12/RHEL4_x32/CLHEP --disable-shared make make check make install export CLHEP_BASE_DIR=/net/data/pumpkin2/CLAS12/RHEL4_x32/CLHEP Now untar XERXESC to Build and run ./runConfigure -plinux -cgcc -xg++ -s make Build fails. It seems it's got a really silly build process. Move the top xercesc source dir to the intended destination, and build again. i.e.: ./runConfigure -plinux -cgcc -xg++ -s make Now untar QT to Build and run ./configure -qt-gif -no-cups -no-qt3support -prefix $CLAS12ROOT/QT -qt-sql-mysql -no-exceptions -static gmake in qt build dir, gmake install export QTDIR=$CLAS12ROOT/QT export QTLIB=/net/data/pumpkin2/CLAS12/RHEL4_x32/QT/lib export PKG_CONFIG_PATH=/net/data/pumpkin2/CLAS12/RHEL4_x32/QT/lib/pkgconfig export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH export PATH=$QTDIR:$PATH Untar Geant4 into /net/data/pumpkin2/CLAS12/RHEL4_x32/GEANT4_9.1 Unpack data, etc. ./Configure -build And it's off! 18:45- It finished building GEANT4. mkdir ~/mysql ln -s /usr/include/mysql ~/mysql/include ln -s /usr/lib/mysql ~/mysql/lib export MYSQL=~/mysql Copy pyscripts, gemc, scons export PYTHONPATH=/net/data/pumpkin2/CLAS12/pyscripts export PATH=$PATH:/net/data/pumpkin2/CLAS12/SCons/bin export G4INSTALL=/net/data/pumpkin2/CLAS12/RHEL4_x32/GEANT4_9.1 export EVIO=/net/data/pumpkin2/taro/CLAS12/RHEL4_x32/EVIO scons Get this: [dan@parity GEMC_DEVEL]$ scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... Making gemc.o... gemc.cc: In function `int main(int, char**)': gemc.cc:176: error: `G4UIQt' has not been declared scons: *** [gemc.o] Error 1 scons: building terminated because of errors. *sigh*
00:30-01:45 Continue working on RHEL4_x32. No success.
09:30-10:30, 12:30-14:00 Worked with Kyle to get ANYTHING to work (in particular RHEL4_x32) and largely failed. Eventually decided we need to start over. This time with more documentation instead of waiting until things work (because they usually don't).
12:00-13:45 Starting over, me on RH4 (x32 on parity, x64 on Taro), Kyle on RH5. Compiled up through QT on RHEL4_x32. QT building on RHEL4_x64.
08:45-09:30 QT build failed on x64. Remembered I need to remove -02 from the optimization flags in mkspecs/common/g++.conf in the QT source directory. Off again, with Geant building on Parity (set env vars, then gmake in G4/source).
09:00-10:00, 15:15-16:45 To build EVIO: untar the evio-2.0.tar.gz version move it to destination directory (say, something/EVIO) cd into EVIO for 32bit build, run INSTALL_DIR=something/EVIO make install for 64bit build, run INSTALL_DIR=something/EVIO CODA_USE64BITS make install Finished RHEL4_x32. Segfaults:
09:00-10:00 Current hang-up with Taro (RHEL4_x64): [dan@taro GEMC-RHEL4_x64]$ scons --debug=findlibs --debug=includes scons: Reading SConscript files ... scons: *** No tool named 'qt4': not a Zip file File "/net/home/dan/GEMC-RHEL4_x64/SConstruct", line 14, in ? We've had this before, but it sounds like it is an all-purpose error message, with no useful info. Trying to track down what is wrong.
Remember to set umask!
My current environment script (run each new session, suitable for build environment):
#Change the mention of RHEL4_x64 and Linux_x64-x64 for other platforms. export PLATFORM=RHEL4_x64 export GEMC=~/GEMC-$PLATFORM export CLAS12ROOT=/net/data/pumpkin2/CLAS12 export G4SYSTEM=Linux-g++ export G4WORKDIR=$CLAS12ROOT/$PLATFORM/GEANT4.9.1 export G4ROOT=$CLAS12ROOT/$PLATFORM/GEANT4.9.1 export G4INSTALL=$G4ROOT export G4LIB=$G4INSTALL/lib export G4VERSION=geant4.9.1 export OGLHOME=/usr/X11R6 export CLHEP_BASE_DIR=$CLAS12ROOT/$PLATFORM/CLHEP export XERCESCROOT=$CLAS12ROOT/$PLATFORM/XERCESC export EVIO="$CLAS12ROOT/$PLATFORM/EVIO" export EVIOROOT="$EVIO" export QTDIR=$CLAS12ROOT/$PLATFORM/QT export QTHOME=$QTDIR export QTLIB=$QTDIR/lib export G4UI_BUILD_QT_SESSION=1 export G4UI_USE_QT=1 export G4VIS_BUILD_OPENGLQT_DRIVER=1 export G4VIS_USE_OPENGLQT=1 export G4VIS_BUILD_OPENGLX_DRIVER=1 export G4VIS_USE_OPENGLX=1 export G4VIS_BUILD_DAWN_DRIVER=0 export G4VIS_USE_DAWN=0 export G4UI_BUILD_OI_SESSION=0 export G4UI_USE_OI=0 export G4UI_BUILD_OIX_SESSION=0 export G4UI_USE_OIX=0 export G4UI_BUILD_RAYTRACERX_SESSION=1 export G4UI_USE_RAYTRACERX=1 export G4LISTS_BASE=$G4ROOT/physics_lists export NeutronHPCrossSections=$G4ROOT/data/G4NDL # Data for neutron scattering processes export G4LEVELGAMMADATA=$G4ROOT/data/PhotonEvaporation # Nuclear Photon evaporation data export G4RADIOACTIVEDATA=$G4ROOT/data/RadioactiveDecay # Data for radioactive decay hadronic processes under data export G4LEDATA=$G4ROOT/data/G4EMLOW # Data for low energy electromagnetic processes #export G4ELASTICDATA=$G4ROOT/data/Elastic # Data for elastic scattering processes export PATH=$PATH:$G4INSTALL/bin/$G4SYSTEM:$GEMC:$GEMC/database_io:$QTDIR/bin export SCONS_LIB_DIR="$CLAS12ROOT/SCons/lib" export PKG_CONFIG_PATH="$QTLIB/pkgconfig" export PYTHONPATH="$CLAS12ROOT/pyscripts" export PATH="$PATH:$CLAS12ROOT/SCons/bin:$QTDIR/bin" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$EVIO/Linux-x86_64-64/lib:$QTLIB:$G4INSTALL/lib/$G4SYSTEM:/$CLHEP_BASE_DIR/lib" export MYSQL="/" export BMS_HOME="$CLAS12ROOT/BMS"
09:00-10:00 11:00-12:30 Trying to find source of segfault on RHEL4_x32 by using GDB. Need to re-compile GEANT4 with debugging symbols. Prettied the wiki a bit. Needs overhaul. '''Monday,25''' <pre> 16:00-17:45 Recompiled RHEL4_x32 with debugging symbols, now get the following when run:
[dan@benfranklin GEMC-RHEL4_x32]$ gemc >>> gemc Init: >> Geant4 MonteCarlo >>> gemc Init: >> Setting CLHEP Random Engine... >>> gemc Init: >> Instantiating Run Manager... ************************************************************* Geant4 version Name: geant4-09-01 (14-December-2007) Copyright : Geant4 Collaboration Reference : NIM A 506 (2003), 250-303 WWW : http://cern.ch/geant4 ************************************************************* >>> gemc Init: >> Building gemc Detector... >>> gemc MySQL: >> Connecting to database: clasgeometry as clasuser. >>> gemc Init: >> Initializing Physics List... >>> gemc Init: >> Initializing Primary Generator Action... >>> gemc Beam Settings >> Beam Type: e- >>> gemc Beam Settings >> Beam Energy: 11 GeV >>> gemc Beam Settings >> Beam Direction: (0, 0, 1) >>> gemc Beam Settings >> Beam Vertex: (0, 0, 0) cm >>> gemc Init: >> Initializing Event Action... >>> gemc Init: >> Initializing User Interface... >>> gemc Init: >> Initializing Run Manager... >>> gemc Construction: >> Building Detector from Geometry STL Map... >>> gemc Magnetic Field: >> Magnetic Field <ihep-solenoid> doesn't exist yet. Adding <ihep-solenoid>. >>> gemc Magnetic Field Constructor: >> File sol12_map.dat could not be opened. Exiting. [dan@benfranklin GEMC-RHEL4_x32]$
Kyle and I updated the Detailed Instructions wiki page, though I suspended most of the changes as I don't have time ATM to make them comprehensive.