install.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. -*- Mode: Indented-text; -*-
  2. Here are some remarks to complement what's in the INSTALL file.
  3. -----
  4. Building packages
  5. The Makefile uses the DESTDIR variable to indicate where the installed
  6. files actually go. So, for example
  7. make DESTDIR=/usr/local/build/scheme48
  8. allows populating /usr/local/build/scheme48 with an installation of
  9. Scheme 48, regardless of where it goes when actually installed. Note
  10. that, if DESTDIR is not the same as the --prefix option specified with
  11. the 'configure' script, the Scheme 48 installation in $(DESTDIR) will
  12. not actually run from there---it needs to be moved to the prefix
  13. directory to work correctly, as several paths are compiled into the
  14. scheme48 script as well as scheme48.image.
  15. -----
  16. Customizing scheme48.image
  17. By default, the image consists of a core Scheme system (Revised^5
  18. Scheme plus a very minimal read-eval-print loop) together with a
  19. standard set of "options" (command processor, debugging commands,
  20. inspector, disassembler, generic arithmetic). The set of options is
  21. controlled by the definitions of USUAL-COMMANDS and USUAL-FEATURES in
  22. more-packages.scm. If you make the (open ...) clause empty, then
  23. "make scheme48.image" will create a Scheme system without any extras
  24. (such as error recovery), and the image will be smaller. The files
  25. are listed in approximate order of decreasing desirability; you'll
  26. probably want at least these:
  27. package-commands, build
  28. - necessary for the scheme48.image script to work
  29. debuginfo, disclosers
  30. - necessary if you want error messages to be at all helpful
  31. debugging
  32. - defines important debugging commands such as ,preview and ,trace
  33. After editing the definition of usual-features, simply
  34. make scheme48.image
  35. to rebuild the image.
  36. -----
  37. Deeper changes to the system -- for example, edits to most of the
  38. files in the rts/ directory -- will require using the static linker to
  39. make a new initial.image. Say
  40. make image
  41. to get the linker to build a new initial.image and initial.debug.
  42. scheme48.image will then be built from those. You need a working
  43. installation of Scheme 48 in your path for this to work. This
  44. installation should be Scheme 48 1.5 or later. If your installed
  45. Scheme 48 is version 1.4 or earlier, you can still build, but need to
  46. make a small change to the Makefile. Instructions are in the
  47. Makefile---look for "LINKER_WRITEBYTE".
  48. You might think that "make scheme48.image" ought to do this, but the
  49. circular dependency between scheme48.image and initial.image needs to
  50. be broken somewhere, or else make will (justifiably) barf. I chose to
  51. break the cycle by making scheme48.image not depend on initial.image,
  52. since this is most robust for installation purposes.
  53. -----
  54. Changes to the VM require compiling the Scheme code to C code using
  55. the PreScheme compiler. Use
  56. make i-know-what-i-am-doing
  57. to rebuild the C sources from the Scheme sources. (And you should
  58. know what you're doing when attempting this.) This requires a working
  59. installation of Scheme 48 in the path.
  60. -----
  61. Other generated files:
  62. filenames.make is "include"d by the Makefile, but is automatically
  63. generated from the module dependencies laid out in the various
  64. configuration files (*-packages.scm). If you edit any of these .scm
  65. files, you may want to do a "make filenames.make" before you do any
  66. further "make"s in order to update the depedencies. This step isn't
  67. necessary if you're using GNU make, because GNU make will make
  68. included files automatically.
  69. Various tables for handling Unicode are also automatically generated
  70. by the default make target. However, the generated files ship with
  71. the system, so you shouldn't need to do this unless you change the
  72. input files or the code generating them.
  73. -----
  74. Editor support
  75. We recommend interacting with the Scheme 48 command processor using
  76. the emacs/scheme interface written by Olin Shivers at CMU. Copies of
  77. the relevant .el files, together with a "cmuscheme48.el", are in the
  78. emacs/ subdirectory of the release. If you're an XEmacs user, note
  79. that cmuscheme48.el is part of the scheme XEmacs package, and is thus
  80. probably installed already.
  81. You will probably want to byte-compile the .el files to get .elc
  82. files. Use M-x byte-compile-file to do this.
  83. -----
  84. Performance
  85. If you don't have a C compiler that optimizes as well as gcc does,
  86. then performance may suffer. Take a look at the automatically
  87. generated code in scheme48vm.c to find out why. With a good register
  88. allocator, all those variables (including some of the virtual
  89. machine's virtual registers) get allocated to hardware registers, and
  90. it really flies. Without one, performance can be pretty bad.
  91. The configure script automatically sets the Makefile variable CFLAGS
  92. to -O2 -g if gcc is available, or to -O if it isn't. This can be
  93. overriden by specifying a different CFLAGS, e.g. "make CFLAGS=-g" for
  94. no optimization.
  95. Even if you do have a good compiler, you should be able to improve
  96. overall performance even more, maybe about 6-10%, by removing the
  97. range check from the interpreter's instruction dispatch. To do this,
  98. use the -S flag to get assembly code for scheme48vm.c, then find the
  99. instructions in scheme48vm.s corresponding to the big dispatch in
  100. restart():
  101. L19173: {
  102. code_pointer_83X = arg1K0;
  103. switch ((*((unsigned char *) code_pointer_83X))) {
  104. ... }
  105. There will be one or two comparison instructions to see whether the
  106. opcode is in range; just remove them. For the 68000 I use a "sed"
  107. script
  108. /cmpl #137,d0/ N
  109. /cmpl #137,d0\n jhi L/ d
  110. but of course the constant will probably have to change when a new
  111. release comes along.
  112. See the user's guide for information on the ,bench command, which
  113. makes programs run faster.