How to give path to macro files?

Can anybody know how to give command for directing macro files ?

/control/execute run.mac but before I need to give command as
/control/macroPath ___________?
how to write the macro path ?

Geant4 Version:_PACKAGE_VERSION “10.4.2”

_Operating System:_CentOS LINUX
Compiler/Version: CPack ,Terminal
CMake Version: CPack

Thank You

If you mean how to deal with the probelm that the executable program is not in the same directory as the macro file, just write the relative path of your run.mac, e.g. if you are in a build/ path and your macro file is in the parent path, just use

/control/execute ../run.mac

I tried to execute the program using the same code but it shows error.
PreInit> /control/execute /run.mac
ERROR: Can not open a macro file <…/run.mac>. Set macro path with “/control/macroPath” if needed.

How to give command to set the macroPath ?

Thank you

Are you sure you enter the path of your macro file correctly?

This command seems to indicate that run.mac is at the root directory! I doubt this is not the case for you.

Suppose we have a file structure like this:

|__ build
  |__ example (this is your executable file) 
|__ macros
  |__ run.mac

you can use /control/execute ../macros/run.mac to run your macro file or you can use /control/macroPath ../macros then /control/execute run.mac to run the same macro file.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.