| [6] | 1 | @ECHO OFF
|
|---|
| 2 |
|
|---|
| 3 | REM #
|
|---|
| 4 | REM # File produced by the obuild tool version 1.0
|
|---|
| [101] | 5 | REM # for the package snovis with version v1r1.
|
|---|
| [6] | 6 | REM #
|
|---|
| 7 |
|
|---|
| 8 | REM #////////////////////////////////////////////////
|
|---|
| 9 | REM # Usage :
|
|---|
| 10 | REM # DOS> setup
|
|---|
| 11 | REM # or :
|
|---|
| 12 | REM # DOS> setup.bat
|
|---|
| 13 | REM # or :
|
|---|
| 14 | REM # DOS> call setup.bat
|
|---|
| 15 | REM #////////////////////////////////////////////////
|
|---|
| 16 |
|
|---|
| 17 | SET obuild_snovis_path=%~dp0
|
|---|
| 18 | REM # Remove ending \obuild\
|
|---|
| 19 | SET obuild_snovis_path=%obuild_snovis_path:~0,-8%
|
|---|
| 20 |
|
|---|
| 21 | IF "%OBUILD_PLATFORM%" == "" (
|
|---|
| 22 | IF "%OS%" == "" ECHO Environment variable OS not found. & GOTO obuild_return
|
|---|
| 23 | SET obuild_platform=%OS%
|
|---|
| 24 | ) ELSE (
|
|---|
| 25 | SET obuild_platform=%OBUILD_PLATFORM%
|
|---|
| 26 | )
|
|---|
| 27 |
|
|---|
| 28 | IF "%obuild_platform%" == "" (
|
|---|
| 29 | ECHO obuild_platform variable not defined.
|
|---|
| 30 | GOTO obuild_return
|
|---|
| 31 | )
|
|---|
| 32 |
|
|---|
| 33 | IF "%OBUILD_DIR_BIN%" == "" (
|
|---|
| 34 | SET obuild_dir_bin=%obuild_platform%_obuild
|
|---|
| 35 | ) ELSE (
|
|---|
| 36 | SET obuild_dir_bin=%OBUILD_DIR_BIN%
|
|---|
| 37 | )
|
|---|
| 38 |
|
|---|
| 39 | IF "%obuild_dir_bin%" == "" (
|
|---|
| 40 | ECHO obuild_dir_bin variable not defined.
|
|---|
| 41 | GOTO obuild_return
|
|---|
| 42 | )
|
|---|
| 43 |
|
|---|
| 44 | IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%" MKDIR "%obuild_snovis_path%\%obuild_dir_bin%"
|
|---|
| 45 | IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%\obuild_platform.exe" (
|
|---|
| [92] | 46 | cl.exe /nologo /DWIN32 /MD /O2 /W3 /GX /GR /Fe"%obuild_snovis_path%\%obuild_dir_bin%\obuild_platform.exe" "%obuild_snovis_path%\obuild\cpp\obuild_platform.cpp" 1> NUL
|
|---|
| [6] | 47 | IF EXIST obuild_platform.obj DEL obuild_platform.obj
|
|---|
| 48 | )
|
|---|
| 49 |
|
|---|
| 50 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
|
|---|
| 51 | cd "%obuild_snovis_path%\%obuild_dir_bin%"
|
|---|
| 52 | IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return
|
|---|
| [137] | 53 | FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% UNIX`) DO SET obuild_platform_result=%%j
|
|---|
| [6] | 54 | cd "%obuild_pwd_snovis_0%"
|
|---|
| 55 | SET obuild_pwd_snovis_0=
|
|---|
| [92] | 56 | IF NOT %obuild_platform_result% == yes GOTO end_if_platform_1
|
|---|
| [137] | 57 | SET CLHEP_home=/usr/local/CLHEP/2.0.3.1
|
|---|
| [92] | 58 | :end_if_platform_1
|
|---|
| [6] | 59 | SET obuild_platform_result=
|
|---|
| 60 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
|
|---|
| 61 | cd "%obuild_snovis_path%\%obuild_dir_bin%"
|
|---|
| 62 | IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return
|
|---|
| [134] | 63 | FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% UNIX`) DO SET obuild_platform_result=%%j
|
|---|
| [6] | 64 | cd "%obuild_pwd_snovis_0%"
|
|---|
| 65 | SET obuild_pwd_snovis_0=
|
|---|
| [92] | 66 | IF NOT %obuild_platform_result% == yes GOTO end_if_platform_3
|
|---|
| [137] | 67 | SET Geant4_home=/usr/local/geant4/8.2
|
|---|
| [92] | 68 | :end_if_platform_3
|
|---|
| [6] | 69 | SET obuild_platform_result=
|
|---|
| 70 | IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%" MKDIR "%obuild_snovis_path%\%obuild_dir_bin%"
|
|---|
| 71 | IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%\obuild_find.exe" (
|
|---|
| [92] | 72 | cl.exe /nologo /DWIN32 /MD /O2 /W3 /GX /GR /Fe"%obuild_snovis_path%\%obuild_dir_bin%\obuild_find.exe" "%obuild_snovis_path%\obuild\cpp\obuild_find.cpp" 1> NUL
|
|---|
| [6] | 73 | IF EXIST obuild_find.obj DEL obuild_find.obj
|
|---|
| 74 | )
|
|---|
| 75 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
|
|---|
| 76 | cd "%obuild_snovis_path%\%obuild_dir_bin%"
|
|---|
| 77 | IF NOT EXIST obuild_find.exe ECHO Program obuild_find.exe not found. && GOTO obuild_return
|
|---|
| 78 | FOR /F "usebackq delims=;" %%j IN (`.\obuild_find.exe OnX v17r*`) DO SET obuild_OnX_path=%%j
|
|---|
| 79 | cd "%obuild_pwd_snovis_0%"
|
|---|
| 80 | SET obuild_pwd_snovis_0=
|
|---|
| 81 | IF NOT DEFINED obuild_OnX_path ECHO Can't find OnX package. && GOTO obuild_return
|
|---|
| 82 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
|
|---|
| 83 | cd "%obuild_snovis_path%\%obuild_dir_bin%"
|
|---|
| 84 | IF NOT EXIST obuild_find.exe ECHO Program obuild_find.exe not found. && GOTO obuild_return
|
|---|
| 85 | FOR /F "usebackq delims=;" %%j IN (`.\obuild_find.exe G4Lab v8r*`) DO SET obuild_G4Lab_path=%%j
|
|---|
| 86 | cd "%obuild_pwd_snovis_0%"
|
|---|
| 87 | SET obuild_pwd_snovis_0=
|
|---|
| 88 | IF NOT DEFINED obuild_G4Lab_path ECHO Can't find G4Lab package. && GOTO obuild_return
|
|---|
| 89 |
|
|---|
| 90 | REM # Execute setup of used packages :
|
|---|
| 91 | IF NOT EXIST "%obuild_OnX_path%\obuild\setup.bat" ECHO setup.bat not found for package OnX. && GOTO obuild_return
|
|---|
| 92 | CALL "%obuild_OnX_path%\obuild\setup.bat"
|
|---|
| 93 | @ECHO OFF
|
|---|
| 94 |
|
|---|
| 95 | IF NOT EXIST "%obuild_G4Lab_path%\obuild\setup.bat" ECHO setup.bat not found for package G4Lab. && GOTO obuild_return
|
|---|
| 96 | CALL "%obuild_G4Lab_path%\obuild\setup.bat"
|
|---|
| 97 | @ECHO OFF
|
|---|
| 98 |
|
|---|
| 99 | REM # Set environment variables of this package :
|
|---|
| 100 | SET SNOVISROOT=%obuild_snovis_path%
|
|---|
| 101 | SET G4RADIOACTIVEDATA=%Geant4_home%\data\RadiativeDecay3.1
|
|---|
| 102 | SET G4LEVELGAMMADATA=%Geant4_home%\data\PhotonEvaporation2.0
|
|---|
| 103 | SET G4LEDATA=%Geant4_home%\data\G4EMLOW4.2
|
|---|
| 104 | SET NeutronHPCrossSections=%Geant4_home%\data\G4NDL3.10
|
|---|
| 105 |
|
|---|
| [137] | 106 | IF DEFINED PATH GOTO else_if_path_snovis_9
|
|---|
| [6] | 107 | SET PATH=%obuild_snovis_path%\%obuild_dir_bin%
|
|---|
| [137] | 108 | GOTO end_if_path_snovis_9
|
|---|
| 109 | :else_if_path_snovis_9
|
|---|
| [6] | 110 | SET PATH=%PATH%;%obuild_snovis_path%\%obuild_dir_bin%
|
|---|
| [137] | 111 | :end_if_path_snovis_9
|
|---|
| [6] | 112 |
|
|---|
| 113 | :obuild_return
|
|---|
| 114 |
|
|---|
| 115 | SET obuild_snovis_path=
|
|---|
| 116 |
|
|---|
| 117 | REM # FIXME SET obuild_platform=
|
|---|
| 118 | REM # FIXME SET obuild_dir_bin=
|
|---|
| 119 |
|
|---|
| 120 | @ECHO ON
|
|---|