source: chapter08/gmp.xml@ 32db906

multilib
Last change on this file since 32db906 was 3ecf6ae, checked in by Thomas Trepl <thomas@…>, 13 months ago

Merge branch 'trunk' into multilib

  • Property mode set to 100644
File size: 9.7 KB
RevLine 
[6cc0516]1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-gmp" role="wrap">
9 <?dbhtml filename="gmp.html"?>
10
11 <sect1info condition="script">
12 <productname>gmp</productname>
13 <productnumber>&gmp-version;</productnumber>
14 <address>&gmp-url;</address>
15 </sect1info>
16
17 <title>GMP-&gmp-version;</title>
18
19 <indexterm zone="ch-system-gmp">
20 <primary sortas="a-GMP">GMP</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The GMP package contains math libraries. These have useful functions
27 for arbitrary precision arithmetic.</para>
28
29 <segmentedlist>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
32
33 <seglistitem>
[6dfcfecc]34 <seg>&gmp-fin-sbu;</seg>
35 <seg>&gmp-fin-du;</seg>
[6cc0516]36 </seglistitem>
37 </segmentedlist>
38
39 </sect2>
40
41 <sect2 role="installation">
42 <title>Installation of GMP</title>
43
[e4eb4cce]44 <note>
[1018fd3]45 <para>If you are building for 32-bit x86, but you have a CPU which is
46 capable of running 64-bit code <emphasis>and</emphasis> you have specified
47 <envar>CFLAGS</envar> in the environment, the configure script will
48 attempt to configure for 64-bits and fail.
49 Avoid this by invoking the configure command below with
[b21778b]50<screen role="nodump"><userinput><parameter>ABI=32</parameter> ./configure ...</userinput></screen></para>
[e4eb4cce]51 </note>
52
[f63c0c3]53 <note>
54 <para>The default settings of GMP produce libraries optimized for
55 the host processor. If libraries suitable for processors less
[d672ab7]56 capable than the host's CPU are desired, generic libraries can be
[d0de26c]57 created by appending the <option>--host=none-linux-gnu</option> option
58 to the <command>configure</command> command.</para>
[f63c0c3]59
[d0de26c]60 <!-- To editors: the configure script says "the none host is obsolete,
61 use - -disable-assembly", but don't believe it: with the latter
62 CFLAGS is still automatically set to -march=something. -->
[f63c0c3]63 </note>
64
[6cc0516]65 <para>Prepare GMP for compilation:</para>
66
[73b2841]67<screen><userinput remap="configure">./configure --prefix=/usr \
68 --enable-cxx \
69 --disable-static \
[c296646]70 --docdir=/usr/share/doc/gmp-&gmp-version;</userinput></screen>
[6cc0516]71
[0bb67603]72 <variablelist>
[f1994dc]73 <title>The meaning of the new configure options:</title>
[0bb67603]74
75 <varlistentry>
76 <term><parameter>--enable-cxx</parameter></term>
77 <listitem>
78 <para>This parameter enables C++ support</para>
79 </listitem>
80 </varlistentry>
81
[b06fc9c]82 <varlistentry>
[94ea3c4]83 <term><parameter>--docdir=/usr/share/doc/gmp-&gmp-version;</parameter></term>
[b06fc9c]84 <listitem>
85 <para>This variable specifies the correct place for the
86 documentation.</para>
87 </listitem>
88 </varlistentry>
89
[0bb67603]90 </variablelist>
91
[b06fc9c]92 <para>Compile the package and generate the HTML documentation:</para>
[6cc0516]93
[b06fc9c]94<screen><userinput remap="make">make
95make html</userinput></screen>
[6cc0516]96
97 <important>
98 <para>The test suite for GMP in this section is considered critical.
99 Do not skip it under any circumstances.</para>
100 </important>
101
102 <para>Test the results:</para>
103
[10d231d]104<screen><userinput remap="test">make check 2>&amp;1 | tee gmp-check-log</userinput></screen>
[d672ab7]105
[98bed7f]106 <caution><para>The code in gmp is highly optimized for the processor where
[1118b17]107 it is built. Occasionally, the code that detects the processor misidentifies
[98bed7f]108 the system capabilities and there will be errors in the tests or other
109 applications using the gmp libraries with the message "Illegal
110 instruction". In this case, gmp should be reconfigured with the option
[d0de26c]111 <option>--host=none-linux-gnu</option> and rebuilt.</para></caution>
[10d231d]112
[be5b2e0]113 <para>Ensure that all 199 tests in the test suite passed.
[98d78cf]114 Check the results by issuing the following command:</para>
[10d231d]115
[53366411]116<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
[10d231d]117
[b06fc9c]118 <para>Install the package and its documentation:</para>
[e7c8034]119
[b06fc9c]120<screen><userinput remap="install">make install
121make install-html</userinput></screen>
[6cc0516]122
[e7c8034]123 </sect2>
[6cc0516]124
[6dfcfecc]125 <!-- - - - - - - - - - -->
126 <!-- Multilib - 32bit -->
127 <!-- - - - - - - - - - -->
128
[fd48baa]129 <sect2 arch="ml_32,ml_all" role="installation">
[6dfcfecc]130 <title>Installation of GMP - 32bit</title>
[b3f1ebb3]131
132 <para>Clean previous build:</para>
133
134<screen><userinput remap="pre">make distclean</userinput></screen>
135
136 <para>Generic libraries can be created by running
137 the following:</para>
138
[2d66549]139<screen role="nodump"><userinput remap="pre">cp -v configfsf.guess config.guess
[b3f1ebb3]140cp -v configfsf.sub config.sub</userinput></screen>
141
142 <para>Prepare GMP for compilation:</para>
143
144<screen><userinput remap="configure">ABI="32" \
[6dfcfecc]145CFLAGS="-m32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=i686" \
146CXXFLAGS="$CFLAGS" \
[0ebda11]147PKG_CONFIG_PATH="/usr/lib32/pkgconfig" \
[70aadfb]148./configure \
149 --host=i686-pc-linux-gnu \
150 --prefix=/usr \
151 --disable-static \
152 --enable-cxx \
153 --libdir=/usr/lib32 \
[0ebda11]154 --includedir=/usr/include/m32/gmp</userinput></screen>
[6dfcfecc]155
156 <variablelist>
157 <title>The meaning of the new configure options:</title>
158
159 <varlistentry>
[0ebda11]160 <term><parameter>--includedir=/usr/include/m32/gmp</parameter></term>
[6dfcfecc]161 <listitem>
162 <para>Some definitions in gmp.h differs for each arch but
163 has same name. Therefore, the headers must be separated from
164 each other.</para>
165 </listitem>
166 </varlistentry>
167
168 </variablelist>
[b3f1ebb3]169
170 <para>Compile the package:</para>
171
[6dfcfecc]172<screen><userinput remap="make">sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile
173make</userinput></screen>
[b3f1ebb3]174
175 <important>
176 <para>The test suite for GMP in this section is considered critical.
177 Do not skip it under any circumstances.</para>
178 </important>
179
180 <para>Test the results:</para>
181
182<screen><userinput remap="test">make check 2>&amp;1 | tee gmp-check-log</userinput></screen>
183
[6dfcfecc]184 <para>Ensure that all 197 tests in the test suite passed.
[b3f1ebb3]185 Check the results by issuing the following command:</para>
186
187<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
188
189 <para>Install the package:</para>
190
191<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
[0ebda11]192cp -Rv DESTDIR/usr/lib32/* /usr/lib32
193cp -Rv DESTDIR/usr/include/m32/* /usr/include/m32/
[b3f1ebb3]194rm -rf DESTDIR</userinput></screen>
195
[6dfcfecc]196 </sect2><!-- m32 -->
197
198 <!-- - - - - - - - - - -->
199 <!-- Multilib - x32bit -->
200 <!-- - - - - - - - - - -->
201
[fd48baa]202 <sect2 arch="ml_x32,ml_all" role="installation">
[b3f1ebb3]203 <title>Installation of GMP - x32-bit</title>
204
205 <para>Clean previous build:</para>
206
207<screen><userinput remap="pre">make distclean</userinput></screen>
208
209 <para>Generic libraries can be created by running
210 the following:</para>
211
[2d66549]212<screen role="nodump"><userinput remap="pre">cp -v configfsf.guess config.guess
[b3f1ebb3]213cp -v configfsf.sub config.sub</userinput></screen>
214
215 <para>Prepare GMP for compilation:</para>
216
217<screen><userinput remap="configure">ABI="x32" \
[6dfcfecc]218CFLAGS="-mx32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=x86-64" \
219CXXFLAGS="$CFLAGS" \
[0ebda11]220PKG_CONFIG_PATH="/usr/libx32/pkgconfig" \
[70aadfb]221./configure \
222 --host=x86_64-pc-linux-gnux32 \
223 --prefix=/usr \
224 --disable-static \
225 --enable-cxx \
226 --libdir=/usr/libx32 \
[0ebda11]227 --includedir=/usr/include/mx32/gmp</userinput></screen>
[b3f1ebb3]228
229 <para>Compile the package:</para>
230
[6dfcfecc]231<screen><userinput remap="make">sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile
232make</userinput></screen>
[b3f1ebb3]233
234 <important>
235 <para>The test suite for GMP in this section is considered critical.
236 Do not skip it under any circumstances.</para>
237 </important>
238
239 <para>Test the results:</para>
240
241<screen><userinput remap="test">make check 2>&amp;1 | tee gmp-check-log</userinput></screen>
242
[6dfcfecc]243 <para>Ensure that all 197 tests in the test suite passed.
[b3f1ebb3]244 Check the results by issuing the following command:</para>
245
246<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
247
248 <para>Install the package:</para>
249
250<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
[0ebda11]251cp -Rv DESTDIR/usr/libx32/* /usr/libx32
252cp -Rv DESTDIR/usr/include/mx32/* /usr/include/mx32/
[b3f1ebb3]253rm -rf DESTDIR</userinput></screen>
254
[6dfcfecc]255 </sect2><!-- mx32 -->
256
[6cc0516]257 <sect2 id="contents-gmp" role="content">
258 <title>Contents of GMP</title>
259
260 <segmentedlist>
261 <segtitle>Installed Libraries</segtitle>
[fe05b08]262 <segtitle>Installed directory</segtitle>
[6cc0516]263
264 <seglistitem>
[040ecb6]265 <seg>libgmp.so and libgmpxx.so</seg>
[fe05b08]266 <seg>/usr/share/doc/gmp-&gmp-version;</seg>
[6cc0516]267 </seglistitem>
268 </segmentedlist>
269
270 <variablelist>
271 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
272 <?dbfo list-presentation="list"?>
273 <?dbhtml list-presentation="table"?>
274
[0bb67603]275 <varlistentry id="libgmp">
[5f7456b]276 <term><filename class="libraryfile">libgmp</filename></term>
[6cc0516]277 <listitem>
[afba93b]278 <para>Contains precision math functions</para>
[0bb67603]279 <indexterm zone="ch-system-gmp libgmp">
280 <primary sortas="c-libgmp">libgmp</primary>
281 </indexterm>
282 </listitem>
283 </varlistentry>
284
285 <varlistentry id="libgmpxx">
[5f7456b]286 <term><filename class="libraryfile">libgmpxx</filename></term>
[0bb67603]287 <listitem>
[afba93b]288 <para>Contains C++ precision math functions</para>
[0bb67603]289 <indexterm zone="ch-system-gmp libgmpxx">
290 <primary sortas="c-libgmpxx">libgmpxx</primary>
291 </indexterm>
292 </listitem>
293 </varlistentry>
[6cc0516]294 </variablelist>
295
296 </sect2>
297
298</sect1>
Note: See TracBrowser for help on using the repository browser.