slowr36.lsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %
  3. % csl -z -o slowr36.img build36.lsp -l build1.log
  4. %
  5. % where this job rebuilds a bootstrap REDUCE etc etc from scratch
  6. %
  7. %
  8. % Build a CSL REDUCE "in core" as first stage of a bootstrap. To be
  9. % run starting from a cold-start CSL, i.e. with the -z option.
  10. %
  11. % This file first builds REDUCE, it then makes a set of FASL modules
  12. % for auto-loadable parts of the system, compiles a load of Lisp into
  13. % C and processes the Lisp interface code generated in the process.
  14. %
  15. % Here I build modules for all the things that will be included in the
  16. % demonstration version of REDUCE, and all the parts of the code that
  17. % will be subject to compilation into C.
  18. %
  19. % Author: Anthony C. Hearn.
  20. % Modifications by Stanley L. Kameny and Arthur Norman
  21. (verbos 3)
  22. (rdf "$cslbase/compat.lsp")
  23. (rdf "../cslsrc/fastgets.lsp")
  24. (rdf "$cslbase/extras.lsp")
  25. (fluid '(!*ord))
  26. (setq !*ord t)
  27. (rdf "$cslbase/compiler.lsp")
  28. (compile '(
  29. s!:improve s!:literal_order s!:comval s!:outopcode0
  30. s!:plant_basic_block s!:remlose s!:islocal
  31. s!:is_lose_and_exit s!:comatom s!:destination_label
  32. s!:record_literal s!:resolve_labels s!:expand_jump
  33. s!:outopcode1lit stable!-sortip s!:iseasy s!:outjump
  34. s!:add_pending s!:comcall s!:resolve_literals))
  35. (compile!-all)
  36. % Build fasl files for the compatibility code and the two
  37. % versions of the compiler.
  38. (faslout 'compat)
  39. (rdf "$cslbase/compat.lsp")
  40. (rdf "../cslsrc/fastgets.lsp")
  41. (rdf "$cslbase/extras.lsp")
  42. (faslend)
  43. (faslout 'compiler)
  44. (rdf "$cslbase/compiler.lsp")
  45. (faslend)
  46. (faslout 'ccomp)
  47. (rdf "$cslbase/ccomp.lsp")
  48. (faslend)
  49. (setq !*nocompile nil)
  50. (cond ((not !*nocompile) (setq !*comp t)))
  51. % The curious arrangement of rds and oldchan!* is because the
  52. % source file ../src/boot.sl ends by doing an (rds oldchan!*), which
  53. % avoids it hitting the end of file, and probably fits PSL very well.
  54. % If that line were not there I could just go (rdf "../src/boot.sl")
  55. % and that would cope with the file closing as well.
  56. (rds (setq oldchan!* (rds nil)))
  57. (rds (setq xxx (open "../src/boot.sl" 'input)))
  58. (close xxx)
  59. (begin2)
  60. % "cslprolo.red" can contain things that are system dependent
  61. % but which HAVE to be loaded before "rlisp.red" is.
  62. rds(xxx := open("../src/cslprolo.red",'input));
  63. (close xxx)
  64. (begin2)
  65. rds(xxx := open("../src/module.red",'input));
  66. (close xxx)
  67. (begin2)
  68. rds(xxx := open("../src/rlisp.red",'input));
  69. (close xxx)
  70. (begin2)
  71. % "cslrend.red" contains CSL specific definitions of a few functions
  72. % required by Reduce, and can flag things as 'lose where that will help
  73. % performance by allowing versions of functions built into the CSL kernel
  74. % to remain active.
  75. rds(xxx := open("../src/cslrend.red",'input));
  76. (close xxx)
  77. (begin)
  78. % Now I have RLISP built I can dispense with all the fooling about with
  79. % rds and open, and just read files in using the regular (in "xxx.red")
  80. % syntax. I build all the parts of REDUCE that are expected to be
  81. % resident.
  82. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  83. % HORRIBLE WARNING:
  84. % The system build in-store here will NOT have patches applied to it.
  85. % The fasl files written out WILL be subject to patching, but
  86. % if building the first few modules correctly depends on running
  87. % with a patched version then you are in trouble.
  88. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  89. on backtrace;
  90. % The bad news is that module "poly.red" uses some of these, but they
  91. % are defined in "alg.red". But if I try to load "alg.red" first I run
  92. % into trouble with the operators ".+" etc...
  93. symbolic smacro procedure iequal(u,v); eqn(u,v);
  94. newtok '((!#) hash);
  95. newtok '((!# !+) iplus2);
  96. newtok '((!# !-) idifference);
  97. newtok '((!# !*) itimes2);
  98. newtok '((!# !/) iquotient);
  99. newtok '((!# !>) igreaterp);
  100. newtok '((!# !<) ilessp);
  101. newtok '((!# !=) iequal);
  102. infix #+,#-,#*,#/,#>,#<,#=;
  103. precedence #+,+;
  104. precedence #-,-;
  105. precedence #*,*;
  106. precedence #/,/;
  107. precedence #>,>;
  108. precedence #<,<;
  109. precedence #=,=;
  110. deflist('((idifference iminus)),'unary);
  111. deflist('((iminus iminus)),'unary);
  112. deflist('((iminus iplus2)), 'alt);
  113. in "../src/poly.red"$
  114. in "../src/alg.red"$
  115. in "../src/arith.red"$
  116. in "../src/mathpr.red"$
  117. on savedef; % Now I start on the FASL files - I want saved defs in them all
  118. % since the saved definitions will be used when speed-critical
  119. % parts of the system are to be compiled into C.
  120. faslout 'cslprolo;
  121. in "../src/cslprolo.red"$
  122. faslend;
  123. faslout 'module;
  124. in "../src/module.red"$
  125. module 'cslpatch;
  126. % Support for patching REDUCE 3.6 sources.....
  127. % This adjusted version is needed if patching is to work properly with
  128. % CSL. The only changes are two replacements for calls to gensym().
  129. symbolic procedure patchstat;
  130. % Read a patch for a given package.
  131. begin scalar !*mode,u,v,x,y,z,z2;
  132. x := scan(); % Package name.
  133. scan(); % Remove semicolon.
  134. a: !*mode := 'symbolic;
  135. y := xread nil;
  136. if eqcar(y,'symbolic) then y := cadr y
  137. else if flagpcar(y,'modefn)
  138. then progn(!*mode := car y, y := cadr y);
  139. if eq(y,'endpatch)
  140. then progn(u := dated!-name x,
  141. z2 := list('de,u,nil,'progn . reversip z) . z2,
  142. z2 := list('put,mkquote x,mkquote 'patchfn,mkquote u)
  143. . z2,
  144. return ('patch . reversip z2))
  145. else if eqcar(y,'procedure)
  146. then progn(v := cadr y,
  147. u := hashtagged!-name(v, y),
  148. z := list('copyd,mkquote v,mkquote u) . z,
  149. z2 := convertmode(('procedure . u . cddr y),nil,
  150. 'symbolic,!*mode)
  151. . z2)
  152. else z := convertmode(y,nil,'symbolic,!*mode) . z;
  153. go to a;
  154. end;
  155. put('patch,'stat,'patchstat);
  156. endmodule;
  157. faslend;
  158. load!-module 'module; % Patched version MUST be loaded before patches.red
  159. faslout 'patches;
  160. in "../src/patches.red"$
  161. faslend;
  162. % Note that even though I have now read in the patches, they do not get
  163. % applied unless a module is loaded using "load_package". Thus the
  164. % patches are not yet in effect.
  165. faslout 'rlisp;
  166. in "../src/rlisp.red"$
  167. faslend;
  168. faslout 'cslrend;
  169. in "../src/cslrend.red"$
  170. faslend;
  171. faslout 'alg;
  172. in "../src/alg.red"$
  173. faslend;
  174. faslout 'poly;
  175. in "../src/poly.red"$
  176. faslend;
  177. faslout 'mathpr;
  178. in "../src/mathpr.red"$
  179. faslend;
  180. faslout 'arith;
  181. in "../src/arith.red"$
  182. faslend;
  183. faslout 'entry;
  184. in "../src/entry.red"$
  185. faslend;
  186. lisp restart!-csl nil;
  187. (setq !*savedef nil)
  188. (load!-module 'compat)
  189. (load!-module 'cslprolo)
  190. (load!-module 'module)
  191. (load!-module 'patches)
  192. (setq loaded!-packages!* '(compat cslprolo module patches))
  193. (load!-package 'rlisp)
  194. (load!-package 'cslrend)
  195. (load!-package 'poly)
  196. (load!-package 'alg)
  197. (load!-package 'arith)
  198. (load!-package 'mathpr)
  199. (setq !*comp nil)
  200. (load!-package 'entry)
  201. (setq !*nocompile nil)
  202. (setq !*comp (not !*nocompile))
  203. (begin)
  204. symbolic;
  205. << initreduce();
  206. date!* := "Bootstrap version";
  207. % I call mapstore() here to reset all counts to zero,
  208. % thereby making future statistics at least marginally meaningful!
  209. mapstore 4;
  210. !*savedef := nil;
  211. checkpoint('begin, "Bootstrap REDUCE 3.6...") >>;
  212. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  213. % I build each module (from now on) with a cleanly-restarted version of
  214. % REDUCE so that if the module sets flags or changes syntax etc etc that
  215. % can not cause trouble for further system-building. This seems an ugly
  216. % state of affairs but is essential at present. An effect will be that
  217. % patches get applied when the modules are loaded, so from now on the
  218. % modules built should be safe.
  219. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  220. symbolic; on savedef;
  221. faslout 'fmprint;
  222. in "../cslsrc/fmprint.red"$
  223. faslend;
  224. lisp restart!-csl t;
  225. symbolic; on savedef;
  226. faslout 'matrix;
  227. in "../src/matrix.red"$
  228. faslend;
  229. lisp restart!-csl t;
  230. symbolic; on savedef;
  231. faslout 'hephys;
  232. in "../src/hephys.red"$
  233. faslend;
  234. lisp restart!-csl t;
  235. symbolic; on savedef;
  236. faslout 'arnum;
  237. in "../src/arnum.red"$
  238. faslend;
  239. lisp restart!-csl t;
  240. symbolic; on savedef;
  241. faslout 'cedit;
  242. in "../src/cedit.red"$
  243. faslend;
  244. lisp restart!-csl t;
  245. symbolic; on savedef;
  246. faslout 'compact;
  247. in "../src/compact.red"$
  248. faslend;
  249. lisp restart!-csl t;
  250. symbolic; on savedef;
  251. faslout 'excalc;
  252. in "../src/excalc.red"$
  253. faslend;
  254. lisp restart!-csl t;
  255. symbolic; on savedef;
  256. faslout 'ezgcd;
  257. in "../src/ezgcd.red"$
  258. faslend;
  259. lisp restart!-csl t;
  260. symbolic; on savedef;
  261. faslout 'factor;
  262. in "../src/factor.red"$
  263. faslend;
  264. lisp restart!-csl t;
  265. symbolic; on savedef;
  266. faslout 'gentran;
  267. in "../src/gentran.red"$
  268. faslend;
  269. lisp restart!-csl t;
  270. symbolic; on savedef;
  271. faslout 'dipoly;
  272. in "../src/dipoly.red"$
  273. faslend;
  274. lisp restart!-csl t;
  275. symbolic; on savedef;
  276. faslout 'groebner;
  277. in "../src/groebner.red"$
  278. faslend;
  279. lisp restart!-csl t;
  280. symbolic; on savedef;
  281. faslout 'groebnr2;
  282. in "../src/groebnr2.red"$
  283. faslend;
  284. lisp restart!-csl t;
  285. symbolic; on savedef;
  286. faslout 'int;
  287. in "../src/int.red"$
  288. faslend;
  289. lisp restart!-csl t;
  290. symbolic; on savedef;
  291. faslout 'algint;
  292. in "../src/algint.red"$
  293. faslend;
  294. lisp restart!-csl t;
  295. symbolic; on savedef;
  296. faslout 'pretty;
  297. in "../src/pretty.red"$
  298. faslend;
  299. lisp restart!-csl t;
  300. symbolic; on savedef;
  301. faslout 'rcref;
  302. in "../src/rcref.red"$
  303. faslend;
  304. lisp restart!-csl t;
  305. symbolic; on savedef;
  306. faslout 'numeric;
  307. in "../src/numeric.red"$
  308. faslend;
  309. lisp restart!-csl t;
  310. symbolic; on savedef;
  311. faslout 'roots;
  312. in "../src/roots.red"$
  313. faslend;
  314. faslout 'roots2;
  315. in "../src/roots2.red"$
  316. faslend;
  317. lisp restart!-csl t;
  318. symbolic; on savedef;
  319. faslout 'rprint;
  320. in "../src/rprint.red"$
  321. faslend;
  322. lisp restart!-csl t;
  323. symbolic; on savedef;
  324. faslout 'scope;
  325. in "../src/scope.red"$
  326. faslend;
  327. lisp restart!-csl t;
  328. symbolic; on savedef;
  329. faslout 'solve;
  330. in "../src/solve.red"$
  331. faslend;
  332. lisp restart!-csl t;
  333. symbolic; on savedef;
  334. faslout 'spde;
  335. in "../src/spde.red"$
  336. faslend;
  337. lisp restart!-csl t;
  338. symbolic; on savedef;
  339. faslout 'taylor;
  340. in "../src/taylor.red"$
  341. faslend;
  342. lisp restart!-csl t;
  343. symbolic; on savedef;
  344. faslout 'tps;
  345. in "../src/tps.red"$
  346. faslend;
  347. lisp restart!-csl t;
  348. symbolic; on savedef;
  349. faslout 'misc;
  350. in "../src/misc.red"$
  351. faslend;
  352. lisp restart!-csl t;
  353. symbolic; on savedef;
  354. faslout 'odesolve;
  355. in "../src/odesolve.red"$
  356. faslend;
  357. lisp restart!-csl t;
  358. symbolic; on savedef;
  359. faslout 'avector;
  360. in "../src/avector.red"$
  361. faslend;
  362. lisp restart!-csl t;
  363. symbolic; on savedef;
  364. faslout 'rlisp88;
  365. in "../src/rlisp88.red"$
  366. faslend;
  367. lisp restart!-csl t;
  368. symbolic; on savedef;
  369. faslout 'orthovec;
  370. in "../src/orthovec.red"$
  371. faslend;
  372. lisp restart!-csl t;
  373. symbolic; on savedef;
  374. faslout 'ineq;
  375. in "../src/ineq.red"$
  376. faslend;
  377. faslout 'specfn;
  378. in "../src/specfn.red"$
  379. faslend;
  380. faslout 'specfn2;
  381. in "../src/specfn2.red"$
  382. faslend;
  383. faslout 'specfaux;
  384. in "../src/specfaux.red"$
  385. faslend;
  386. faslout 'specbess;
  387. in "../src/specbess.red"$
  388. faslend;
  389. quit;
  390. % end of slowr36.lsp