Message: I d`not know how to run Geant4Py in Geant4 ??? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question I d`not know how to run Geant4Py in Geant4 ???  

Forum: Installation and Configuration
Date: 11 Apr, 2011
From: Batom <Batom>

Hello Experts and developers for Geant4!

I have recently installed Geant4, Root, Python on Ubuntu10.10. But I can`t build in Geant4Py panel. I think there must be working panel for choosing materials, particles, energies so on. It is me very impordant.

Please check me for command details of the current problem:

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/source# make
*************************************************************
 Installation Geant4 version - geant4-09-04-patch-01        
 Copyright (C) 1994-2011 Geant4 Collaboration               
*************************************************************
Making dependency for file src/G4VStateDependent.cc ...
Making dependency for file src/G4VNotifier.cc ...
......................................
Compiling G4OpticalSurface.cc ...
src/G4OpticalSurface.cc: In member function ‘void G4OpticalSurface::ReadFile()’:
src/G4OpticalSurface.cc:271: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result
Compiling G4SandiaTable.cc ...
............................................
Compiling G4GoudsmitSaundersonMscModel.cc ...
src/G4GoudsmitSaundersonMscModel.cc: In member function ‘void G4GoudsmitSaundersonMscModel::LoadELSEPAXSections()’:
src/G4GoudsmitSaundersonMscModel.cc:780: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result
Compiling G4HeatedKleinNishinaCompton.cc ...
....................................
Creating shared library /usr/local/geant4.9.4.p01/lib/Linux-g++/libG4OpenGL.so ...
Building library management utility liblist ...
/usr/local/geant4.9.4.p01/config/liblist.c: In function ‘main’:
/usr/local/geant4.9.4.p01/config/liblist.c:202: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
/usr/local/geant4.9.4.p01/config/liblist.c:264: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
Libmap stage. Searching for GNUmakefiles and sorting ...
Weeding out paths and files ...
Making libname.map starter file ...
Making libname.map ...
  Reading library name map file...
  Reading dependency files...
  Checking for circular dependencies...
  Reordering according to dependencies...
  Writing new library map file...
Libraries installation completed !
>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/source# make global
*************************************************************
 Installation Geant4 version - geant4-09-04-patch-01        
 Copyright (C) 1994-2011 Geant4 Collaboration               
*************************************************************
.........................................................................
Libraries installation completed !

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/source# make includes Installing header files in /usr/local/geant4.9.4.p01/include ... ................................................

In "tools" directory, you can find some ways to handle both "glanular static" ?? and "global shared" environments. Please take a look.

---------------------------------------------------------------

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/environments/g4py/tools/g4autobuild# ./g4autobuild

*** abort :/opt/heplib/Geant4 does not exist. -----------------------------------------------------------------

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/environments/g4py# ./configure linux --with-g4-incdir=/usr/local/geant4.9.4.p01/include --with-g4-libdir=/usr/local/geant4.9.4.p01/lib/Linux-g++ --with-clhep-incdir=/usr/local/2.1.0.1/CLHEP/include --with-clhep-libdir=/usr/local/2.1.0.1/CLHEP/lib --with-clhep-lib=CLHEP-2.1.0.1 Checking for system type ... linux Checking for prefix ... /usr/local/geant4.9.4.p01/environments/g4py Checking for lib dir ... /usr/local/geant4.9.4.p01/environments/g4py/lib Checking for G4 include dir ... /usr/local/geant4.9.4.p01/include Checking for G4 lib dir ... /usr/local/geant4.9.4.p01/lib/Linux-g++ Checking for G4 libs are shared libraray ... ok Checking for CLHEP include dir ... /usr/local/2.1.0.1/CLHEP/include Checking for CLHEP lib dir ... /usr/local/2.1.0.1/CLHEP/lib Checking for CLHEP lib name ... libCLHEP-2.1.0.1.so Checking for Python include dir (pyconfig.h) ... /usr/include/python2.7 Checking for Python lib dir ... /usr/lib Checking for Boost include dir (boost/python.hpp) ... /usr/include Checking for Boost version ... ok Checking for Boost lib dir ... /usr/lib Checking for Boost Python lib name ... libboost_python.so Checking for OpenGL support ...yes Checking for GL2PS support ...yes Checking for physics list support ...yes Checking for GDML support ...no Writing config.gmk ... done Writing config.status ... done

Enabled support for openglx raytracerx gl2ps physicslist.

To build Geant4Py type:

  make
  make install

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/environments/g4py# make make[1]: Entering directory `/usr/local/geant4.9.4.p01/environments/g4py/source' make[2]: Entering directory `/usr/local/geant4.9.4.p01/environments/g4py/source/global' make[2]: `G4global.so' is up to date. make[2]: Leaving directory `/usr/local/geant4.9.4.p01/environments/g4py/source/global' .................... make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/usr/local/geant4.9.4.p01/environments/g4py/site-modules/python' make[1]: Leaving directory `/usr/local/geant4.9.4.p01/environments/g4py/site-modules'

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/environments/g4py# make install

make[2]: Entering directory `/usr/local/geant4.9.4.p01/environments/g4py/site-modules/python' ... intall *.py into /usr/local/geant4.9.4.p01/environments/g4py/lib/g4py make[2]: Leaving directory `/usr/local/geant4.9.4.p01/environments/g4py/site-modules/python' make[1]: Leaving directory `/usr/local/geant4.9.4.p01/environments/g4py/site-modules'

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/environments/g4py# export PYTHONPATH=/usr/local/geant4.9.4.p01/environments/g4py/lib:$PYTHONPATH export PYTHONPATH=$PYTHONPATH:/usr/local/geant4.9.4.p01/environments/g4py/site-modules/lib export PYTHONPATH=$PYTHONPATH:/usr/local/root/lib

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/environments/g4py/examples/demos/water_phantom/g4lib# make Compiling MyDetectorConstruction.cc ... Compiling MyMaterials.cc ... Compiling MyPhysicsList.cc ... Compiling Particles.cc ... Compiling PhysicsListEMstd.cc ... Compiling PhysicsListLHad.cc ... Compiling pydemo_wp.cc ... Building a module ../demo_wp.so ...

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/environments/g4py/examples/demos/water_phantom/g4lib# cd ..

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/environments/g4py/examples/demos/water_phantom# ls demo.py demo_wp.so g4lib test.py vis.mac

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/environments/g4py/examples/demos/water_phantom# python demo.py

*************************************************************
 Geant4 version Name: geant4-09-04-patch-01    (18-February-2011)
                      Copyright : Geant4 Collaboration
                      Reference : NIM A 506 (2003), 250-303
                            WWW : http://cern.ch/geant4
*************************************************************

Visualization Manager instantiating with verbosity "warnings (3)"...
Traceback (most recent call last):
  File "demo.py", line 11, in <module>
    import ROOT
ImportError: No module named ROOT
(My ROOT PATH is export ROOTSYS=/usr/local/root
  export PATH=$ROOTSYS/bin:$PATH
  export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH)

>> root@batmunkhm-P5K-SE-EPU:/usr/local/geant4.9.4.p01/environments/g4py/examples/demos/water_phantom# python

Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Geant4 import *
*************************************************************
 Geant4 version Name: geant4-09-04-patch-01    (18-February-2011)
                      Copyright : Geant4 Collaboration
                      Reference : NIM A 506 (2003), 250-303
                            WWW : http://cern.ch/geant4
*************************************************************
Visualization Manager instantiating with verbosity "warnings (3)"...
>>> print gRunManager.GetVersionString()
 Geant4 version Name: geant4-09-04-patch-01    (18-February-2011)

>>> import g4py.ezgeom
>>> from g4py.ezgeom import G4EzVolume
>>> def ConstructGeom():
... print "* Constructing geometry..."
  File "<stdin>", line 2
    print "* Constructing geometry..."
        ^
IndentationError: expected an indented block
>>>
...............................................................................................................

Please again, help me, how can I do run Geant4Py. Thanks. M. Batmunkh

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: I d`not know how to run Geant4Py in Geant4 ???   (Henry Wang - 11 May, 2011)
 Add Message Add Message
to: "I d`not know how to run Geant4Py in Geant4 ??? "

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]