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

None Re: compiling and execution of Example 

Forum: Documentation and Examples
Re: None compiling and execution of Example
Date: 20 Jul, 2012
From: Youming Yang <Youming Yang>

Since you are using Geant 4.9.5, are you referring to modifying the GNUmakefile that is generated by CMake?

It's simpler to rerun the cmake configuration (cmake-gui is very user friendly), with a new specified "code" directory (wherever the new source is located), any arbitrary build directory you wish, and whatever install directory you wish.

Then go into the new build directory and do a make install from there.

Keep in mind that the CMakeLists.txt files are hierarchical, so for example you will find under the main examples directory's CMakeLists.txt file:

>#---Adding examples subdirectories explicitly-------
>cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
>add_subdirectory(advanced)
>add_subdirectory(basic)
>add_subdirectory(extended)
>add_subdirectory(novice)

Under the basic directory you then find for CmakeLists.txt:

>#---Adding examples subdirectories explicitly 
>#   and a custom target to for building all basic examples -------------
>cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
>add_subdirectory(B1)
>add_subdirectory(B2)
>add_subdirectory(B3)
>add_subdirectory(B4)
>add_custom_target(basic DEPENDS B1 B2 B3 B4)

Finally under B2 (for which the whole directory you have moved, correct?) you will find:

>#---Adding example B2 subdirectories explicitly 
>#   and a custom target to for building all example B2 options ----------
>cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
>add_subdirectory(B2a)
>add_subdirectory(B2b)
>add_custom_target(B2 DEPENDS exampleB2a exampleB2b)

For cmake-gui to properly compile with just the B2 directory, you should need to add

>cmake_minimum_required(VERSION 2.6 FATAL_ERROR)

To your upper-most CMakeLists.txt file.

Ming

On Fri, 20 Jul 2012 15:50:41 GMT, ljub wrote:

> 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? 
> ...

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

1 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: "Re: 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 ]