prep.bat 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. REM Copyright (C) 1994-2018 Altair Engineering, Inc.
  2. REM For more information, contact Altair at www.altair.com.
  3. REM
  4. REM This file is part of the PBS Professional ("PBS Pro") software.
  5. REM
  6. REM Open Source License Information:
  7. REM
  8. REM PBS Pro is free software. You can redistribute it and/or modify it under the
  9. REM terms of the GNU Affero General Public License as published by the Free
  10. REM Software Foundation, either version 3 of the License, or (at your option) any
  11. REM later version.
  12. REM
  13. REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  14. REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15. REM FOR A PARTICULAR PURPOSE.
  16. REM See the GNU Affero General Public License for more details.
  17. REM
  18. REM You should have received a copy of the GNU Affero General Public License
  19. REM along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. REM
  21. REM Commercial License Information:
  22. REM
  23. REM For a copy of the commercial license terms and conditions,
  24. REM go to: (http://www.pbspro.com/UserArea/agreement.html)
  25. REM or contact the Altair Legal Department.
  26. REM
  27. REM Altair’s dual-license business model allows companies, individuals, and
  28. REM organizations to create proprietary derivative works of PBS Pro and
  29. REM distribute them - whether embedded or bundled with other software -
  30. REM under a commercial license agreement.
  31. REM
  32. REM Use of Altair’s trademarks, including but not limited to "PBS™",
  33. REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  34. REM trademark licensing policies.
  35. setlocal
  36. if "%~1" == "" (
  37. echo Path to binaries directory require!
  38. exit /b 1
  39. )
  40. cd "%~dp0..\..\..\..\"
  41. set WINBUILDDIR=%CD%\win_build
  42. set PBS_EXECDIR=%CD%\PBS\exec
  43. set PBS_SRCDIR=%CD%\pbspro
  44. set BINARIESDIR=%~1
  45. set BUILD_TYPE=Release
  46. set BINARIESDIR_TYPE=
  47. if "%~2"=="debug" (
  48. set BUILD_TYPE=Debug
  49. set BINARIESDIR_TYPE=_debug
  50. )
  51. if "%~2"=="Debug" (
  52. set BUILD_TYPE=Debug
  53. set BINARIESDIR_TYPE=_debug
  54. )
  55. cd "%~dp0"
  56. 2>nul rd /S /Q "%PBS_EXECDIR%"
  57. echo Copying necessory files for PBS_EXEC\bin
  58. for %%a in (
  59. "%WINBUILDDIR%\src\cmds\%BUILD_TYPE%\*.exe"
  60. "%WINBUILDDIR%\src\lib\Libpbspthread\%BUILD_TYPE%\Libpbspthread.dll"
  61. "%WINBUILDDIR%\src\tools\%BUILD_TYPE%\*.exe"
  62. "%PBS_SRCDIR%\src\cmds\scripts\*.bat"
  63. "%BINARIESDIR%\tcltk%BINARIESDIR_TYPE%\bin\*.dll"
  64. ) do (
  65. 1>nul xcopy /Y /V /J "%%a" "%PBS_EXECDIR%\bin\"
  66. if not %ERRORLEVEL% == 0 (
  67. echo Failed to copy files from "%%a" to "%PBS_EXECDIR%\bin\"
  68. exit /b 1
  69. )
  70. )
  71. REM Remove unneccesory files from bin directory
  72. del /F /Q "%PBS_EXECDIR%\bin\pbs_ds_monitor.exe"
  73. del /F /Q "%PBS_EXECDIR%\bin\pbs_ds_password.exe"
  74. del /F /Q "%PBS_EXECDIR%\bin\pbs_dataservice.bat"
  75. echo Copying necessory files for PBS_EXEC\sbin
  76. for %%a in (
  77. "%WINBUILDDIR%\src\server\%BUILD_TYPE%\*.exe"
  78. "%WINBUILDDIR%\src\iff\%BUILD_TYPE%\*.exe"
  79. "%WINBUILDDIR%\src\tools\%BUILD_TYPE%\pbs_ds_monitor.exe"
  80. "%WINBUILDDIR%\src\resmom\%BUILD_TYPE%\*.exe"
  81. "%WINBUILDDIR%\src\mom_rcp\%BUILD_TYPE%\*.exe"
  82. "%WINBUILDDIR%\src\cmds\%BUILD_TYPE%\pbs_ds_password.exe"
  83. "%WINBUILDDIR%\src\scheduler\%BUILD_TYPE%\*.exe"
  84. "%WINBUILDDIR%\src\send_job\%BUILD_TYPE%\*.exe"
  85. "%WINBUILDDIR%\src\send_hooks\%BUILD_TYPE%\*.exe"
  86. "%WINBUILDDIR%\src\start_provision\%BUILD_TYPE%\*.exe"
  87. "%PBS_SRCDIR%\src\cmds\scripts\pbs_dataservice.bat"
  88. ) do (
  89. 1>nul xcopy /Y /V /J "%%a" "%PBS_EXECDIR%\sbin\"
  90. if not %ERRORLEVEL% == 0 (
  91. echo Failed to copy files from "%%a" to "%PBS_EXECDIR%\sbin\"
  92. exit /b 1
  93. )
  94. )
  95. echo Copying necessory files for PBS_EXEC\etc
  96. for %%a in (
  97. "%PBS_SRCDIR%\src\scheduler\pbs_holidays*"
  98. "%PBS_SRCDIR%\src\scheduler\pbs_dedicated"
  99. "%PBS_SRCDIR%\src\scheduler\pbs_resource_group"
  100. "%PBS_SRCDIR%\src\scheduler\pbs_sched_config"
  101. "%PBS_SRCDIR%\src\cmds\scripts\pbs_db_schema.sql"
  102. "%PBS_SRCDIR%\src\cmds\scripts\win_postinstall.py"
  103. ) do (
  104. 1>nul xcopy /Y /V /J "%%a" "%PBS_EXECDIR%\etc\"
  105. if not %ERRORLEVEL% == 0 (
  106. echo Failed to copy files from "%%a" to "%PBS_EXECDIR%\etc\"
  107. exit /b 1
  108. )
  109. )
  110. echo > "%PBS_EXECDIR%\etc\createdb.bat"
  111. echo > "%PBS_EXECDIR%\etc\create_svr_defaults.bat"
  112. echo Copying necessory files for PBS_EXEC\include
  113. for %%a in (
  114. "%PBS_SRCDIR%\src\include\pbs_error.h"
  115. "%PBS_SRCDIR%\src\include\pbs_ifl.h"
  116. "%PBS_SRCDIR%\src\include\rm.h"
  117. "%PBS_SRCDIR%\src\include\tm_.h"
  118. "%PBS_SRCDIR%\src\include\tm.h"
  119. "%PBS_SRCDIR%\src\include\win.h"
  120. ) do (
  121. 1>nul xcopy /Y /V /J "%%a" "%PBS_EXECDIR%\include\"
  122. if not %ERRORLEVEL% == 0 (
  123. echo Failed to copy files from "%%a" to "%PBS_EXECDIR%\include\"
  124. exit /b 1
  125. )
  126. )
  127. echo Copying necessory files for PBS_EXEC\lib
  128. 1>nul xcopy /Y /V /J "%PBS_SRCDIR%\src\cmds\scripts\pbs_topologyinfo.py" "%PBS_EXECDIR%\lib\python\"
  129. if not %ERRORLEVEL% == 0 (
  130. echo Failed to copy files from "%PBS_SRCDIR%\src\cmds\scripts\pbs_topologyinfo.py" to "%PBS_EXECDIR%\lib\python\"
  131. exit /b 1
  132. )
  133. 1>nul xcopy /Y /V /J /S "%PBS_SRCDIR%\src\modules\python\pbs" "%PBS_EXECDIR%\lib\python\altair\pbs\"
  134. if not %ERRORLEVEL% == 0 (
  135. echo Failed to copy files from "%PBS_SRCDIR%\src\modules\python\pbs" to "%PBS_EXECDIR%\lib\python\altair\pbs\"
  136. exit /b 1
  137. )
  138. 1>nul xcopy /Y /V /J "%PBS_SRCDIR%\win_configure\projects.VS2008\pbs_ifl.py" "%PBS_EXECDIR%\lib\python\altair\pbs\v1\"
  139. if not %ERRORLEVEL% == 0 (
  140. echo Failed to copy files from "%PBS_SRCDIR%\win_configure\projects.VS2008\pbs_ifl.py" to "%PBS_EXECDIR%\lib\python\altair\altair\v1\"
  141. exit /b 1
  142. )
  143. 1>nul xcopy /Y /V /J "%BINARIESDIR%\python\Lib\*.*" "%PBS_EXECDIR%\lib\python\python2.7\"
  144. if not %ERRORLEVEL% == 0 (
  145. echo Failed to copy files from "%BINARIESDIR%\python\Lib\" to "%PBS_EXECDIR%\lib\python\python2.7\"
  146. exit /b 1
  147. )
  148. "%BINARIESDIR%\python\python.exe" -Wi "%BINARIESDIR%\python\Lib\compileall.py" -q -f -x "%PBS_EXECDIR%\lib\python"
  149. "%BINARIESDIR%\python\python.exe" -O -Wi "%BINARIESDIR%\python\Lib\compileall.py" -q -f -x "%PBS_EXECDIR%\lib\python"
  150. 1>nul xcopy /Y /V /J /S "%BINARIESDIR%\libical%BINARIESDIR_TYPE%\share\libical\zoneinfo" "%PBS_EXECDIR%\lib\ical\zoneinfo\"
  151. if not %ERRORLEVEL% == 0 (
  152. echo Failed to copy files from "%BINARIESDIR%\libical%BINARIESDIR_TYPE%\share\libical\zoneinfo" to "%PBS_EXECDIR%\lib\ical\zoneinfo"
  153. exit /b 1
  154. )
  155. for %%a in (
  156. "%WINBUILDDIR%\src\lib\Libattr\%BUILD_TYPE%\Libattr.lib"
  157. "%WINBUILDDIR%\src\lib\Liblog\%BUILD_TYPE%\Liblog.lib"
  158. "%WINBUILDDIR%\src\lib\Libnet\%BUILD_TYPE%\Libnet.lib"
  159. "%WINBUILDDIR%\src\lib\Libpbs\%BUILD_TYPE%\Libpbs.lib"
  160. "%WINBUILDDIR%\src\lib\Libsite\%BUILD_TYPE%\Libsite.lib"
  161. "%WINBUILDDIR%\src\lib\Libwin\%BUILD_TYPE%\Libwin.lib"
  162. "%BINARIESDIR%\libical%BINARIESDIR_TYPE%\bin\*.dll"
  163. ) do (
  164. 1>nul xcopy /Y /V /J "%%a" "%PBS_EXECDIR%\lib\"
  165. if not %ERRORLEVEL% == 0 (
  166. echo Failed to copy files from "%%a" to "%PBS_EXECDIR%\lib\"
  167. exit /b 1
  168. )
  169. )
  170. echo Copying necessory files for PBS_EXEC\unsupported
  171. for %%a in (
  172. "%WINBUILDDIR%\src\unsupported\%BUILD_TYPE%\*.exe"
  173. "%PBS_SRCDIR%\src\unsupported\README"
  174. "%PBS_SRCDIR%\src\unsupported\*.pl"
  175. "%PBS_SRCDIR%\src\unsupported\*.py*"
  176. ) do (
  177. 1>nul xcopy /Y /V /J "%%a" "%PBS_EXECDIR%\unsupported\"
  178. if not %ERRORLEVEL% == 0 (
  179. echo Failed to copy files from "%%a" to "%PBS_EXECDIR%\unsupported\"
  180. exit /b 1
  181. )
  182. )
  183. echo Copying necessory files for PBS_EXEC\pgsql
  184. 1>nul xcopy /Y /V /J /S "%BINARIESDIR%\pgsql%BINARIESDIR_TYPE%" "%PBS_EXECDIR%\pgsql\"
  185. if not %ERRORLEVEL% == 0 (
  186. echo Failed to copy files from "%BINARIESDIR%\pgsql%BINARIESDIR_TYPE%" to "%PBS_EXECDIR%\pgsql\"
  187. exit /b 1
  188. )
  189. echo Copying necessory files for PBS_EXEC\python
  190. 1>nul xcopy /Y /V /J /S "%BINARIESDIR%\python" "%PBS_EXECDIR%\python\"
  191. if not %ERRORLEVEL% == 0 (
  192. echo Failed to copy files from "%BINARIESDIR%\python" to "%PBS_EXECDIR%\python\"
  193. exit /b 1
  194. )
  195. if "%BUILD_TYPE%"=="Debug" (
  196. 1>nul copy /B /Y "%BINARIESDIR%\python_debug\PC\VS9.0\python27_d.dll" "%PBS_EXECDIR%\python\"
  197. 1>nul copy /B /Y "%BINARIESDIR%\python_debug\PC\VS9.0\python27_d.pdb" "%PBS_EXECDIR%\python\"
  198. )
  199. echo Copying necessory files for PBS_EXEC\python_x64
  200. 1>nul xcopy /Y /V /J /S "%BINARIESDIR%\python_x64" "%PBS_EXECDIR%\python_x64\"
  201. if not %ERRORLEVEL% == 0 (
  202. echo Failed to copy files from "%BINARIESDIR%\python_x64" to "%PBS_EXECDIR%\python_x64\"
  203. exit /b 1
  204. )
  205. exit /b 0