0023909: FPE in BSplSLib::RationalDerivative
[occt.git] / src / DrawResources / BuildWorkbench.tcl
1 # Copyright (c) 1999-2012 OPEN CASCADE SAS
2 #
3 # The content of this file is subject to the Open CASCADE Technology Public
4 # License Version 6.5 (the "License"). You may not use the content of this file
5 # except in compliance with the License. Please obtain a copy of the License
6 # at http://www.opencascade.org and read it completely before using this file.
7 #
8 # The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 # main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10 #
11 # The Original Code and all software distributed under the License is
12 # distributed on an "AS IS" basis, without warranty of any kind, and the
13 # Initial Developer hereby disclaims all such warranties, including without
14 # limitation, any warranties of merchantability, fitness for a particular
15 # purpose or non-infringement. Please see the License for the specific terms
16 # and conditions governing the rights and limitations under the License.
17
18 #
19 #
20 #  procedures pour automatiser la fabrication de gti
21 #
22 #
23 puts " *****  loading  build_list   ***** "
24 ###############################################################################
25 #
26 #
27 proc build_list { factory ilot workbench  exelist toolkitlist   packagelist } {
28 #
29 #
30 ###############################################################################
31 # fabrique la liste des executables, toolkits et packages
32 # pour un workbench donne
33 #
34
35     upvar $exelist      EXECUTABLE_LIST
36     upvar $toolkitlist  TOOLKIT_LIST
37     upvar $packagelist  PACKAGE_LIST
38     wokcd [concat $factory:$ilot:$workbench]
39     wokprofile -d
40     set UD_LIST [ w_info -l ]
41     set PACKAGE_LIST ""
42     set EXECUTABLE_LIST ""
43     set TOOLKIT_LIST ""
44     for { set i 0 } { $i <= [expr [ llength $UD_LIST ] - 1 ]} { incr i } {
45         set p [lindex $UD_LIST $i]
46         set typ [ uinfo -t $p ]
47         if { $typ == "executable" } {
48             lappend EXECUTABLE_LIST $p
49         } elseif { $typ == "toolkit" } {
50             lappend TOOLKIT_LIST $p
51         } elseif { $typ == "package" || $typ == "nocdlpack" } {
52             lappend PACKAGE_LIST $p
53         }
54     }
55 }
56 puts " *****  loading   extract_from_cdl ***** "
57 ###############################################################################
58 #
59 #
60 proc extract_from_cdl { factory ilot workbench } {
61 #
62 #
63 ###############################################################################
64     build_list $factory $ilot $workbench  TYPE_OF_PACKAGE_LIST(1) TYPE_OF_PACKAGE_LIST(2) TYPE_OF_PACKAGE_LIST(3) 
65     puts " *********** Extraction commencing at "
66     puts "[exec date]"
67     for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST(3) ] - 1 ]} { incr i } {
68             set PACKAGE [lindex $TYPE_OF_PACKAGE_LIST(3) $i]
69             wokcd $PACKAGE
70             set LOCAL_UD [ wokcd ] 
71
72             
73             set ERROR_FILE [ wokinfo -p admfile:cdlcompile.log $LOCAL_UD ] 
74             set ERROR_DIRECTORY [ file dirname $ERROR_FILE ] 
75             puts " $ERROR_FILE "
76 #
77 #  attention : verifier que la directory existe 
78 #
79             if { [ file isdirectory  $ERROR_DIRECTORY ] } {
80                 set FILE_DESCRIPTOR [ open $ERROR_FILE w ] 
81 #
82 #   on initialise avec un chaine null le fichier
83 #
84                 puts $FILE_DESCRIPTOR ""
85 #
86 #   on redirige les erreurs avec un dispatcheur
87 #
88                 msgsetcmd dispatch_compile_message $FILE_DESCRIPTOR
89             }
90             catch { umake -fe obj.inc } 
91 #           puts "umake -fe obj.inc"
92             if { [ file isdirectory  $ERROR_DIRECTORY ] } {
93                 close $FILE_DESCRIPTOR
94                 msgunsetcmd
95             }
96         
97     }
98     puts " ********** Extraction ending at " 
99     puts " [exec date]"
100     msclear
101 }
102 puts " *****  loading  force_build_only_obj *****  "
103 ###############################################################################
104 #
105 #
106 proc force_build_only_obj { factory ilot workbench } {
107 #
108 #
109 ###############################################################################
110     build_list $factory $ilot $workbench  TYPE_OF_PACKAGE_LIST(1) TYPE_OF_PACKAGE_LIST(2) TYPE_OF_PACKAGE_LIST(3) 
111     puts " *********   Obj commencing at "
112     puts " [ exec date ] "
113     for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST(3) ] - 1 ]} { incr i } {
114         set p [lindex $TYPE_OF_PACKAGE_LIST(3) $i]
115         wokcd $p
116         set LOCAL_UD [ wokcd ] 
117         set ERROR_FILE [ wokinfo -p stadmfile:objcompile.log $LOCAL_UD ]
118         set ERROR_DIRECTORY [ file dirname $ERROR_FILE ] 
119         puts " $ERROR_FILE "
120 #
121 #  attention : verifier que la directory existe 
122 #
123         if { [ file isdirectory  $ERROR_DIRECTORY ] } {
124                 set FILE_DESCRIPTOR [ open $ERROR_FILE w ] 
125 #
126 #   on initialise avec un chaine null le fichier
127 #
128                 puts $FILE_DESCRIPTOR ""
129 #
130 #   on redirige les erreurs avec un dispatcheur
131 #
132                 msgsetcmd dispatch_compile_message $FILE_DESCRIPTOR
133             } 
134         catch { umake -of obj } 
135 #       puts " umake -o obj  $p "
136         if { [ file isdirectory  $ERROR_DIRECTORY ] } {
137                 close $FILE_DESCRIPTOR
138                 msgunsetcmd 
139         }
140
141         
142     }
143     for { set j 1 } { $j <= 2 } { incr j } {
144         for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST($j) ] - 1 ]} { incr i } {
145             set p [lindex $TYPE_OF_PACKAGE_LIST($j) $i]
146             wokcd $p
147             set LOCAL_UD [ wokcd ] 
148             set ERROR_FILE [ wokinfo -p stadmfile:objcompile.log $LOCAL_UD ]
149             set ERROR_DIRECTORY [ file dirname $ERROR_FILE ] 
150             puts " $ERROR_FILE "
151 #
152 #  attention : verifier que la directory existe 
153 #
154             if { [ file isdirectory  $ERROR_DIRECTORY ] } {
155                 set FILE_DESCRIPTOR [ open $ERROR_FILE w ] 
156 #
157 #   on initialise avec un chaine null le fichier
158 #
159                 puts $FILE_DESCRIPTOR ""
160 #
161 #   on redirige les erreurs avec un dispatcheur
162 #
163                 msgsetcmd dispatch_compile_message $FILE_DESCRIPTOR
164             } 
165             
166             catch { umake -f  } 
167 #           puts " umake $p "
168             if { [ file isdirectory  $ERROR_DIRECTORY ] } {
169                 close $FILE_DESCRIPTOR
170                 msgunsetcmd 
171             }
172         }
173     }
174
175     puts " *********   Obj ending at "
176     puts " [ exec date ] " 
177     msclear
178 }
179 puts " *****  loading  build_only_obj ****** "
180 ###############################################################################
181 #
182 #
183 proc build_only_obj { factory ilot workbench } {
184 #
185 #
186 ###############################################################################
187
188     build_list $factory $ilot $workbench  TYPE_OF_PACKAGE_LIST(1) TYPE_OF_PACKAGE_LIST(2) TYPE_OF_PACKAGE_LIST(3) 
189     puts " *********   Obj commencing at "
190     puts " [ exec date ] "
191     for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST(3) ] - 1 ]} { incr i } {
192         set p [lindex $TYPE_OF_PACKAGE_LIST(3) $i]
193         wokcd $p
194         set LOCAL_UD [ wokcd ] 
195         set ERROR_FILE [ wokinfo -p stadmfile:objcompile.log $LOCAL_UD ]
196         set ERROR_DIRECTORY [ file dirname $ERROR_FILE ] 
197         puts " $ERROR_FILE "
198 #
199 #  attention : verifier que la directory existe 
200 #
201         if { [ file isdirectory  $ERROR_DIRECTORY ] } {
202                 set FILE_DESCRIPTOR [ open $ERROR_FILE w ] 
203 #
204 #   on initialise avec un chaine null le fichier
205 #
206                 puts $FILE_DESCRIPTOR ""
207 #
208 #   on redirige les erreurs avec un dispatcheur
209 #
210                 msgsetcmd dispatch_compile_message $FILE_DESCRIPTOR
211             } 
212         catch { umake -o obj } 
213 #       puts " umake -o obj  $p "
214         if { [ file isdirectory  $ERROR_DIRECTORY ] } {
215                 close $FILE_DESCRIPTOR
216                 msgunsetcmd 
217         }
218
219         
220     }
221     for { set j 1 } { $j <= 2 } { incr j } {
222         for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST($j) ] - 1 ]} { incr i } {
223             set p [lindex $TYPE_OF_PACKAGE_LIST($j) $i]
224             wokcd $p
225             set LOCAL_UD [ wokcd ] 
226             set ERROR_FILE [ wokinfo -p stadmfile:objcompile.log $LOCAL_UD ]
227             set ERROR_DIRECTORY [ file dirname $ERROR_FILE ] 
228             puts " $ERROR_FILE "
229 #
230 #  attention : verifier que la directory existe 
231 #
232             if { [ file isdirectory  $ERROR_DIRECTORY ] } {
233                 set FILE_DESCRIPTOR [ open $ERROR_FILE w ] 
234 #
235 #   on initialise avec un chaine null le fichier
236 #
237                 puts $FILE_DESCRIPTOR ""
238 #
239 #   on redirige les erreurs avec un dispatcheur
240 #
241                 msgsetcmd dispatch_compile_message $FILE_DESCRIPTOR
242             } 
243             
244             catch { umake  } 
245 #           puts " umake $p "
246             if { [ file isdirectory  $ERROR_DIRECTORY ] } {
247                 close $FILE_DESCRIPTOR
248                 msgunsetcmd 
249             }
250         }
251     }
252
253     puts " *********   Obj ending at "
254     puts " [ exec date ] " 
255     msclear
256 }
257 ###############################################################################
258 #
259 #
260 proc dispatch_compile_message { code message file } {
261 #
262 #
263 ###############################################################################
264     puts " $message "
265     if { $code == "E" } {
266             puts $file " $message "
267      } 
268 #
269 #  E les erreurs
270 #       
271 #
272 #  V verbose 
273 #
274 #
275 #  I les infos
276 #
277 #
278 #  W les warnings
279 #
280     
281      
282 }
283 puts " *****  loading  build_obj_log *****  "
284 ###############################################################################
285 #
286 #
287 proc build_obj_log { factory ilot workbench } {
288 #
289 #
290 ###############################################################################
291     puts " Erreurs dans les compiles obj :"
292     build_list $factory $ilot $workbench  TYPE_OF_PACKAGE_LIST(1) TYPE_OF_PACKAGE_LIST(2) TYPE_OF_PACKAGE_LIST(3) 
293     for { set j 2 } { $j <= 3 } { incr j } {
294         for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST($j) ] - 1 ]} { incr i } {
295             set p [lindex $TYPE_OF_PACKAGE_LIST($j) $i]
296             wokcd $p
297             set LOCAL_UD [ wokcd ] 
298             set ERROR_FILE [ wokinfo -p stadmfile:objcompile.log $LOCAL_UD ] 
299             if { [ file exists $ERROR_FILE ] } {
300                 set FILE_DESCRIPTOR [ open $ERROR_FILE r ]
301                 set ERROR_HAPPENED 0 
302                 while { [ gets $FILE_DESCRIPTOR LINE ] >= 0 && $ERROR_HAPPENED == 0  } {
303                     if { [ regexp Error $LINE ] } {
304                         puts "$LOCAL_UD"
305                         set ERROR_HAPPENED 1
306                     }
307                 }
308                 close $FILE_DESCRIPTOR
309             }
310         }
311     }
312 }
313 puts " *****  loading   build_cdl_log ******  "
314 ###############################################################################
315 #
316 #
317 proc build_cdl_log { factory ilot workbench } {
318 #
319 #
320 ###############################################################################
321     puts "Erreurs dans les compiles cdl :"
322     build_list $factory $ilot $workbench  TYPE_OF_PACKAGE_LIST(1) TYPE_OF_PACKAGE_LIST(2) TYPE_OF_PACKAGE_LIST(3) 
323     for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST(3) ] - 1 ]} { incr i } {
324             set p [lindex $TYPE_OF_PACKAGE_LIST(3) $i]
325             wokcd $p
326             set LOCAL_UD [ wokcd ] 
327             set ERROR_FILE [ wokinfo -p admfile:cdlcompile.log $LOCAL_UD ] 
328             if { [ file exists $ERROR_FILE ] } {
329                 set FILE_DESCRIPTOR [ open $ERROR_FILE r ] 
330                 set ERROR_HAPPENED  0
331                 while { [ gets $FILE_DESCRIPTOR LINE ] >= 0 && $ERROR_HAPPENED == 0} {
332                     if { [ regexp Error $LINE ] } {
333                         puts "$LOCAL_UD "
334                         set ERROR_HAPPENED 1 
335                     }
336                 }
337                 close $FILE_DESCRIPTOR
338             }
339    }
340 }
341
342
343
344