source: chapter08/gmp.xml@ ea6fdf5

multilib
Last change on this file since ea6fdf5 was b2f0a207, checked in by Thomas Trepl <thomas@…>, 10 months ago

Automatic merge of trunk into multilib

  • Property mode set to 100644
File size: 9.8 KB
Line 
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>
34 <seg>&gmp-fin-sbu;</seg>
35 <seg>&gmp-fin-du;</seg>
36 </seglistitem>
37 </segmentedlist>
38
39 </sect2>
40
41 <sect2 role="installation">
42 <title>Installation of GMP</title>
43
44 <note>
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
50<screen role="nodump"><userinput><parameter>ABI=32</parameter> ./configure ...</userinput></screen></para>
51 </note>
52
53 <note>
54 <para>The default settings of GMP produce libraries optimized for
55 the host processor. If libraries suitable for processors less
56 capable than the host's CPU are desired, generic libraries can be
57 created by appending the <option>--host=none-linux-gnu</option> option
58 to the <command>configure</command> command.</para>
59
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. -->
63 </note>
64
65 <para>Prepare GMP for compilation:</para>
66
67<screen><userinput remap="configure">./configure --prefix=/usr \
68 --enable-cxx \
69 --disable-static \
70 --docdir=/usr/share/doc/gmp-&gmp-version;</userinput></screen>
71
72 <variablelist>
73 <title>The meaning of the new configure options:</title>
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
82 <varlistentry>
83 <term><parameter>--docdir=/usr/share/doc/gmp-&gmp-version;</parameter></term>
84 <listitem>
85 <para>This variable specifies the correct place for the
86 documentation.</para>
87 </listitem>
88 </varlistentry>
89
90 </variablelist>
91
92 <para>Compile the package and generate the HTML documentation:</para>
93
94<screen><userinput remap="make">make
95make html</userinput></screen>
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
104<screen><userinput remap="test">make check 2>&amp;1 | tee gmp-check-log</userinput></screen>
105
106 <caution><para>The code in gmp is highly optimized for the processor where
107 it is built. Occasionally, the code that detects the processor misidentifies
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
111 <option>--host=none-linux-gnu</option> and rebuilt.</para></caution>
112
113 <!-- Some tests PASS on a specific uarch but SKIP on other CPUs.
114 For example on K8 the following command outputs 200. -->
115 <para>Ensure that at least 199 tests in the test suite passed.
116 Check the results by issuing the following command:</para>
117
118<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
119
120 <para>Install the package and its documentation:</para>
121
122<screen><userinput remap="install">make install
123make install-html</userinput></screen>
124
125 </sect2>
126
127 <!-- - - - - - - - - - -->
128 <!-- Multilib - 32bit -->
129 <!-- - - - - - - - - - -->
130
131 <sect2 arch="ml_32,ml_all" role="installation">
132 <title>Installation of GMP - 32bit</title>
133
134 <para>Clean previous build:</para>
135
136<screen><userinput remap="pre">make distclean</userinput></screen>
137
138 <para>Generic libraries can be created by running
139 the following:</para>
140
141<screen role="nodump"><userinput remap="pre">cp -v configfsf.guess config.guess
142cp -v configfsf.sub config.sub</userinput></screen>
143
144 <para>Prepare GMP for compilation:</para>
145
146<screen><userinput remap="configure">ABI="32" \
147CFLAGS="-m32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=i686" \
148CXXFLAGS="$CFLAGS" \
149PKG_CONFIG_PATH="/usr/lib32/pkgconfig" \
150./configure \
151 --host=i686-pc-linux-gnu \
152 --prefix=/usr \
153 --disable-static \
154 --enable-cxx \
155 --libdir=/usr/lib32 \
156 --includedir=/usr/include/m32/gmp</userinput></screen>
157
158 <variablelist>
159 <title>The meaning of the new configure options:</title>
160
161 <varlistentry>
162 <term><parameter>--includedir=/usr/include/m32/gmp</parameter></term>
163 <listitem>
164 <para>Some definitions in gmp.h differs for each arch but
165 has same name. Therefore, the headers must be separated from
166 each other.</para>
167 </listitem>
168 </varlistentry>
169
170 </variablelist>
171
172 <para>Compile the package:</para>
173
174<screen><userinput remap="make">sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile
175make</userinput></screen>
176
177 <important>
178 <para>The test suite for GMP in this section is considered critical.
179 Do not skip it under any circumstances.</para>
180 </important>
181
182 <para>Test the results:</para>
183
184<screen><userinput remap="test">make check 2>&amp;1 | tee gmp-check-log</userinput></screen>
185
186 <para>Ensure that all 197 tests in the test suite passed.
187 Check the results by issuing the following command:</para>
188
189<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
190
191 <para>Install the package:</para>
192
193<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
194cp -Rv DESTDIR/usr/lib32/* /usr/lib32
195cp -Rv DESTDIR/usr/include/m32/* /usr/include/m32/
196rm -rf DESTDIR</userinput></screen>
197
198 </sect2><!-- m32 -->
199
200 <!-- - - - - - - - - - -->
201 <!-- Multilib - x32bit -->
202 <!-- - - - - - - - - - -->
203
204 <sect2 arch="ml_x32,ml_all" role="installation">
205 <title>Installation of GMP - x32-bit</title>
206
207 <para>Clean previous build:</para>
208
209<screen><userinput remap="pre">make distclean</userinput></screen>
210
211 <para>Generic libraries can be created by running
212 the following:</para>
213
214<screen role="nodump"><userinput remap="pre">cp -v configfsf.guess config.guess
215cp -v configfsf.sub config.sub</userinput></screen>
216
217 <para>Prepare GMP for compilation:</para>
218
219<screen><userinput remap="configure">ABI="x32" \
220CFLAGS="-mx32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=x86-64" \
221CXXFLAGS="$CFLAGS" \
222PKG_CONFIG_PATH="/usr/libx32/pkgconfig" \
223./configure \
224 --host=x86_64-pc-linux-gnux32 \
225 --prefix=/usr \
226 --disable-static \
227 --enable-cxx \
228 --libdir=/usr/libx32 \
229 --includedir=/usr/include/mx32/gmp</userinput></screen>
230
231 <para>Compile the package:</para>
232
233<screen><userinput remap="make">sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile
234make</userinput></screen>
235
236 <important>
237 <para>The test suite for GMP in this section is considered critical.
238 Do not skip it under any circumstances.</para>
239 </important>
240
241 <para>Test the results:</para>
242
243<screen><userinput remap="test">make check 2>&amp;1 | tee gmp-check-log</userinput></screen>
244
245 <para>Ensure that all 197 tests in the test suite passed.
246 Check the results by issuing the following command:</para>
247
248<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
249
250 <para>Install the package:</para>
251
252<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
253cp -Rv DESTDIR/usr/libx32/* /usr/libx32
254cp -Rv DESTDIR/usr/include/mx32/* /usr/include/mx32/
255rm -rf DESTDIR</userinput></screen>
256
257 </sect2><!-- mx32 -->
258
259 <sect2 id="contents-gmp" role="content">
260 <title>Contents of GMP</title>
261
262 <segmentedlist>
263 <segtitle>Installed libraries</segtitle>
264 <segtitle>Installed directory</segtitle>
265
266 <seglistitem>
267 <seg>libgmp.so and libgmpxx.so</seg>
268 <seg>/usr/share/doc/gmp-&gmp-version;</seg>
269 </seglistitem>
270 </segmentedlist>
271
272 <variablelist>
273 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
274 <?dbfo list-presentation="list"?>
275 <?dbhtml list-presentation="table"?>
276
277 <varlistentry id="libgmp">
278 <term><filename class="libraryfile">libgmp</filename></term>
279 <listitem>
280 <para>Contains precision math functions</para>
281 <indexterm zone="ch-system-gmp libgmp">
282 <primary sortas="c-libgmp">libgmp</primary>
283 </indexterm>
284 </listitem>
285 </varlistentry>
286
287 <varlistentry id="libgmpxx">
288 <term><filename class="libraryfile">libgmpxx</filename></term>
289 <listitem>
290 <para>Contains C++ precision math functions</para>
291 <indexterm zone="ch-system-gmp libgmpxx">
292 <primary sortas="c-libgmpxx">libgmpxx</primary>
293 </indexterm>
294 </listitem>
295 </varlistentry>
296 </variablelist>
297
298 </sect2>
299
300</sect1>
Note: See TracBrowser for help on using the repository browser.