source: chapter08/gmp.xml@ 9113316

multilib xry111/multilib
Last change on this file since 9113316 was f6a43f6, checked in by Thomas Trepl <thomas@…>, 8 months ago

Automatic merge of trunk into multilib

  • Property mode set to 100644
File size: 9.9 KB
RevLine 
[7152faa]1<?xml version="1.0" encoding="UTF-8"?>
[6cc0516]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,
[360fdfca]61 use - -disable-assembly," but don't believe it: with the latter
[d0de26c]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
[360fdfca]109 applications using the gmp libraries with the message
110 <computeroutput>Illegal instruction</computeroutput>.
111 In this case, gmp should be reconfigured with the option
[d0de26c]112 <option>--host=none-linux-gnu</option> and rebuilt.</para></caution>
[10d231d]113
[d78b550]114 <!-- Some tests PASS on a specific uarch but SKIP on other CPUs.
115 For example on K8 the following command outputs 200. -->
116 <para>Ensure that at least 199 tests in the test suite passed.
[98d78cf]117 Check the results by issuing the following command:</para>
[10d231d]118
[53366411]119<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
[10d231d]120
[b06fc9c]121 <para>Install the package and its documentation:</para>
[e7c8034]122
[b06fc9c]123<screen><userinput remap="install">make install
124make install-html</userinput></screen>
[6cc0516]125
[e7c8034]126 </sect2>
[6cc0516]127
[6dfcfecc]128 <!-- - - - - - - - - - -->
129 <!-- Multilib - 32bit -->
130 <!-- - - - - - - - - - -->
131
[fd48baa]132 <sect2 arch="ml_32,ml_all" role="installation">
[6dfcfecc]133 <title>Installation of GMP - 32bit</title>
[b3f1ebb3]134
135 <para>Clean previous build:</para>
136
137<screen><userinput remap="pre">make distclean</userinput></screen>
138
139 <para>Generic libraries can be created by running
140 the following:</para>
141
[2d66549]142<screen role="nodump"><userinput remap="pre">cp -v configfsf.guess config.guess
[b3f1ebb3]143cp -v configfsf.sub config.sub</userinput></screen>
144
145 <para>Prepare GMP for compilation:</para>
146
147<screen><userinput remap="configure">ABI="32" \
[6dfcfecc]148CFLAGS="-m32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=i686" \
149CXXFLAGS="$CFLAGS" \
[0ebda11]150PKG_CONFIG_PATH="/usr/lib32/pkgconfig" \
[70aadfb]151./configure \
152 --host=i686-pc-linux-gnu \
153 --prefix=/usr \
154 --disable-static \
155 --enable-cxx \
156 --libdir=/usr/lib32 \
[0ebda11]157 --includedir=/usr/include/m32/gmp</userinput></screen>
[6dfcfecc]158
159 <variablelist>
160 <title>The meaning of the new configure options:</title>
161
162 <varlistentry>
[0ebda11]163 <term><parameter>--includedir=/usr/include/m32/gmp</parameter></term>
[6dfcfecc]164 <listitem>
165 <para>Some definitions in gmp.h differs for each arch but
166 has same name. Therefore, the headers must be separated from
167 each other.</para>
168 </listitem>
169 </varlistentry>
170
171 </variablelist>
[b3f1ebb3]172
173 <para>Compile the package:</para>
174
[6dfcfecc]175<screen><userinput remap="make">sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile
176make</userinput></screen>
[b3f1ebb3]177
178 <important>
179 <para>The test suite for GMP in this section is considered critical.
180 Do not skip it under any circumstances.</para>
181 </important>
182
183 <para>Test the results:</para>
184
185<screen><userinput remap="test">make check 2>&amp;1 | tee gmp-check-log</userinput></screen>
186
[6dfcfecc]187 <para>Ensure that all 197 tests in the test suite passed.
[b3f1ebb3]188 Check the results by issuing the following command:</para>
189
190<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
191
192 <para>Install the package:</para>
193
194<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
[0ebda11]195cp -Rv DESTDIR/usr/lib32/* /usr/lib32
196cp -Rv DESTDIR/usr/include/m32/* /usr/include/m32/
[b3f1ebb3]197rm -rf DESTDIR</userinput></screen>
198
[6dfcfecc]199 </sect2><!-- m32 -->
200
201 <!-- - - - - - - - - - -->
202 <!-- Multilib - x32bit -->
203 <!-- - - - - - - - - - -->
204
[fd48baa]205 <sect2 arch="ml_x32,ml_all" role="installation">
[b3f1ebb3]206 <title>Installation of GMP - x32-bit</title>
207
208 <para>Clean previous build:</para>
209
210<screen><userinput remap="pre">make distclean</userinput></screen>
211
212 <para>Generic libraries can be created by running
213 the following:</para>
214
[2d66549]215<screen role="nodump"><userinput remap="pre">cp -v configfsf.guess config.guess
[b3f1ebb3]216cp -v configfsf.sub config.sub</userinput></screen>
217
218 <para>Prepare GMP for compilation:</para>
219
220<screen><userinput remap="configure">ABI="x32" \
[6dfcfecc]221CFLAGS="-mx32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=x86-64" \
222CXXFLAGS="$CFLAGS" \
[0ebda11]223PKG_CONFIG_PATH="/usr/libx32/pkgconfig" \
[70aadfb]224./configure \
225 --host=x86_64-pc-linux-gnux32 \
226 --prefix=/usr \
227 --disable-static \
228 --enable-cxx \
229 --libdir=/usr/libx32 \
[0ebda11]230 --includedir=/usr/include/mx32/gmp</userinput></screen>
[b3f1ebb3]231
232 <para>Compile the package:</para>
233
[6dfcfecc]234<screen><userinput remap="make">sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile
235make</userinput></screen>
[b3f1ebb3]236
237 <important>
238 <para>The test suite for GMP in this section is considered critical.
239 Do not skip it under any circumstances.</para>
240 </important>
241
242 <para>Test the results:</para>
243
244<screen><userinput remap="test">make check 2>&amp;1 | tee gmp-check-log</userinput></screen>
245
[6dfcfecc]246 <para>Ensure that all 197 tests in the test suite passed.
[b3f1ebb3]247 Check the results by issuing the following command:</para>
248
249<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
250
251 <para>Install the package:</para>
252
253<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
[0ebda11]254cp -Rv DESTDIR/usr/libx32/* /usr/libx32
255cp -Rv DESTDIR/usr/include/mx32/* /usr/include/mx32/
[b3f1ebb3]256rm -rf DESTDIR</userinput></screen>
257
[6dfcfecc]258 </sect2><!-- mx32 -->
259
[6cc0516]260 <sect2 id="contents-gmp" role="content">
261 <title>Contents of GMP</title>
262
263 <segmentedlist>
[ab31b97]264 <segtitle>Installed libraries</segtitle>
[fe05b08]265 <segtitle>Installed directory</segtitle>
[6cc0516]266
267 <seglistitem>
[040ecb6]268 <seg>libgmp.so and libgmpxx.so</seg>
[fe05b08]269 <seg>/usr/share/doc/gmp-&gmp-version;</seg>
[6cc0516]270 </seglistitem>
271 </segmentedlist>
272
273 <variablelist>
274 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
275 <?dbfo list-presentation="list"?>
276 <?dbhtml list-presentation="table"?>
277
[0bb67603]278 <varlistentry id="libgmp">
[5f7456b]279 <term><filename class="libraryfile">libgmp</filename></term>
[6cc0516]280 <listitem>
[afba93b]281 <para>Contains precision math functions</para>
[0bb67603]282 <indexterm zone="ch-system-gmp libgmp">
283 <primary sortas="c-libgmp">libgmp</primary>
284 </indexterm>
285 </listitem>
286 </varlistentry>
287
288 <varlistentry id="libgmpxx">
[5f7456b]289 <term><filename class="libraryfile">libgmpxx</filename></term>
[0bb67603]290 <listitem>
[afba93b]291 <para>Contains C++ precision math functions</para>
[0bb67603]292 <indexterm zone="ch-system-gmp libgmpxx">
293 <primary sortas="c-libgmpxx">libgmpxx</primary>
294 </indexterm>
295 </listitem>
296 </varlistentry>
[6cc0516]297 </variablelist>
298
299 </sect2>
300
301</sect1>
Note: See TracBrowser for help on using the repository browser.