readme.txt 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. This document explains how to build or rebuild REDUCE 3.7
  2. using the CSL Lisp system. A number of different possibilities
  3. arise depending on whether you have a C compiler available (and
  4. in some cases which one!) and how comprehensive a re-build is
  5. wanted. I will start with the simplest case.
  6. (0) Before you begin.
  7. If you are running on some version of Unix it may be that file-permissions
  8. were not set up when the REDUCE files moved to your machine. Select the
  9. "lisp/csl/util" dircetory as current and run the script "setexec"
  10. source setexec
  11. to correct this.
  12. (1) Recompilation of all of REDUCE after some source files have
  13. changed.
  14. Make the directory containing the REDUCE executable (r37.exe or r37)
  15. your current directory. This directory will have a path-name that
  16. ends up ".../lisp/csl/<machine>" where the final component refers
  17. to the type of computer you are using. Examples are "win32" or "linux".
  18. In all the file-names that I quote here I will use "/" as the directory
  19. separator, however on Windows systems you will need to use "\" instead.
  20. Optionally make a copy of the existing r37.img and then delete the
  21. existing file of that name. The merits of making a backup copy of the
  22. image file should be obvious. Deleting r37.img before running the
  23. build job will reduce your peak demands on disc space. Run the script:
  24. ../util/full37
  25. Note that on a 400 MHz Pentium II system this runs for around 3 minutes.
  26. All future timings I quote will be in terms of this reference configuration.
  27. On slower or faster machines it will take different amounts of time of
  28. course. A log of what has happened will be placed in log/full37.log. The
  29. most you are really likely to want to do with this is to scan it to verify
  30. that it ends up saying something like
  31. +++ untrrl compiled, 56 + 36 bytes
  32. +++ untrrlid compiled, 44 + 28 bytes
  33. +++ FASLEND: hits = 372, misses = 144
  34. Fast-loading "E:\r37\lisp\csl\win32\R37.IMG(rtrace)"
  35. The system is about to do a restart...
  36. Dump file created: Sat Jan 23 16:31:35 1999
  37. REDUCE 3.7, 15-Jan-99 ...
  38. Memory allocation: 10213632 bytes
  39. Fast-loading "E:\r37\lisp\csl\win32\R37.IMG(user)"
  40. End of Lisp run after 142.15+10.14 seconds
  41. and that it does not contain the string "Error".
  42. You should now check the resulting system, either by trying your own
  43. code on it, or by running and then checking all the standard test cases.
  44. To run a full set of tests just run
  45. ../util/testall
  46. but be aware that this runs for around half an hour. This is because REDUCE
  47. has a substantial number of test files that check and illustrate all of its
  48. capabilities. Running "testall" leaves a set of new log files close to the
  49. top-level in the REDUCE tree. From where your current directory they are in
  50. "../../../log/*.rlg". If especially interested in just a few of them you
  51. can check them by hand, but a further script
  52. ../util/checkall [not yet provided]
  53. compares all these logs against a reference set and produces summary
  54. information in "log/checkall.log". This file is intended to be short enough
  55. to be worth reading. Note that a major reason for rebuilding REDUCE will
  56. be to incorporate some corrections or enhancements and it is very probable
  57. that these will cause some logs to change from the original reference set.
  58. Thus discrepancies reported in log/checkall.log do not necessarily indicate
  59. problems!
  60. If you go
  61. ../util/testall XXX
  62. where XXX is the name of a REDUCE package (eg "alg") then this will run
  63. the test script for (just) that module.
  64. (2) Rebuild everything from source.
  65. At the other extreme you may wish to re-create everything from source,
  66. including re-building the underlying Lisp system. The steps are as follows.
  67. (2.a) Create an empty directory ".../lisp/csl/<machine>" named suitably
  68. for your environment. Select it as your current directory.
  69. (2.b) If there is a suitable Makefile in ../util then copy it or link it
  70. into the current directory: eg
  71. copy ..\util\Makefile.w32 Makefile [Windows, Watcom C]
  72. or ln -s ../util/Makefile.linux Makefile [Linux]
  73. If no pre-build Makefile is available then you may be able to create
  74. one using the "makemake" program in the util directory: read the comments
  75. and explanation in it and the "makebase" file, but it will probably
  76. be easiest for you to copy a generic Unix Makefile and edit it by hand to suit
  77. your needs. The Makefile is intended to be conservative and does little more
  78. than explain which C files to compile and link. If you have a C compiler
  79. but it does not use textual Makefiles then inspect the link steps
  80. in the provided ones to see which source files need to be compiled.
  81. Note that the directory may contain a "Makefile.cyg" for use with the Cygnus
  82. compilers for Windows. Observe from the Cygnus FAQ
  83. In particular, if you intend to port a commercial (non-GPL'd)
  84. application using Cygwin, you will need the commercial license to Cygwin
  85. that comes with the supported native Win32 GNUPro product. The price
  86. for five users is $7495, which includes the GNUPro Toolkit, Mission
  87. Critical Support for one year, and a commercially licensed version of
  88. the Cygwin library. For more information about the commercial-use
  89. license, please contact info@cygnus.com. All other questions should be
  90. sent to the project mailing list gnu-win32@cygnus.com.
  91. and Codemist will neither distribute binaries compiled using this
  92. system nor provide guaranteed support for those who decide that re-compiling
  93. REDUCE using this compiler is a good idea.
  94. (2.c) Build slowr37 (slowr37.exe on Windows)
  95. make slowr37 [Unix]
  96. make slowr37.exe [Windows]
  97. This is a basic version of the CSL Lisp system and at this stage is only
  98. useful for building the bootstrap version of REDUCE.
  99. (2.d) Create a bootstrap version of REDUCE. The image file for this will
  100. be around 8 Mbytes large, and the system will run much more slowly than the
  101. final and proper version of REDUCE. However it should be able to run all
  102. REDUCE tests properly.
  103. ../util/boot37
  104. where a log is left on log/boot37.log. This step takes around 3 minutes.
  105. (2.e) Optionally run ../util/testslow, expecting it to run for around
  106. an hour. Logs are left where test logs for the final system will be, so
  107. ../util/checkall can be used to verify that all is under control, although
  108. most of the time you will not want to spend time of this verification step.
  109. (2.f) If you are starting completely from scratch it is necessary to
  110. collect profile information which is used to determine which parts of
  111. REDUCE should be most carefully optimised. If you already have a file
  112. "../csl-c/profile.dat" you may omit this step, but after significant changes
  113. or as a demonstration of a complete fresh start it may be useful. Run
  114. ../util/profile
  115. and wait around an hour for it to create a file "profile.dat" in the current
  116. directory. This file lists the modules tested and for each gives an
  117. ordered list of functions, each accompanied by a long string of digits that
  118. are a digital signature for the version of the function that was involved.
  119. Copy profile.dat as ../csl-c/profile.dat (optionally backing up your
  120. original copy) and delete it from the current directory.
  121. (2.g) Run the script
  122. ../util/c-code37
  123. which uses ../csl-c/profile.dat and the bootstrap image to create twelve
  124. files of C code (../csl-c/u01.c to ../csl-c/u12.c) and twelve corresponding
  125. Lisp files (same file-names but with ".lsp" as their suffix). These files
  126. represent optimised versions of the most important parts of REDUCE.
  127. (2.h) Create the main REDUCE executable (r37 or r37.exe)
  128. make r37 [Unix]
  129. make r37.exe [Windows]
  130. and just to be safe please delete r37.img, since the image file depends on
  131. the set of things created in step (2.g) above and so is probably now
  132. out of date. WARNING: running a reduce executable with an image file
  133. that it does not correspond to can lead to unpredictable failure, so although
  134. image files are portable from one machine architecture to another they
  135. must be used with a REDUCE executable that was built with the same set of
  136. file u01.c through u12.c.
  137. [Can I generate a scheme that will allow me to soften this warning, or will
  138. at least check for compatibility when the system is loaded?]
  139. (2.i) Make the final image file. This is exactly the step described as
  140. the simple case:
  141. ../util/full37
  142. (2.j) Test the new system as documented towards the top of this document.
  143.