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.

288 lines
7.6 KiB

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. <HTML>
  2. <HEAD>
  3. <!-- Created by texi2html 1.56k from cln.texi on 5 May 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>g++ 2.95</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. <A NAME="IDX3"></A>
  36. <P>
  37. To build CLN, you also need to have GNU <CODE>make</CODE> installed.
  38. <H3><A NAME="SEC6" HREF="cln_toc.html#TOC6">2.1.3 Sed utility</A></H3>
  39. <P>
  40. <A NAME="IDX4"></A>
  41. <P>
  42. To build CLN on HP-UX, you also need to have GNU <CODE>sed</CODE> installed.
  43. This is because the libtool script, which creates the CLN library, relies
  44. on <CODE>sed</CODE>, and the vendor's <CODE>sed</CODE> utility on these systems is too
  45. limited.
  46. <H2><A NAME="SEC7" HREF="cln_toc.html#TOC7">2.2 Building the library</A></H2>
  47. <P>
  48. As with any autoconfiguring GNU software, installation is as easy as this:
  49. <PRE>
  50. $ ./configure
  51. $ make
  52. $ make check
  53. </PRE>
  54. <P>
  55. If on your system, <SAMP>`make'</SAMP> is not GNU <CODE>make</CODE>, you have to use
  56. <SAMP>`gmake'</SAMP> instead of <SAMP>`make'</SAMP> above.
  57. <P>
  58. The <CODE>configure</CODE> command checks out some features of your system and
  59. C++ compiler and builds the <CODE>Makefile</CODE>s. The <CODE>make</CODE> command
  60. builds the library. This step may take 4 hours on an average workstation.
  61. The <CODE>make check</CODE> runs some test to check that no important subroutine
  62. has been miscompiled.
  63. <P>
  64. The <CODE>configure</CODE> command accepts options. To get a summary of them, try
  65. <PRE>
  66. $ ./configure --help
  67. </PRE>
  68. <P>
  69. Some of the options are explained in detail in the <SAMP>`INSTALL.generic'</SAMP> file.
  70. <P>
  71. You can specify the C compiler, the C++ compiler and their options through
  72. the following environment variables when running <CODE>configure</CODE>:
  73. <DL COMPACT>
  74. <DT><CODE>CC</CODE>
  75. <DD>
  76. Specifies the C compiler.
  77. <DT><CODE>CFLAGS</CODE>
  78. <DD>
  79. Flags to be given to the C compiler when compiling programs (not when linking).
  80. <DT><CODE>CXX</CODE>
  81. <DD>
  82. Specifies the C++ compiler.
  83. <DT><CODE>CXXFLAGS</CODE>
  84. <DD>
  85. Flags to be given to the C++ compiler when compiling programs (not when linking).
  86. </DL>
  87. <P>
  88. Examples:
  89. <PRE>
  90. $ CC="gcc" CFLAGS="-O" CXX="g++" CXXFLAGS="-O" ./configure
  91. $ CC="gcc -V 2.7.2" CFLAGS="-O -g" \
  92. CXX="g++ -V 2.7.2" CXXFLAGS="-O -g" ./configure
  93. $ CC="gcc -V 2.8.1" CFLAGS="-O -fno-exceptions" \
  94. CXX="g++ -V 2.8.1" CXXFLAGS="-O -fno-exceptions" ./configure
  95. $ CC="gcc -V egcs-2.91.60" CFLAGS="-O2 -fno-exceptions" \
  96. CXX="g++ -V egcs-2.91.60" CFLAGS="-O2 -fno-exceptions" ./configure
  97. </PRE>
  98. <P>
  99. Note that for these environment variables to take effect, you have to set
  100. them (assuming a Bourne-compatible shell) on the same line as the
  101. <CODE>configure</CODE> command. If you made the settings in earlier shell
  102. commands, you have to <CODE>export</CODE> the environment variables before
  103. calling <CODE>configure</CODE>. In a <CODE>csh</CODE> shell, you have to use the
  104. <SAMP>`setenv'</SAMP> command for setting each of the environment variables.
  105. <P>
  106. On Linux, <CODE>g++</CODE> needs 15 MB to compile the tests. So you should better
  107. have 17 MB swap space and 1 MB room in $TMPDIR.
  108. <P>
  109. If you use <CODE>g++</CODE> version 2.7.x, don't add <SAMP>`-O2'</SAMP> to the CXXFLAGS,
  110. because <SAMP>`g++ -O'</SAMP> generates better code for CLN than <SAMP>`g++ -O2'</SAMP>.
  111. <P>
  112. If you use <CODE>g++</CODE> version 2.8.x or egcs-2.91.x (a.k.a. egcs-1.1) or
  113. gcc-2.95.x, I recommend adding <SAMP>`-fno-exceptions'</SAMP> to the CXXFLAGS.
  114. This will likely generate better code.
  115. <P>
  116. If you use <CODE>g++</CODE> version egcs-2.91.x (egcs-1.1) or gcc-2.95.x on Sparc,
  117. add either <SAMP>`-O'</SAMP> or <SAMP>`-O2 -fno-schedule-insns'</SAMP> to the CXXFLAGS.
  118. With full <SAMP>`-O2'</SAMP>, <CODE>g++</CODE> miscompiles the division routines. Also, for
  119. --enable-shared to work, you need egcs-1.1.2 or newer.
  120. <P>
  121. By default, only a static library is built. You can build CLN as a shared
  122. library too, by calling <CODE>configure</CODE> with the option <SAMP>`--enable-shared'</SAMP>.
  123. To get it built as a shared library only, call <CODE>configure</CODE> with the options
  124. <SAMP>`--enable-shared --disable-static'</SAMP>.
  125. <P>
  126. If you use <CODE>g++</CODE> version egcs-2.91.x (egcs-1.1) on Sparc, you cannot
  127. use <SAMP>`--enable-shared'</SAMP> because <CODE>g++</CODE> would miscompile parts of the
  128. library.
  129. <H3><A NAME="SEC8" HREF="cln_toc.html#TOC8">2.2.1 Using the GNU MP Library</A></H3>
  130. <P>
  131. <A NAME="IDX5"></A>
  132. <P>
  133. Starting with version 1.0.4, CLN may be configured to make use of a
  134. preinstalled <CODE>gmp</CODE> library. Please make sure that you have at
  135. least <CODE>gmp</CODE> version 3.0 installed since earlier versions are
  136. unsupported and likely not to work. Enabling this feature by calling
  137. <CODE>configure</CODE> with the option <SAMP>`--with-gmp'</SAMP> is known to be quite
  138. a boost for CLN's performance.
  139. <P>
  140. If you have installed the <CODE>gmp</CODE> library and its header file in
  141. some place where your compiler cannot find it by default, you must help
  142. <CODE>configure</CODE> by setting <CODE>CPPFLAGS</CODE> and <CODE>LDFLAGS</CODE>. Here is
  143. an example:
  144. <PRE>
  145. $ CC="gcc" CFLAGS="-O2" CXX="g++" CXXFLAGS="-O2 -fno-exceptions" \
  146. CPPFLAGS="-I/opt/gmp/include" LDFLAGS="-L/opt/gmp/lib" ./configure --with-gmp
  147. </PRE>
  148. <H2><A NAME="SEC9" HREF="cln_toc.html#TOC9">2.3 Installing the library</A></H2>
  149. <P>
  150. <A NAME="IDX6"></A>
  151. <P>
  152. As with any autoconfiguring GNU software, installation is as easy as this:
  153. <PRE>
  154. $ make install
  155. </PRE>
  156. <P>
  157. The <SAMP>`make install'</SAMP> command installs the library and the include files
  158. into public places (<TT>`/usr/local/lib/'</TT> and <TT>`/usr/local/include/'</TT>,
  159. if you haven't specified a <CODE>--prefix</CODE> option to <CODE>configure</CODE>).
  160. This step may require superuser privileges.
  161. <P>
  162. If you have already built the library and wish to install it, but didn't
  163. specify <CODE>--prefix=...</CODE> at configure time, just re-run
  164. <CODE>configure</CODE>, giving it the same options as the first time, plus
  165. the <CODE>--prefix=...</CODE> option.
  166. <H2><A NAME="SEC10" HREF="cln_toc.html#TOC10">2.4 Cleaning up</A></H2>
  167. <P>
  168. You can remove system-dependent files generated by <CODE>make</CODE> through
  169. <PRE>
  170. $ make clean
  171. </PRE>
  172. <P>
  173. You can remove all files generated by <CODE>make</CODE>, thus reverting to a
  174. virgin distribution of CLN, through
  175. <PRE>
  176. $ make distclean
  177. </PRE>
  178. <P><HR><P>
  179. 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>.
  180. </BODY>
  181. </HTML>