source: chapter08/gmp.xml@ 70aadfb

ml-11.0 multilib
Last change on this file since 70aadfb was 70aadfb, checked in by Thomas Trepl (Moody) <thomas@…>, 3 years ago

Cosmetic rearrange options to appear more consistent

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