You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

255 lines
6.7 KiB

25 years ago
  1. <HTML>
  2. <HEAD>
  3. <!-- Created by texi2html 1.56k from cln.texi on 14 January 2000 -->
  4. <TITLE>CLN, a Class Library for Numbers - 2. Installation</TITLE>
  5. </HEAD>
  6. <BODY>
  7. Go to the <A HREF="cln_1.html">first</A>, <A HREF="cln_1.html">previous</A>, <A HREF="cln_3.html">next</A>, <A HREF="cln_13.html">last</A> section, <A HREF="cln_toc.html">table of contents</A>.
  8. <P><HR><P>
  9. <H1><A NAME="SEC2" HREF="cln_toc.html#TOC2">2. Installation</A></H1>
  10. <P>
  11. This section describes how to install the CLN package on your system.
  12. <H2><A NAME="SEC3" HREF="cln_toc.html#TOC3">2.1 Prerequisites</A></H2>
  13. <H3><A NAME="SEC4" HREF="cln_toc.html#TOC4">2.1.1 C++ compiler</A></H3>
  14. <P>
  15. To build CLN, you need a C++ compiler.
  16. Actually, you need GNU <CODE>g++ 2.7.0</CODE> or newer.
  17. On HPPA, you need GNU <CODE>g++ 2.8.0</CODE> or newer.
  18. I recommend GNU <CODE>egcs 1.1</CODE> or newer.
  19. <P>
  20. The following C++ features are used:
  21. classes, member functions,
  22. overloading of functions and operators,
  23. constructors and destructors, inline, const,
  24. multiple inheritance, templates.
  25. <P>
  26. The following C++ features are not used:
  27. <CODE>new</CODE>, <CODE>delete</CODE>, virtual inheritance,
  28. exceptions.
  29. <P>
  30. CLN relies on semi-automatic ordering of initializations
  31. of static and global variables, a feature which I could
  32. implement for GNU g++ only.
  33. <H3><A NAME="SEC5" HREF="cln_toc.html#TOC5">2.1.2 Make utility</A></H3>
  34. <P>
  35. To build CLN, you also need to have GNU <CODE>make</CODE> installed.
  36. <H3><A NAME="SEC6" HREF="cln_toc.html#TOC6">2.1.3 Sed utility</A></H3>
  37. <P>
  38. To build CLN on HP-UX, you also need to have GNU <CODE>sed</CODE> installed.
  39. This is because the libtool script, which creates the CLN library, relies
  40. on <CODE>sed</CODE>, and the vendor's <CODE>sed</CODE> utility on these systems is too
  41. limited.
  42. <H2><A NAME="SEC7" HREF="cln_toc.html#TOC7">2.2 Building the library</A></H2>
  43. <P>
  44. As with any autoconfiguring GNU software, installation is as easy as this:
  45. <PRE>
  46. $ ./configure
  47. $ make
  48. $ make check
  49. </PRE>
  50. <P>
  51. If on your system, <SAMP>`make'</SAMP> is not GNU <CODE>make</CODE>, you have to use
  52. <SAMP>`gmake'</SAMP> instead of <SAMP>`make'</SAMP> above.
  53. <P>
  54. The <CODE>configure</CODE> command checks out some features of your system and
  55. C++ compiler and builds the <CODE>Makefile</CODE>s. The <CODE>make</CODE> command
  56. builds the library. This step may take 4 hours on an average workstation.
  57. The <CODE>make check</CODE> runs some test to check that no important subroutine
  58. has been miscompiled.
  59. <P>
  60. The <CODE>configure</CODE> command accepts options. To get a summary of them, try
  61. <PRE>
  62. $ ./configure --help
  63. </PRE>
  64. <P>
  65. Some of the options are explained in detail in the <SAMP>`INSTALL.generic'</SAMP> file.
  66. <P>
  67. You can specify the C compiler, the C++ compiler and their options through
  68. the following environment variables when running <CODE>configure</CODE>:
  69. <DL COMPACT>
  70. <DT><CODE>CC</CODE>
  71. <DD>
  72. Specifies the C compiler.
  73. <DT><CODE>CFLAGS</CODE>
  74. <DD>
  75. Flags to be given to the C compiler when compiling programs (not when linking).
  76. <DT><CODE>CXX</CODE>
  77. <DD>
  78. Specifies the C++ compiler.
  79. <DT><CODE>CXXFLAGS</CODE>
  80. <DD>
  81. Flags to be given to the C++ compiler when compiling programs (not when linking).
  82. </DL>
  83. <P>
  84. Examples:
  85. <PRE>
  86. $ CC="gcc" CFLAGS="-O" CXX="g++" CXXFLAGS="-O" ./configure
  87. $ CC="gcc -V 2.7.2" CFLAGS="-O -g" \
  88. CXX="g++ -V 2.7.2" CXXFLAGS="-O -g" ./configure
  89. $ CC="gcc -V 2.8.1" CFLAGS="-O -fno-exceptions" \
  90. CXX="g++ -V 2.8.1" CXXFLAGS="-O -fno-exceptions" ./configure
  91. $ CC="gcc -V egcs-2.91.60" CFLAGS="-O2 -fno-exceptions" \
  92. CXX="g++ -V egcs-2.91.60" CFLAGS="-O2 -fno-exceptions" ./configure
  93. </PRE>
  94. <P>
  95. Note that for these environment variables to take effect, you have to set
  96. them (assuming a Bourne-compatible shell) on the same line as the
  97. <CODE>configure</CODE> command. If you made the settings in earlier shell
  98. commands, you have to <CODE>export</CODE> the environment variables before
  99. calling <CODE>configure</CODE>. In a <CODE>csh</CODE> shell, you have to use the
  100. <SAMP>`setenv'</SAMP> command for setting each of the environment variables.
  101. <P>
  102. On Linux, <CODE>g++</CODE> needs 15 MB to compile the tests. So you should better
  103. have 17 MB swap space and 1 MB room in $TMPDIR.
  104. <P>
  105. If you use <CODE>g++</CODE> version 2.7.x, don't add <SAMP>`-O2'</SAMP> to the CXXFLAGS,
  106. because <SAMP>`g++ -O'</SAMP> generates better code for CLN than <SAMP>`g++ -O2'</SAMP>.
  107. <P>
  108. If you use <CODE>g++</CODE> version 2.8.x or egcs-2.91.x (a.k.a. egcs-1.1) or
  109. gcc-2.95.x, I recommend adding <SAMP>`-fno-exceptions'</SAMP> to the CXXFLAGS.
  110. This will likely generate better code.
  111. <P>
  112. If you use <CODE>g++</CODE> version egcs-2.91.x (egcs-1.1) or gcc-2.95.x on Sparc,
  113. add either <SAMP>`-O'</SAMP> or <SAMP>`-O2 -fno-schedule-insns'</SAMP> to the CXXFLAGS.
  114. With full <SAMP>`-O2'</SAMP>, <CODE>g++</CODE> miscompiles the division routines. Also, for
  115. --enable-shared to work, you need egcs-1.1.2 or newer.
  116. <P>
  117. On MIPS (SGI Irix 6), pass option <CODE>--without-gmp</CODE> to configure. gmp does
  118. not work when compiled in <SAMP>`n32'</SAMP> binary format on Irix.
  119. <P>
  120. By default, only a static library is built. You can build CLN as a shared
  121. library too, by calling <CODE>configure</CODE> with the option <SAMP>`--enable-shared'</SAMP>.
  122. To get it built as a shared library only, call <CODE>configure</CODE> with the options
  123. <SAMP>`--enable-shared --disable-static'</SAMP>.
  124. <P>
  125. If you use <CODE>g++</CODE> version egcs-2.91.x (egcs-1.1) on Sparc, you cannot
  126. use <SAMP>`--enable-shared'</SAMP> because <CODE>g++</CODE> would miscompile parts of the
  127. library.
  128. <H2><A NAME="SEC8" HREF="cln_toc.html#TOC8">2.3 Installing the library</A></H2>
  129. <P>
  130. As with any autoconfiguring GNU software, installation is as easy as this:
  131. <PRE>
  132. $ make install
  133. </PRE>
  134. <P>
  135. The <SAMP>`make install'</SAMP> command installs the library and the include files
  136. into public places (<TT>`/usr/local/lib/'</TT> and <TT>`/usr/local/include/'</TT>,
  137. if you haven't specified a <CODE>--prefix</CODE> option to <CODE>configure</CODE>).
  138. This step may require superuser privileges.
  139. <P>
  140. If you have already built the library and wish to install it, but didn't
  141. specify <CODE>--prefix=...</CODE> at configure time, just re-run
  142. <CODE>configure</CODE>, giving it the same options as the first time, plus
  143. the <CODE>--prefix=...</CODE> option.
  144. <H2><A NAME="SEC9" HREF="cln_toc.html#TOC9">2.4 Cleaning up</A></H2>
  145. <P>
  146. You can remove system-dependent files generated by <CODE>make</CODE> through
  147. <PRE>
  148. $ make clean
  149. </PRE>
  150. <P>
  151. You can remove all files generated by <CODE>make</CODE>, thus reverting to a
  152. virgin distribution of CLN, through
  153. <PRE>
  154. $ make distclean
  155. </PRE>
  156. <P><HR><P>
  157. Go to the <A HREF="cln_1.html">first</A>, <A HREF="cln_1.html">previous</A>, <A HREF="cln_3.html">next</A>, <A HREF="cln_13.html">last</A> section, <A HREF="cln_toc.html">table of contents</A>.
  158. </BODY>
  159. </HTML>