Runing egs5 in command prompt of windows


To run egs5 in command prompt of windows, please do followings.

  1. Download egs5.tar.gz and extract files.(link)
  2. Prepare fortran compiler. For example, free g77 can be downloaded from here .
  3. If your PC is operated on Windows XP, download junction.exe from microsoft site. Place junction.exe in the working directory or any directory where path can reach. (ex. C:\windows)
    If your PC is operated on Windows Vista, 7, or later, junction.exe is not necessary.
  4. Download egs5run.bat or egs5run_xp.bat and place them in a working directory (ex. C:\egs5\userdir\).
    If you can not download batch file, download egs5run.txt or egs5run_xp.txt and change extension from txt to bat.
    egs5run_xp.bat is an old version for Windows XP, in which mklink command is not included and junction should be used instead.
  5. Modify egs5run.bat in the following 2 lines.
  6. Open command prompt and change directory to working directory.
  7. Type in (for example) egs5run ucsampl5

Development log of egs5run.bat

  1. S. Kito of National Cancer Center (NCC) in Japan first developed egs5run.bat in 2006. At that time, symbolic link capability was not available, then compile of egs5 was possible in one directory. To run egs5run from arbitrary directory, modification of source code was necessary.
  2. In 2009, Y. Namito modified S. Kito's egs5run.bat using junction.exe or "mklink /D" so that execution of egs5run is possible from any directory without any modification of source code. Two versions of egs5run.bat were created. egs5run.bat and egsrun_vista.bat utilized junction.exe and "mklink /D" to do symbolic link, respectively. junction.exe is a kind of add-on software for windows 2000 and later. "mklink /D" is a native command in windows vista. To use "mklink /D", user needs to login by admin uid and disable UAC (User access control). Then, junction.exe may be more convenient to use than mklink.
  3. If egs5run.bat is executed at $BASKET$, system file is erased and this cause fortran compile error. As this happens repeatedly, following lines were added to egs5run.bat to prevent execution of egs5run.bat from %BASKET% directory. (24May2012)
    IF /i %cd% == %BASKET% ( 
       Echo ERROR: egs5run can not be run from BASKET -- aborting.
       EXIT /B)
    
  4. Updated to use "mklink /J" instead of junction. Older version using junction.exe is saved after renamed as egs5rn_xp.bat . Older version (egs5run_vista.bat) using "mklink /D" is no longer used. (10Jan2014)




Last modified: 14 Jan 2014