TC-README 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. From boyer@jumpjibe.stanford.edu Fri Jun 9 03:54:33 1995
  2. Received: from jumpjibe.stanford.edu (jumpjibe.Stanford.EDU [36.4.0.23]) by gluttony.isc.tamu.edu (8.6.11/8.6.11) with ESMTP id DAA18702 for <des@isc.tamu.edu>; Fri, 9 Jun 1995 03:54:31 -0500
  3. Received: (from boyer@localhost) by jumpjibe.stanford.edu (8.6.10/8.6.10) id BAA13677 for des@isc.tamu.edu; Fri, 9 Jun 1995 01:54:48 -0700
  4. Message-Id: <199506090854.BAA13677@jumpjibe.stanford.edu>
  5. From: boyer@jumpjibe.stanford.edu (Brent Boyer)
  6. Date: Fri, 9 Jun 1995 01:54:48 PDT
  7. In-Reply-To: David Stewart <des@isc.tamu.edu>
  8. "Re: Meschach setup question" (Jun 8, 19:07)
  9. X-Mailer: Mail User's Shell (7.2.0 10/31/90)
  10. To: David Stewart <des@isc.tamu.edu>
  11. Subject: second additional message
  12. Content-Length: 6352
  13. X-Lines: 168
  14. Status: RO
  15. dave,
  16. below is the text for a file I call "Mac/TC README" which
  17. explains everything I did to get it running.
  18. -brent
  19. /*
  20. Introduction -- Brent Boyer 6/7/95
  21. _____________________
  22. I have found a procedure which gets the Meschach routines to work on a Macintosh with THINK C 7.0.4.
  23. My system is a Quadra 650 running MacOS 7.5.1. The compile options described below should work for
  24. any 68K Mac with a floating point unit; they probably have to be modified for Power Macs
  25. (in particular, check the floating point type mapping and precision).
  26. (Note: THINK C is now on version 8.x, perhaps they have fixed some of the terrible features of
  27. the 7.x release; Metrowerk's CodeWarrior is supposed to be a better development environment
  28. and it allegedly can easily translate THINK C projects)
  29. Procedure
  30. _____________________
  31. Note: all projects described here should have the folowing options made under "Set Project Type..."
  32. (which is found under the "Project" menu):
  33. 1) "Application" type
  34. 2) "Far CODE" and "Far DATA" checked
  35. 3) Partition should be raised from 384 to 4000 (required to get all the *tort*.c projects to run)
  36. 4) Under "SIZE Flags", you can set "32-Bit Compatible" but leave the rest unchecked
  37. Step #1
  38. _________
  39. Create an appropriate version of THINK's ANSI library.
  40. -- first, you will have to modify two of Symantecs "Standard Library" files to let the
  41. function "isascii" become available (this function is required in "err.c")
  42. 1) in THINK's file "ctype.h" add this code in the appropriate places:
  43. a) int isascii(int);
  44. b) #define isascii(c) ((unsigned)(c)<=0177)
  45. 2) in THINK's file "ctype.c" add this code:
  46. a) int
  47. (isascii)(int c)
  48. {
  49. return (isascii(c));
  50. }
  51. What I next did was copy their project "ANSI" to one I called "ANSI (for Meschach)". I then selected
  52. these compiler ("THINK C...") options before bringing the project up to date:
  53. -- first, under "Language Settings"
  54. 1) choose "Factory Settings"
  55. 2) also change "Infer prototypes" to "Require prototypes"
  56. (as a former Pascal programmer, I curse the person who introduced infered prototypes!)
  57. (Note: you _cannot_ choose "ANSI Settings"; if you do, then the compilation of the ANSI project
  58. will fail! Talk to the people at Symantec about this one ...)
  59. -- then, under "Compiler Settings"
  60. 1) turn "Generate 68020 instructions" ON
  61. 2) turn "Generate 68881 instructions" ON
  62. 3) turn "4-byte ints" ON (so int == long int <==> 32 bits)
  63. 4) make sure that "8-byte doubles" turned OFF (so double == long double)
  64. 5) turn "Native floating-point format" ON
  65. (The other options probably do not matter either way)
  66. (Note: 2) and 5) ==> type double will be the 96 bit MC68881 floating point extended precision type;
  67. these options give the best speed and good accuracy too)
  68. (Also: this 96 bit floating point type will cause the test in "memtort.c" to wrongly report that
  69. 756 blocks were allocated when only 516 should have been)
  70. -- optionally, under "Code Optimization"
  71. 1) turn "Use Global Optimizer" ON
  72. Step #2
  73. _________
  74. Next create an appropriate version of THINK's UNIX library. What I did was copy their project
  75. "unix" to one I called "unix (for Meschach)". Build this project with the same "Language Settings"
  76. and "Compiler Settings" options described in Step #1.
  77. Step #3
  78. _________
  79. Correct some errors in the "Meschach" source code files:
  80. 1) the function "Mmmtr" in the file "extras.c" has an error in the line
  81. Mmv(n,p,alpha,&(A[i][Aj0]),B,Bj0,&(C[i][Cj0]));
  82. the correct line should read
  83. Mmv(n,p,alpha,B,Bj0,&(A[i][Aj0]),1.0,&(C[i][Cj0]));
  84. 2) the function "px_sign" in the file "pxop.c" will not compile unless the line
  85. numtransp = myqsort(px2->pe, px2->size);
  86. is replaced with
  87. numtransp = myqsort( (int *) px2->pe, px2->size );
  88. 3) the function "chk_col_access" in the file "sptort.c" conflicts with the same named function
  89. in the file "spbkp.c". This causes a link error. To solve this problem, I suggest renaming it as
  90. chk_col_access -> chk_col_accessSPT
  91. (Dave Stewart tells me that these errors are corrected (along with other stuff?) in a
  92. to-be-released version of "Meschach".)
  93. Step #4
  94. _________
  95. Ideally, you would next create a single large library containing all the Meschach routines. Unfortunately,
  96. you cannot do this because THINK C requires libraries to either be, or be built from, single segment projects,
  97. and individual segments can only have 32K of compiled code size, which is way too small for all the
  98. Meschach routines.
  99. Instead, what I had to do was create 7 smaller, single segment projects. I added code to the segments
  100. strictly in alphabetical order, with no regard to partitioning (i.e. putting similar routines together).
  101. To make each such project, I first opened a new project ("ANSI Project" type) and then added alot of
  102. source code files. I then selected these compiler ("THINK C...") options before bringing the project
  103. up to date:
  104. -- first, under "Language Settings"
  105. 1) choose "ANSI Settings" (tragically, will have to leave "Infer prototypes" on)
  106. -- next, under "Compiler Settings", make the same choices as when compiled "ANSI (for Meschach)"
  107. 1) turn "Generate 68020 instructions" ON
  108. 2) turn "Generate 68881 instructions" ON
  109. 3) turn "4-byte ints" ON (so int == long int <==> 32 bits)
  110. 4) make sure that "8-byte doubles" turned OFF (so double == long double)
  111. 5) turn "Native floating-point format" ON
  112. If the resulting single segment was over 32K, I removed files from the bottom of the list until the segment
  113. had < 32K left. The file "main.c" which was automatically generated was also removed.
  114. Note: I never added the *tort*.c files or any of the other files with a main routine (e.g. "maxint.c")
  115. in them to these projects. The *tort*.c files were made into separate projects. In order to
  116. echo the screen output to a file when running the torture tests, you need to add these lines
  117. to each *tort*.c file:
  118. a) #include <console.h> (put near top)
  119. b) cecho2file("filename", 0, stdout); (put inside main)
  120. You should then be able to simply add all these projects to any of your own projects -- this will give you the
  121. whole library.
  122. */