Message: compiling and execution of Example Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None compiling and execution of Example 

Forum: Documentation and Examples
Date: 20 Jul, 2012
From: <ljub>

Hy. I would like to know how I can compile example (let's say B1) if I moved it out of it's original directory (let's say to home/geant4/ directory)? Probably the problem came from change of paths...i changed the G4INSTALL in GNUmakefile, but probably I should change it in few more places? 

But the point here is that I would like to compile also other programs for geant4 (if I ever make one) which do not have allready made GNUmakefile and CMakelists. So I got help, and he quickly made me this:

#!/bin/bash

INCLUDE="-I/home/t/geant4/geant4.9.5.p01_install/include/Geant4 -I/home/t/geant4/B1/include"
LIBS=/home/t/geant4/geant4.9.5.p01_install/lib
DEFS="-DG4VIS_USE -DG4UI_USE -DG4VIS_USE_OPENGLX"

c++ -c $DEFS $INCLUDE ./src/B1DetectorConstruction.cc
c++ -c $DEFS $INCLUDE ./src/B1EventAction.cc
c++ -c $DEFS $INCLUDE ./src/B1PrimaryGeneratorAction.cc
c++ -c $DEFS $INCLUDE ./src/B1RunAction.cc
c++ -c $DEFS $INCLUDE ./src/B1SteppingAction.cc
c++ -c $DEFS $INCLUDE exampleB1.cc

LIBNAMES="-rdynamic -lG4Tree -lG4FR -lG4GMocren -lG4visHepRep -lG4RayTracer -lG4VRML -lG4OpenGL -lG4gl2ps -lG4vis_management -lG4modeling -lG4interfaces -lG4persistency -lG4analysis -lG4error_propagation -lG4readout -lG4physicslists -lG4run -lG4event -lG4tracking -lG4parmodels -lG4processes -lG4digits_hits -lG4track -lG4particles -lG4geometry -lG4materials -lG4graphics_reps -lG4intercoms -lG4global -lG4clhep -lG4zlib -lG4FR -lG4vis_management -lG4modeling -lGLU -lGL -lSM -lICE -lX11 -lXext -lXmu -lG4run -lG4event -lG4tracking -lG4processes -lexpat -lG4digits_hits -lG4track -lG4particles -lG4geometry -lG4materials -lG4graphics_reps -lG4intercoms -lG4global -lG4clhep" 

g++ -W -Wall -ansi -pedantic B1DetectorConstruction.o B1EventAction.o \
    B1PrimaryGeneratorAction.o B1RunAction.o B1SteppingAction.o exampleB1.o \
    -o exampleB1 -L$LIBS $LIBNAMES -Wl,-rpath,$LIBS


It works fine, but is there any other option, because here we needed to change a bit of code in vis.mac for B1.
In the eighth lane we changed OGL with OGLIX, because otherwise B1 compiled but when you executed it, it stopped inbetween.
7.   # Use this open statement to create an OpenGL view:
8.   /vis/open OGLIX 600x600-0+0

When it stopped the final output was this:
 /vis/open OGL 600x600-0+0 parameter value is not listed in the candidate
 List. ***** Illegal parameter (0) </vis/open OGL 600x600-0+0> *****
 
 ***** Batch is interrupted!! ***** Idle>

Thanks

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

1 None: Re: compiling and execution of Example   (Youming Yang - 20 Jul, 2012)
(_ Question: Re: compiling and execution of Example   (ljub - 24 Jul, 2012)
(_ None: Re: compiling and execution of Example   (ljub - 24 Jul, 2012)
(_ None: Re: compiling and execution of Example   (Ivana Hrivnacova - 24 Jul, 2012)
(_ None: Re: compiling and execution of Example   (ljub - 24 Jul, 2012)
(_ None: Re: compiling and execution of Example   (Ivana Hrivnacova - 24 Jul, 2012)
(_ Question: Re: compiling and execution of Example   (ljub - 24 Jul, 2012)
(_ None: Re: compiling and execution of Example   (Ivana Hrivnacova - 24 Jul, 2012)
 Add Message Add Message
to: "compiling and execution of Example"

 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 ]