source: general/prog/python3.xml@ 41e68a2d

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 9.0 9.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 41e68a2d was 7c57f82, checked in by Ken Moffat <ken@…>, 5 years ago

Document some options for python3 and for libreoffice.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@21853 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 11.0 KB
RevLine 
[52d29f7]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[52d29f7]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[2cee003]7 <!ENTITY python3-download-http
[3f89ec5]8 "https://www.python.org/ftp/python/&python3-version;/Python-&python3-version;.tar.xz">
[355495ce]9 <!ENTITY python3-download-ftp " ">
[842348b0]10 <!ENTITY python3-md5sum "d33e4aae66097051c2eca45ee3604803">
[d373629]11 <!ENTITY python3-size "16 MB">
[842348b0]12 <!ENTITY python3-buildsize "180 MB (add 22 MB for tests)">
13 <!ENTITY python3-time "1.0 SBU (add 1.1 SBU for tests)">
[e882fc37]14 <!--
[73353e7f]15
16 Note: Size does not reflect docs that were install in LFS.
17
[2cee003]18 <!ENTITY python3htmldoc-download-http
[e882fc37]19 "https://docs.python.org/ftp/python/doc/&python3-version;/python-&python3-version;-docs-html.tar.bz2"> -->
[52d29f7]20]>
21
[b88be39]22<sect1 id="python3" xreflabel="Python-&python3-version;">
23 <?dbhtml filename="python3.html" ?>
[83f69e5d]24
25 <sect1info>
26 <othername>$LastChangedBy$</othername>
27 <date>$Date$</date>
28 </sect1info>
29
[b88be39]30 <title>Python-&python3-version;</title>
[83f69e5d]31
[b88be39]32 <indexterm zone="python3">
[03d30cf]33 <primary sortas="a-Python3">Python3</primary>
[83f69e5d]34 </indexterm>
35
36 <sect2 role="package">
[03d30cf]37 <title>Introduction to Python 3</title>
[83f69e5d]38
[355495ce]39 <para>
[03d30cf]40 The <application>Python 3</application> package contains the
[355495ce]41 <application>Python</application> development environment.
42 This is useful for object-oriented programming, writing scripts,
43 prototyping large programs or developing entire applications.
44 </para>
[48b816cb]45
[60ddbaf]46 <note><para><application>Python 3</application> was installed in LFS.
47 The only reason to rebuild it here is if optional modules
48 are needed.</para></note>
49
[ba4e992]50 &lfs84_checked;
[48b816cb]51
[83f69e5d]52 <bridgehead renderas="sect3">Package Information</bridgehead>
53 <itemizedlist spacing="compact">
54 <listitem>
[355495ce]55 <para>
56 Download (HTTP): <ulink url="&python3-download-http;"/>
57 </para>
[83f69e5d]58 </listitem>
59 <listitem>
[355495ce]60 <para>
61 Download (FTP): <ulink url="&python3-download-ftp;"/>
62 </para>
[83f69e5d]63 </listitem>
64 <listitem>
[355495ce]65 <para>
66 Download MD5 sum: &python3-md5sum;
67 </para>
[83f69e5d]68 </listitem>
69 <listitem>
[355495ce]70 <para>
71 Download size: &python3-size;
72 </para>
[83f69e5d]73 </listitem>
74 <listitem>
[355495ce]75 <para>
76 Estimated disk space required: &python3-buildsize;
77 </para>
[83f69e5d]78 </listitem>
79 <listitem>
[355495ce]80 <para>
81 Estimated build time: &python3-time;
82 </para>
[83f69e5d]83 </listitem>
84 </itemizedlist>
[e882fc37]85
[03d30cf]86 <bridgehead renderas="sect3">Python 3 Dependencies</bridgehead>
[e882fc37]87
[83f69e5d]88 <bridgehead renderas="sect4">Optional</bridgehead>
[355495ce]89 <para role="optional">
[7fe0ce3b]90 <xref linkend="bluez"/>,
[e882fc37]91 <xref linkend="gdb"/> (required for some tests),
92 <xref linkend="valgrind"/>, and
93 <ulink url="http://www.bytereef.org/mpdecimal">libmpcdec</ulink>
[355495ce]94 </para>
95
96 <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
97 <para role="optional">
[94b42903]98 <xref linkend="db"/> and
[dbc530b]99 <xref linkend="sqlite"/>
[355495ce]100 </para>
[ce33273]101
[1039de3]102 <para condition="html" role="usernotes">User Notes:
[355495ce]103 <ulink url="&blfs-wiki;/Python3"/>
104 </para>
[83f69e5d]105 </sect2>
106
107 <sect2 role="installation">
[03d30cf]108 <title>Installation of Python 3</title>
[83f69e5d]109
[355495ce]110 <para>
[03d30cf]111 Install <application>Python 3</application> by running the following
[355495ce]112 commands:
113 </para>
[83f69e5d]114
[fd69a62]115<screen><userinput>CXX="/usr/bin/g++" \
116./configure --prefix=/usr \
[c525bd1]117 --enable-shared \
[355495ce]118 --with-system-expat \
[fd69a62]119 --with-system-ffi \
[879932f]120 --with-ensurepip=yes &amp;&amp;
[83f69e5d]121make</userinput></screen>
122
[355495ce]123 <para>
[7fe0ce3b]124 The test suite must be run separately, using an X terminal (see below).
[355495ce]125 </para>
126
127 <para>
128 Now, as the <systemitem class="username">root</systemitem> user:
129 </para>
130
[82fac2c]131<screen role="root"><userinput>make install &amp;&amp;
[c525bd1]132chmod -v 755 /usr/lib/libpython&python3-majorver;m.so &amp;&amp;
[355495ce]133chmod -v 755 /usr/lib/libpython3.so</userinput></screen>
[1970f00]134
[7fe0ce3b]135 <para>
136 The test suite must be run separately from the build, either before or
[7745345d]137 after the package is built and installed. Do not run
[af8a78d]138 <command>make install</command> after running the test suite. To build
[7745345d]139 and install the package, you need to start with a fresh or clean source
[e882fc37]140 tree. For the tests, you also need a clean source code, so either start by
[7745345d]141 removing the source code directory and starting over, by uncompressing
142 the source tarball or by running <command>make clean</command>. Then
143 configure again, adding <quote>--with-pydebug</quote> to the
144 <command>configure</command> switches above, run <command>make</command>,
[d7d743f0]145 then <command>make test</command>. Remember that tests must be executed
[73353e7f]146 using an X terminal.
147 The test SBU highly depends on the speed of the internet connection.
[7fe0ce3b]148 </para>
149
[879d269]150 </sect2>
151
152 <sect2 role="commands">
153 <title>Command Explanations</title>
154
[fd69a62]155 <para>
156 <command> CXX="/usr/bin/g++" ./configure ...</command>: Avoid an annoying
157 message during configuration.
158 </para>
159
[355495ce]160 <para>
[f1d7196]161 <parameter>--with-system-expat</parameter>: This switch enables linking
162 against the system version of <application>Expat</application>.
[355495ce]163 </para>
164
165 <para>
[f1d7196]166 <parameter>--with-system-ffi</parameter>: This switch enables linking
[60ddbaf]167 against system version of <application>libffi</application>.
[82fac2c]168 </para>
[fd69a62]169
170 <para>
[23c5563]171 <parameter>--with-ensurepip=yes</parameter> : This switch enables building
172 <command>pip</command> and <command>setuptools</command> packaging programs.
173 <command>setuptools</command> is needed for building some Python modules.
[fd69a62]174 </para>
[82fac2c]175
[f1d7196]176 <para>
177 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
178 if you want to build <application>Python</application> DBM Module
179 against <application>Berkeley DB</application> instead of
180 <application>GDBM</application>.
181 </para>
182
[7c57f82]183 <para>
184 <option>--enable-optimization</option>: Use this switch
185 if you want to enable <emphasis>expensive</emphasis> optimizations (i.e.
186 Profile Guided Optimizations). This adds around 20 SBU, but can
187 <emphasis>slightly</emphasis> speed up some uses, such as using
188 <application>Sphinx</application> for creating documentation, or use of
189 <application>Python3</application> scripts.
190 </para>
191
192 <para>
193 <option>--with-lto</option>: This optional switch enables thick Link
194 Time Optimization. Unusually, it creates a much larger <filename
195 class="libraryfile">/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu/libpython3.7m.a</filename>
196 with a small increase in the time to compile
197 <application>Python</application>. Run-time results do not appear to show
198 any benefit from doing this.
199 </para>
200
[355495ce]201 <para>
[0d7900a]202 <command>chmod ...</command>: Fix permissions for shared libraries to be
[355495ce]203 consistent with other libraries.
204 </para>
[7224506]205
[879d269]206 </sect2>
207
208 <sect2 role="configuration">
[03d30cf]209 <title>Configuring Python 3</title>
[879d269]210
[355495ce]211 <para>
[03d30cf]212 In order for <command>python3</command> to find the installed
[d7015e7]213 documentation, create the following version independent symlink:
[355495ce]214 </para>
[1970f00]215
[d7015e7]216<screen role="root"><userinput>ln -svfn python-&python3-version; /usr/share/doc/python-3</userinput></screen>
217
218 <para>
219 and add the following environment variable to the individual user's or
220 system's profile:
221 </para>
222
223<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-3/html</userinput></screen>
[83f69e5d]224
225 </sect2>
226
227 <sect2 role="content">
228 <title>Contents</title>
229
230 <segmentedlist>
231 <segtitle>Installed Programs</segtitle>
232 <segtitle>Installed Libraries</segtitle>
233 <segtitle>Installed Directories</segtitle>
234
235 <seglistitem>
[355495ce]236 <seg>
[7fe0ce3b]237 2to3 (symlink),
[355495ce]238 2to3-&python3-majorver;,
239
[f5c5306]240 idle3 (symlink), and
241 idle&python3-majorver;
242
[7fe0ce3b]243 pydoc3 (symlink),
[355495ce]244 pydoc&python3-majorver;,
245
[7fe0ce3b]246 python3 (symlink);
247 python&python3-majorver; and python&python3-majorver;m (hardlinked);
[355495ce]248
[7fe0ce3b]249 python3-config (symlink),
250 python&python3-majorver;-config (symlink),
[c525bd1]251 python&python3-majorver;m-config,
[355495ce]252
[7fe0ce3b]253 pyvenv (symlink),
[41d241e]254 pyvenv-&python3-majorver;,
[355495ce]255 </seg>
256 <seg>
[47f0aa1]257 libpython&python3-majorver;m.so and libpython3.so
[355495ce]258 </seg>
259 <seg>
[c525bd1]260 /usr/include/python&python3-majorver;m,
[355495ce]261 /usr/lib/python&python3-majorver;, and
262 /usr/share/doc/python-&python3-version;
263 </seg>
[83f69e5d]264 </seglistitem>
265 </segmentedlist>
266
267 <variablelist>
268 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
269 <?dbfo list-presentation="list"?>
270 <?dbhtml list-presentation="table"?>
271
[355495ce]272 <varlistentry id="idle3">
273 <term><command>idle3</command></term>
[83f69e5d]274 <listitem>
[355495ce]275 <para>
[d0aecd33]276 is a wrapper script that opens a <application>Python</application>
277 aware GUI editor. For this script to run, you must have installed
278 <application>Tk</application> before Python so that the Tkinter
279 Python module is built.
[355495ce]280 </para>
281 <indexterm zone="python3 idle3">
282 <primary sortas="b-idle3">idle3</primary>
[83f69e5d]283 </indexterm>
284 </listitem>
285 </varlistentry>
286
[355495ce]287 <varlistentry id="pydoc3">
288 <term><command>pydoc3</command></term>
[83f69e5d]289 <listitem>
[355495ce]290 <para>
291 is the <application>Python</application> documentation
292 tool.
293 </para>
294 <indexterm zone="python3 pydoc3">
295 <primary sortas="b-pydoc3">pydo3c</primary>
[83f69e5d]296 </indexterm>
297 </listitem>
298 </varlistentry>
299
[b88be39]300 <varlistentry id="python3-prog">
[2cee003]301 <term><command>python3</command></term>
[83f69e5d]302 <listitem>
[355495ce]303 <para>
304 is an interpreted, interactive, object-oriented programming
305 language.
306 </para>
[b88be39]307 <indexterm zone="python3 python3-prog">
308 <primary sortas="b-python3">python3</primary>
[83f69e5d]309 </indexterm>
310 </listitem>
311 </varlistentry>
312
[f67f5387]313 <varlistentry id="python-ver">
[b88be39]314 <term><command>python&python3-majorver;</command></term>
[83f69e5d]315 <listitem>
[355495ce]316 <para>
317 is a version-specific name for the <command>python</command>
318 program.
319 </para>
[b88be39]320 <indexterm zone="python3 python-ver">
[2cee003]321 <primary
322 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
[83f69e5d]323 </indexterm>
324 </listitem>
325 </varlistentry>
326
[21e8edc]327 <varlistentry id="pyvenv">
328 <term><command>pyvenv</command></term>
329 <listitem>
330 <para>
331 creates virtual <application>Python</application> environments in
332 one or more target directories.
333 </para>
334 <indexterm zone="python3 pyvenv">
335 <primary
336 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
337 </indexterm>
338 </listitem>
339 </varlistentry>
340
[83f69e5d]341 </variablelist>
342
343 </sect2>
[f45b1953]344
345</sect1>
Note: See TracBrowser for help on using the repository browser.