home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / nihcl-3.0 / doc / install.nihcl next >
Encoding:
Text File  |  1990-05-25  |  14.2 KB  |  572 lines

  1. \begindata{text,1080728}
  2. \textdsversion{12}
  3. \define{italic
  4. menu:[Font,Italic]
  5. attr:[FontFace Italic Int Set]}
  6. \define{bold
  7. menu:[Font,Bold]
  8. attr:[FontFace Bold Int Set]}
  9. \define{chapter
  10. menu:[Title,Chapter]
  11. attr:[Justification LeftJustified Point 0]
  12. attr:[FontFace Bold Int Set]
  13. attr:[FontSize PreviousFontSize Point 4]}
  14. \define{section
  15. menu:[Title,Section]
  16. attr:[Justification LeftJustified Point 0]
  17. attr:[FontFace Bold Int Set]
  18. attr:[FontSize PreviousFontSize Point 2]}
  19. \define{subsection
  20. menu:[Title,Subsection]
  21. attr:[Justification LeftJustified Point 0]
  22. attr:[FontFace Bold Int Set]}
  23. \define{paragraph
  24. menu:[Title,Paragraph]
  25. attr:[Justification LeftJustified Point 0]
  26. attr:[FontFace Italic Int Set]}
  27. \define{bigger
  28. menu:[Font,Bigger]
  29. attr:[FontSize PreviousFontSize Point 2]}
  30. \define{indent
  31. menu:[Region,Indent]
  32. attr:[LeftMargin LeftMargin Inch 32768]
  33. attr:[RightMargin RightMargin Inch 32768]}
  34. \define{typewriter
  35. menu:[Font,Typewriter]
  36. attr:[FontFace FixedFace Int Set]
  37. attr:[FontFamily AndyType Int 0]}
  38. \define{display
  39. menu:[Region,Display]
  40. attr:[LeftMargin LeftMargin Inch 32768]
  41. attr:[RightMargin RightMargin Inch 32768]
  42. attr:[Justification LeftJustified Point 0]}
  43. \define{example
  44. menu:[Region,Example]
  45. attr:[LeftMargin LeftMargin Inch 32768]
  46. attr:[Justification LeftJustified Point 0]
  47. attr:[FontFace FixedFace Int Set]
  48. attr:[FontFamily AndyType Int 0]}
  49. \define{description
  50. menu:[Region,Description]
  51. attr:[LeftMargin LeftMargin Cm 171084]
  52. attr:[Indent LeftMargin Cm -106350]}
  53. \define{quotation
  54. menu:[Region,Quotation]
  55. attr:[LeftMargin LeftMargin Inch 32768]
  56. attr:[RightMargin RightMargin Inch 32768]
  57. attr:[FontFace Italic Int Set]}
  58. \define{subscript
  59. menu:[Font,Subscript]
  60. attr:[Script PreviousScriptMovement Point 2]
  61. attr:[FontSize PreviousFontSize Point -2]}
  62. \define{superscript
  63. menu:[Font,Superscript]
  64. attr:[Script PreviousScriptMovement Point -6]
  65. attr:[FontSize PreviousFontSize Point -2]}
  66. \define{smaller
  67. menu:[Font,Smaller]
  68. attr:[FontSize PreviousFontSize Point -2]}
  69. \define{heading
  70. menu:[Title,Heading]
  71. attr:[LeftMargin LeftMargin Inch -13107]
  72. attr:[Justification LeftJustified Point 0]
  73. attr:[FontFace Bold Int Set]}
  74. \define{majorheading
  75. menu:[Title,MajorHeading]
  76. attr:[Justification Centered Point 0]
  77. attr:[FontSize PreviousFontSize Point 4]}
  78. \define{formatnote
  79. menu:[Region,FormatNote]
  80. attr:[Flags PassThru Int Set]}
  81. \define{subheading
  82. menu:[Title,Subheading]
  83. attr:[Justification LeftJustified Point 0]
  84. attr:[FontFace Bold Int Set]}
  85. \define{center
  86. menu:[Justify,Center]
  87. attr:[Justification Centered Point 0]}
  88. \define{flushleft
  89. menu:[Justify,FlushLeft]
  90. attr:[Justification LeftJustified Point 0]}
  91. \define{flushright
  92. menu:[Justify,FlushRight]
  93. attr:[Justification RightJustified Point 0]}
  94. \define{leftindent
  95. menu:[Region,LeftIndent]
  96. attr:[LeftMargin LeftMargin Inch 32768]}
  97. \define{code
  98. menu:[Region,Code]
  99. attr:[FontFace FixedFace Int Set]
  100. attr:[FontFamily AndyType Int 0]}
  101. \formatnote{.ds Cl Installation
  102.  
  103. .so nihclmac.tr}
  104.  
  105. \section{INTRODUCTION}
  106.  
  107. \begindata{lookz, 1097376}
  108. hidden
  109. \enddata{lookz, 1097376}
  110. \view{lookzview,1097376,0,0,0}
  111.  
  112. This is the Installation Guide for the NIH Class Library (previously known as 
  113. the "OOPS" Class Library) Revision 3.0.
  114.  
  115.  
  116. The NIH Class Library is intended to be portable to a UNIX system compatible 
  117. with either System V or 4.2/4.3BSD and which supports the AT&T C++ translator 
  118. Release 2.00, Release 2.1, or other compatible C++ compiler.  We have ported 
  119. and tested this library on the following systems:
  120.  
  121. \indent{
  122. Sun-3 with SunOS 3.5
  123.  
  124. Sun-3 with SunOS 4.0
  125.  
  126. Sun-4 with SunOS 4.0
  127.  
  128. }
  129. Send comments to:
  130.  
  131.  
  132. \indent{Keith Gorlen
  133.  
  134. Building 12A, Room 2033
  135.  
  136. Computer Systems Laboratory
  137.  
  138. Division of Computer Research and Technology
  139.  
  140. National Institutes of Health
  141.  
  142. Bethesda, MD 20892
  143.  
  144.  
  145. phone: (301) 496-1111
  146.  
  147. Internet\indent{: kgorlen@alw.nih.gov}
  148.  
  149. uucp: uunet!nih-csl!kgorlen
  150.  
  151. }
  152.  
  153. \section{GUIDE TO THIS DISTRIBUTION KIT}
  154.  
  155.  
  156. The NIH Class Library distribution kit consists of a main directory and the 
  157. following subdirectories:
  158.  
  159.  
  160. \indent{\code{errfac     }Error Message Facility source files
  161.  
  162. \code{lib        }Source files for the basic library classes
  163.  
  164. \code{test       }Test suite for the basic library classes
  165.  
  166. \code{vector     }Source files for the Vector classes
  167.  
  168. \code{vectest    }Test suite for the Vector classes
  169.  
  170. \code{ex         }Example programs for the book
  171.  
  172. }
  173. The main directory is refered to as \code{NIHCL} in the following discussion, 
  174. but may be placed anywhere.
  175.  
  176.  
  177. Most subdirectories have files named \code{MAKEFILE} and \code{Makefile}.  The 
  178. \code{MAKEFILE} is used by the installation procedure, and should work with 
  179. both the System V and BSD version of the \code{make} utility.  The fancier 
  180. \code{Makefile} is used for development, and may not work under BSD.
  181.  
  182.  
  183.  
  184. \section{SUMMARY OF STEPS IN INSTALLING THE NIH CLASS LIBRARY}
  185.  
  186.  
  187. \description{1.    Update C++ system library and include files
  188.  
  189. 2.    Edit \code{NIHCL/Makefile}
  190.  
  191. 3.    Edit \code{NIHCL/lib/nihclconfig.h}
  192.  
  193. 4.    Build and install error message facility*
  194.  
  195. 5.    Build NIHCL basic classes, Vector classes, and test suite
  196.  
  197. 6.    Test basic classes and Vector classes
  198.  
  199. 7.    Build NIHCL basic classes, Vector classes, and test suite with multiple 
  200. inheritance support
  201.  
  202. 8.    Test basic classes and Vector classes with multiple inheritance support
  203.  
  204. 9.    Install class libraries*
  205.  
  206. 10.    Build example programs
  207.  
  208. 11.    Test example programs
  209.  
  210. }
  211. * root permission may be required
  212.  
  213.  
  214.  
  215.  
  216. \section{INSTALLING THE NIH CLASS LIBRARY
  217.  
  218. }\subheading{
  219. }\subsection{1. Update C++ system library and include files}
  220.  
  221.  
  222. No updates to R2.00 of the AT&T C++ Translator are required.  However, if you 
  223. are using R2.1, be sure to make the changes documented in the section 
  224. \italic{COMPILING UNDER AT&T C++ TRANSLATOR RELEASE 2.1} in the \italic{NIH 
  225. Class Library Release Notes}.
  226.  
  227.  
  228. \subsection{2. Edit NIHCL/Makefile}
  229.  
  230.  
  231. Edit \code{NIHCL/Makefile} to change make variables as needed for your 
  232. environment.  Here are the settings shipped with the distribution kit:
  233.  
  234.  
  235. \example{\smaller{# C++ compiler
  236.  
  237. CC = CC
  238.  
  239.  
  240. # C++ debug switch
  241.  
  242. CCDEBUG =
  243.  
  244. #CCDEBUG = -g
  245.  
  246.  
  247. # C++ flags
  248.  
  249. # NOTE: Disable +p option when compiling with AT&T R2.1 
  250.  
  251. #CCFLAGS = +p
  252.  
  253. #CCFLAGS =
  254.  
  255.  
  256. # C++ include files
  257.  
  258. I = /usr/include/CC
  259.  
  260.  
  261. # If using BSD
  262.  
  263. SYS = BSD
  264.  
  265. # If using System V
  266.  
  267. #SYS = SYSV
  268.  
  269.  
  270. # Compile with nested types
  271.  
  272. # (works with AT&T R2.1 and GNU C++)
  273.  
  274. NESTED_TYPES =
  275.  
  276. #NESTED_TYPES = -DNESTED_TYPES
  277.  
  278.  
  279. # Disable AT&T R2.0/R2.1 bug work-around code
  280.  
  281. BUGDEFS =
  282.  
  283. #BUGDEFS = -DBUG_bC2728 -DBUG_38 -DBUG_39 -DBUG_OPTYPECONST
  284.  
  285. # Defining BUG_TOOBIG disables code that 
  286.  
  287. # prevents C compiler "yacc stack overflows" error
  288.  
  289. #BUGDEFS = -DBUG_bC2728 -DBUG_38 -DBUG_39 -DBUG_OPTYPECONST -DBUG_TOOBIG
  290.  
  291.  
  292. # Enable debug code
  293.  
  294. DEBUGDEFS =
  295.  
  296. #DEBUGDEFS = -DDEBUG_OBJIO -DDEBUG_PROCESS
  297.  
  298.  
  299. # Flags for ln
  300.  
  301. #LNFLAGS =
  302.  
  303. LNFLAGS = -s
  304.  
  305.  
  306. # If using "patch"
  307.  
  308. MAIN = _main.c_p
  309.  
  310. # If using "munch"
  311.  
  312. #MAIN = _main.c_m
  313.  
  314.  
  315. # Target library for installation of Error Facility
  316.  
  317. LIB_ID = libC
  318.  
  319.  
  320. # Target Directories for Installation
  321.  
  322.  
  323. # directory for libnihcl.a
  324.  
  325. NIHCLLIBDIR = /usr/local/lib
  326.  
  327. # directory for NIHCL include files
  328.  
  329. NIHCLINCDIR = /usr/include/nihcl
  330.  
  331. # directory where $\{LIB_ID\}.a resides
  332.  
  333. CLIBDIR = /usr/local/lib/C++R2.0
  334.  
  335. # directory for errgen utility
  336.  
  337. ERRGENDIR = /usr/local/bin
  338.  
  339. # directory for errgen table file
  340.  
  341. ERRTABDIR = /usr/local/lib
  342.  
  343. # directory for errlib.h and errors.h
  344.  
  345. ERRINCDIR = $I}
  346.  
  347. }
  348.  
  349. \subsection{3. Edit NIHCL/lib files}
  350.  
  351.  
  352. \paragraph{3.1 Edit \code{nihclconfig.h}}
  353.  
  354.  
  355. The NIH Class Library source is configured for your system by setting flags in 
  356. \code{NIHCL/lib/nihclconfig.h} which specify the machine model and operating 
  357. system (UNIX variant).
  358.  
  359.  
  360. To configure the NIH Class Library for one of the not yet implemented options, 
  361. at least all of the parameters appearing in \code{nihclconfig.h} will have to 
  362. be defined for that option.
  363.  
  364.  
  365. The NIH Class Library should configure itself automatically for the following 
  366. machines:
  367.  
  368.  
  369. \indent{sun/mc68000
  370.  
  371. sun/sparc
  372.  
  373. }
  374. Classes \code{Process}, \code{HeapProc}, \code{StackProc}, \code{Scheduler}, 
  375. \code{Semaphore}, and \code{SharedQueue} have some machine-specific 
  376. dependencies and will not work unless the \code{SETJMP()/LONGJMP()} functions 
  377. are properly defined.  See the \italic{NIH Class Library Release Notes} for 
  378. directions on porting the \code{Process} classes.
  379.  
  380.  
  381. \paragraph{3.2 Edit \code{Object.h}}
  382.  
  383.  
  384. The file \code{Object.h} defines three versions of a preprocessor macro named 
  385. \code{STRINGIZE}, which forms some symbol names by concatenating the class 
  386. name argument with other strings.  Each version does this a different way. 
  387.  The version for use with ANSI C preprocessors, conditionalized on the symbol 
  388. \code{__STDC__}, uses \code{##} for concatenation.  If you are not using an 
  389. ANSI C preprocessor, defining the symbol \code{BS_NL} in \code{Object.h} 
  390. selects the version that uses the sequence \code{\\}<newline> as the 
  391. concatenation separator, which seems to work with most System V UNIX systems. 
  392.  If you do not define \code{BS_NL}, you get the version of DEFINE_CLASS that 
  393. uses an empty comment sequence (\code{/**/}), which works with most Berkeley 
  394. UNIX systems.
  395.  
  396.  
  397. \code{Object.h} should require no editing on most systems.
  398.  
  399.  
  400. \subsection{4. Install error message facility
  401.  
  402.  
  403. }(Skip this step for MASSCOMP/RTU)
  404.  
  405.  
  406. \example{su     (if installing in protected directory)
  407.  
  408. make errorfacility}
  409.  
  410.  
  411. This builds an error message registery facility and error processing library 
  412. similar to \code{errcom} and the 3E library routines on the MASSCOMP.
  413.  
  414.  
  415. The \code{errgen} program reads a \code{.err} file to determine a facility 
  416. name, and then reads the file \code{$\{ERRTABDIR\}/errgen_tab} to lookup the 
  417. number assigned to that facility.  The facility number determines the 
  418. high-order bits of the error numbers which \code{errgen} assigns, assuring 
  419. that error numbers used by different libraries do not coincide.  Errgen 
  420. produces a \code{.h} file containing error symbols and their assigned numbers, 
  421. and a \code{.c} file containing a table of error messages and formatting 
  422. information.
  423.  
  424.  
  425. This step creates a module containing the error handling library routines 
  426. named \code{errors.o} and adds it to \code{$\{CLIBDIR\}/$\{LIB_ID\}.a}, and it 
  427. copies the files \code{errlib.h} and \code{errors.h} into the directory 
  428. \code{$\{ERRINCDIR\}.}
  429.  
  430.  
  431. The test program testerr on \code{NIHCL/errfac} verifies that the error 
  432. facilities have been built correctly.  It returns the first and last error 
  433. defined in the file \code{testerrs.err}.
  434.  
  435.  
  436.  
  437. \subsection{5. Build the NIH Class Library, Vector classes, and test suite
  438.  
  439. }
  440. \example{make}
  441.  
  442.  
  443.  
  444. \subsection{6. Test the NIH Class Library
  445.  
  446. }
  447. \example{make verify}
  448.  
  449.  
  450. This runs the test suite and compares the output of each test program with the 
  451. contents of a \code{.v} file containing the correct output.  If the program 
  452. runs correctly, you'll see the message "No differences encountered".  Some 
  453. tests such as \code{date}, \code{identdict}, \code{process}, \code{random}, 
  454. \code{stack}, and \code{tim} produce output to the terminal.  \code{date} 
  455. outputs yesterday's, today's, and tomorrow's date.  \code{identdict} dumps an 
  456. identity dictionary.  \code{random} prints out a list of random numbers. 
  457.  \code{stack} prints out a \code{CLTNEMPTY} error message to test error 
  458. reporting, and \code{tim} prints out the current date and time.
  459.  
  460.  
  461. The \code{error} test program frequently fails to compare because its output 
  462. depends upon memory addresses that change from implementation to 
  463. implementation.  \code{error} should differ only in the object address printed 
  464. in the \code{CLTNEMPTY} error message.
  465.  
  466.  
  467. The output of \code{fdset} depends upon the maximum number of allowable file 
  468. descriptors on your system.  The test output was generated under SunOS 4.0, 
  469. which has a limit of 64 file descriptors.
  470.  
  471.  
  472. Several tests that print floating point numbers may fail to compare due to 
  473. formatting differences.
  474.  
  475.  
  476. The byte size of the object printed by ex8-1 may vary for different systems. 
  477.  The test output was produced by a Sun-3.
  478.  
  479.  
  480.  
  481. \subsection{7. Build the NIH Class Library, Vector classes, and test suite 
  482. with multiple inheritance support
  483.  
  484. }
  485. \example{make cleantest
  486.  
  487. make mi
  488.  
  489. }
  490.  
  491. \subsection{8. Test the NIH Class Library, Vector classes, and test suite with 
  492. multiple inheritance support
  493.  
  494. }
  495. \example{make verify
  496.  
  497. }
  498. This runs the same tests as in Step 6, with similar results.
  499.  
  500.  
  501.  
  502. \subsection{9. Install the NIH Class Libraries
  503.  
  504. }
  505. \example{su     (if installing in protected directory)
  506.  
  507. make install}
  508.  
  509.  
  510. The NIH Class Library archives \code{libnihcl.a}, \code{libnihclmi.a}, 
  511. \code{libnihclvec.a}, and \code{libnihclvecmi.a} are copied to 
  512. \code{$\{NIHCLLIBDIR\}} and \code{ranlib} is executed on the libraries.  All 
  513. header files for basic classes are copied to directory 
  514. \code{$\{NIHCLINCDIR\}}.
  515.  
  516.  
  517.  
  518. \subsection{10. Build example programs
  519.  
  520. }
  521. \example{make examples}
  522.  
  523.  
  524.  
  525. \subsection{11. Test example programs}
  526.  
  527.  
  528. \example{make exverify}
  529.  
  530.  
  531.  
  532. \section{TROUBLE SHOOTING}
  533.  
  534.  
  535. \subsection{YACC stack overflows}
  536.  
  537.  
  538. Some test programs may fail to compile because they are too complicated for 
  539. your C compiler and get a "yacc stack overflow".  Either increase the table 
  540. space in your C compiler or simplify the program by breaking it up into 
  541. separate functions.  The inline copy constructors that Release 2.0 
  542. automatically generates are frequently the source of this error.  Explicitly 
  543. defining non-inline copy constructors solves the problem.  See the 
  544. \italic{Release Notes} for further details.
  545.  
  546.  
  547. \subsection{Problems with class Exception}
  548.  
  549.  
  550. Test programs error and except test class \code{Exception}, the the NIH Class 
  551. Library exception handler. If these programs fail to perform correctly 
  552. suspicion can be directed to the performance of system functions 
  553. \code{setjmp()} and \code{longjmp()}.
  554.  
  555.  
  556. \subsection{Problems with Process classes}
  557.  
  558.  
  559. Progams \code{process} and \code{stackproc} test the NIH Class Library 
  560. co-routine mechanism (classes \code{Process}, \code{HeapProc}, 
  561. \code{StackProc}, and \code{Scheduler}), the object queue (class 
  562. \code{SharedQueue}) and semaphore (class \code{Semaphore}).  These are 
  563. machine-dependent and rely on the presence of \code{alloca()}, which all 
  564. systems do not provide, and on \code{setjmp()}/\code{longjmp()} being 
  565. implemented by saving/restoring all machine registers, which is not always the 
  566. case for all systems either.  If the \code{process} or \code{stackproc} tests 
  567. fail to compile, link, or run, check your system's implementations of 
  568. \code{alloca()} \code{setjmp()}, and \code{longjmp()} -- you may need to 
  569. implement your own versions.
  570.  
  571. \enddata{text,1080728}
  572.