BUILDING 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. Building Reduce from source
  2. (1) Very basic software expectations.
  3. Just to fetch reduce you need to have a copy of "subversion" installed and
  4. the ability to run from a unix-like console. I strongly recommend that you
  5. run under the "bash" shell or something fairly compatible with that.
  6. On Linux you MAY need to open a terminal and go "sudo apr-get subversion".
  7. On Windows you should install cygwin from www.cygwin.com (please fetch and
  8. use the 64-bit variant) and when you run their setup utility you should
  9. use their search-box to find "subversion" and select it for installation.
  10. On a Macintosh visit www.macports.org and follow the instructions there to
  11. install that - you can then go "sudo port install subversion". You will need
  12. to fetch Xcode from Apple, install it and activate the command-line
  13. utilities along the way, and while you are about it you might as well fetch
  14. and install the XQuartz version of the X windows system (www.xquartz.org).
  15. The main Reduce supporters do not make provision for building Reduce using
  16. the Microsoft compilers and VIsual Studio on Windows, or using software
  17. and libraries on the Macintosh other than Xcode+Macports on the Macintosh, so
  18. use of eg homebrew is something we have not investigated at all. It may not
  19. be impossible to use alternatives to the setup described here, but you will
  20. be basically on your own!
  21. Other Unix-style platforms should be easy to adapt for, but we do not have
  22. scripts to help you install all the necessary support software.
  23. (2) Fetching Reduce.
  24. The first time you want to fetch REDUCE you can then issue the command
  25. svn co svn://svn.code.sf.net/p/reduce-algebra/code/trunk reduce-algebra
  26. which will check-out Reduce and put a copy in the directory reduce-algebra.
  27. You can select whatever name of location you like for the copy that you
  28. check-out. I often have several, with the second one called testing-reduce.
  29. Then there are perhaps two key recipes for use of subversion that you may
  30. like to be aletred to. In each case go "cd reduce-algebra" first:
  31. svn update
  32. updates your local files to bring them into step with the ones on the server.
  33. If you have made local changes these changes are NOT overwritten.
  34. If you have made local changes that clash with updates at the repository
  35. the attempt to use "svn update" may generate messages or options that you
  36. find hard to understand at the start. If in doubt use ^C to abandon the
  37. fetch and then use
  38. svn -R revert .
  39. which should undo any local changes you made and bring your local copy back
  40. in step with the version you last fetched. Then "svn update" will have a
  41. better change of working without complaint.
  42. One further circumstance can still cause confusion to those who have not used
  43. subversion significantly. If a new file or directory is published in the
  44. sourceforge server but somehow you have something with the same name in your
  45. local tree the clash will lead to alerts. If you delete the part of your local
  46. tree including the unexpected material then subversion is liable to be able
  47. to re-fetch anything that is missing and restore your tree.
  48. The fundamantal basis for the above advice is that you will not be making
  49. private changes or additions to Reduce within the main tree, and so you would
  50. be happy if everything within that directory was snapped back to be a mere
  51. copy of what is at sourceforge. When you move beyond that state take a while
  52. to read the subversion documentation rather than blindly following the
  53. simplistic guidance here!
  54. (3) Support software and libraries.
  55. Building Reduce uses a collection of utilities and libraries. For the main
  56. supported platforms there are scripts that attempt to simplfy the process
  57. of ensuring that all that is needed has been installed. Because the platforms
  58. re-package software, update versions and generally develop over time the
  59. recipes given here can not be guaranteed perfect for ever, but at the very
  60. least they can get you started.
  61. For Windows consider scripts/cygwin-sanity-check.sh which tries to to
  62. check if everything that Reduce does or might need is installed. At the end
  63. if more packages need to be installed it will display a command of the
  64. form
  65. ./setup-x86_64.exe --no-desktop --no-shortcuts \
  66. --no-startmenu --quiet-mode -P ... ... ...
  67. with a list of packages following. I use copy and paste so that I can
  68. launch that command from within the directoryt where I have already got
  69. the Cygwin version of setup-x86_64.exe. This installs some software beyond
  70. the bare minimum for simple building of Reduce - it is used to ensure that
  71. everything needed when building a binary release is present.
  72. For Linux I have scripts/ubuntu-sanity-check.sh, fedora-sanity-check.sh and
  73. scientific-linux-sanity-check.sh. The first of these may suffice on other
  74. Debian and Debian derived systems and is the one checked most often. The
  75. Fedora one is a prototype for RPM worlds and both it and the Scientific Linux
  76. support were set up at some stage in the past so should be viewed as
  77. starting points rather than up to date validated scripts. If you try them and
  78. find updates are necessary please report so we can fix them.
  79. On the Macintosh scripts/macports-setup.sh is where to start. Because macports
  80. installs many of its packages by fetching source and compiling locally this
  81. can take quite some while to complete, but the initial set up is a once-off
  82. cost.
  83. If you are on some other platform and are willing to develop and contribute
  84. a script in the above spirit for configuring software on an initially
  85. pristine copy of some other operation system then please do that and send
  86. in a copt to be put in the reduce-algebra/scripts directory. For instance
  87. Reduce can be build in various BSD-family platforms. It is not some years
  88. since a version was tested on Solaris but with some care that was possible.
  89. (4) Initial testing
  90. You can either launch straight into an attempt to build Reduce or you can run
  91. scripts/csl-sanity-check.sh. If the latter succeeds it should display a
  92. window containing the text "Arthur". It is far from a rigorous check of all
  93. pre-requisites, but if it does behave that can build confidence!
  94. (5) Building and testing REDUCE
  95. The key commands are
  96. ./configure --with-psl
  97. or ./configure --with-csl
  98. [and it is valid to issue first one and the the second so that both variants
  99. of Reduce will get built].
  100. make
  101. The initial build of Reduce has to go through a bootstrapping process and
  102. takes longer than subsequent rebuilds. It is also much slower under Windows
  103. than on the other platforms where it only needs a moderate number of minutes.
  104. If you are uncertain I would suggest going
  105. script buildreduce.log
  106. make
  107. exit
  108. which makes a transcript of the lengthy and untidy output. If things fail
  109. it can be hard to decode why - in part because the build scripts can run
  110. some parts of the build process in parallel so that fragments of output from
  111. independent sub-tasks end up interleaved.
  112. When building has completed sucessfully you can try
  113. bin/redcsl Open CSL-reduce in a window
  114. bin/redcsl -w Run CSL-reduce in console mode
  115. bin/redpsl Run PSL-reduce
  116. where the reduce-algebra/bin directory contains the recipes for running things.
  117. You may wish to put that on your PATH. Of course you only get the CSL or PSL
  118. version available if you had used the proper ./configure option! If you
  119. seleced just one (say PSL) initially and later want to try the other then
  120. re-run ./configure in the reduce-algebra directory with "--with-XXX" for the
  121. second variant then re-run "make". Then you should have both to try and to
  122. compare.
  123. Plausible inoutail inpout to see that Reduce is working might be:
  124. 2+2; % Trivial arithmetic
  125. int(1/(x^6-1), x); % Indefinite integration
  126. df(ws, x); % Differentiate the integral
  127. solve(a*x^2 + b*x + x, x); % Quadratic formula
  128. quit; % Done!
  129. After that it can be good to try a more exhausitive set of tests by going
  130. scripts/testall.sh
  131. which runs test and demonstration examples for almost all parts of Reduce
  132. and also a collection of regression tests written as issues have been
  133. identified and addressed. If you only installed either the PSL or CSL
  134. version you will need to follow "testall.sh" with either "--csl" or "--psl"
  135. as relevant - by default it runs both and compares their output both against
  136. stored reference logs and against each other.
  137. At sny moment there will be a small number of the test cases that report
  138. inconsistencies. Whiel some may reflect bugs or limitations others may be
  139. where the core system has been improved but the reference logs have not
  140. caught up.
  141. This now quite long enough for a getting-started guide. Note that there
  142. is a full Reduce manual in doc/manual/manual.pdf, and those who may wish to
  143. understand Reduce internals in greater detail can also look in the
  144. doc/primers directory.
  145. Arthur Norman. December 2019