source: chapter02/hostreqs.xml@ ac82b96

xry111/clfs-ng
Last change on this file since ac82b96 was 9e76c64, checked in by Xi Ruoyao <xry111@…>, 5 months ago

Merge remote-tracking branch 'origin/trunk' into xry111/clfs-ng

  • Property mode set to 100644
File size: 7.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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-partitioning-hostreqs" xreflabel="Host System Requirements">
9 <?dbhtml filename="hostreqs.html"?>
10
11 <title>Host System Requirements</title>
12
13 <sect2>
14 <title>Hardware</title>
15
16 <para>The LFS editors recommend that the system CPU have at least
17 four cores and that the system have at least 8 GB of memory.
18
19 For the Cross Edition, it's recommended that both the system running
20 the host distribution and the target system should meet the
21 requirements.
22
23 Older systems that do not meet these requirements will still work,
24 but the time to build packages will be significantly longer
25 than documented.
26 </para>
27
28 </sect2>
29
30 <sect2>
31 <title>Software</title>
32
33 <para>Your host system should have the following software with the
34 minimum versions indicated. This should not be an issue for most
35 modern Linux distributions. Also note that many distributions will
36 place software headers into separate packages, often in the form of
37 <literal><replaceable>&lt;package-name&gt;</replaceable>-devel</literal>
38 or
39 <literal><replaceable>&lt;package-name&gt;</replaceable>-dev</literal>.
40 Be sure to install those if your distribution provides them.</para>
41
42 <para>Earlier versions of the listed software packages may work, but have
43 not been tested.</para>
44
45 <itemizedlist spacing="compact">
46
47 <listitem>
48 <para><emphasis role="strong">Bash-3.2</emphasis> (/bin/sh
49 should be a symbolic or hard link to bash)</para>
50 </listitem>
51
52 <listitem>
53 <para><emphasis role="strong">Binutils-2.13.1</emphasis> (Versions
54 greater than &binutils-version; are not recommended as they have
55 not been tested)</para>
56 </listitem>
57
58 <listitem>
59 <!-- needed to cross build the kernel in chapter 6 -->
60 <para><emphasis role="strong">Bc-1.07.0</emphasis></para>
61 </listitem>
62
63 <listitem>
64 <para><emphasis role="strong">Bison-2.7</emphasis> (/usr/bin/yacc
65 should be a link to bison or a small script that executes bison)</para>
66 </listitem>
67
68 <!-- In Coreutils-8.1 the nproc program is added. -->
69 <listitem>
70 <para><emphasis role="strong">Coreutils-8.1</emphasis></para>
71 </listitem>
72
73 <listitem>
74 <para><emphasis role="strong">Diffutils-2.8.1</emphasis></para>
75 </listitem>
76
77 <listitem>
78 <para><emphasis role="strong">Findutils-4.2.31</emphasis></para>
79 </listitem>
80
81 <listitem>
82 <para><emphasis role="strong">Gawk-4.0.1</emphasis> (/usr/bin/awk
83 should be a link to gawk)</para>
84 </listitem>
85
86 <listitem>
87 <!-- Pass 1 GCC FTBFS with GCC-5.1 because of
88 https://gcc.gnu.org/PR65801. -->
89 <para><emphasis role="strong">GCC-5.2</emphasis> including the C++
90 compiler, <command>g++</command> (Versions greater than &gcc-version; are
91 not recommended as they have not been tested). C and C++ standard
92 libraries (with headers) must also be present so the C++ compiler can
93 build hosted programs</para>
94 </listitem>
95
96 <listitem>
97 <para><emphasis role="strong">Grep-2.5.1a</emphasis></para>
98 </listitem>
99
100 <listitem>
101 <para><emphasis role="strong">Gzip-1.3.12</emphasis></para>
102 </listitem>
103
104 <listitem>
105 <para><emphasis role="strong">M4-1.4.10</emphasis></para>
106 </listitem>
107
108 <listitem>
109 <para><emphasis role="strong">Make-4.0</emphasis></para>
110 </listitem>
111
112 <listitem>
113 <para><emphasis role="strong">Patch-2.5.4</emphasis></para>
114 </listitem>
115
116 <listitem>
117 <para><emphasis role="strong">Perl-5.8.8</emphasis></para>
118 </listitem>
119
120 <listitem>
121 <para><emphasis role="strong">Python-3.4</emphasis></para>
122 </listitem>
123
124 <listitem>
125 <para><emphasis role="strong">Sed-4.1.5</emphasis></para>
126 </listitem>
127
128 <listitem>
129 <para><emphasis role="strong">Tar-1.22</emphasis></para>
130 </listitem>
131
132 <listitem>
133 <para><emphasis role="strong">Texinfo-5.0</emphasis></para>
134 </listitem>
135
136 <listitem>
137 <para><emphasis role="strong">Xz-5.0.0</emphasis></para>
138 </listitem>
139
140 </itemizedlist>
141
142 <important>
143 <para>Note that the symlinks mentioned above are required to build an LFS
144 system using the instructions contained within this book. Symlinks that
145 point to other software (such as dash, mawk, etc.) may work, but are not
146 tested or supported by the LFS development team, and may require either
147 deviation from the instructions or additional patches to some
148 packages.</para>
149 </important>
150
151 <!-- Use an empty sect2 element to prevent a pdf warning. -->
152 <bridgehead renderas="sect2"
153 id="version-check"
154 xreflabel="Host System Requirements">
155 </bridgehead>
156 <!--<title> </title>-->
157
158 <para >To see whether your host system has all the appropriate versions, and
159 the ability to compile programs, run the following commands:</para>
160
161<screen role="nodump"><?dbfo keep-together="auto"?><userinput>cat &gt; version-check.sh &lt;&lt; "EOF"
162<literal>#!/bin/bash
163# A script to list version numbers of critical development tools
164
165# If you have tools installed in other directories, adjust PATH here AND
166# in ~lfs/.bashrc (section 4.4) as well.
167
168LC_ALL=C
169PATH=/usr/bin:/bin
170
171bail() { echo "FATAL: $1"; exit 1; }
172grep --version > /dev/null 2> /dev/null || bail "grep does not work"
173sed '' /dev/null || bail "sed does not work"
174sort /dev/null || bail "sort does not work"
175
176ver_check()
177{
178 if ! type -p $2 &amp;>/dev/null
179 then
180 echo "ERROR: Cannot find $2 ($1)"; return 1;
181 fi
182 v=$($2 --version 2>&amp;1 | grep -E -o '[0-9]+\.[0-9\.]+[a-z]*' | head -n1)
183 if printf '%s\n' $3 $v | sort --version-sort --check &amp;>/dev/null
184 then
185 printf "OK: %-9s %-6s >= $3\n" "$1" "$v"; return 0;
186 else
187 printf "ERROR: %-9s is TOO OLD ($3 or later required)\n" "$1";
188 return 1;
189 fi
190}
191
192# Coreutils first because --version-sort needs Coreutils >= 7.0
193ver_check Coreutils sort 8.1 || bail "Coreutils too old, stop"
194ver_check Bash bash 3.2
195ver_check Bc bc 1.07.0
196ver_check Binutils ld 2.13.1
197ver_check Bison bison 2.7
198ver_check Diffutils diff 2.8.1
199ver_check Findutils find 4.2.31
200ver_check Gawk gawk 4.0.1
201ver_check GCC gcc 5.2
202ver_check "GCC (C++)" g++ 5.2
203ver_check Grep grep 2.5.1a
204ver_check Gzip gzip 1.3.12
205ver_check M4 m4 1.4.10
206ver_check Make make 4.0
207ver_check Patch patch 2.5.4
208ver_check Perl perl 5.8.8
209ver_check Python python3 3.4
210ver_check Sed sed 4.1.5
211ver_check Tar tar 1.22
212ver_check Texinfo texi2any 5.0
213ver_check Xz xz 5.0.0
214
215alias_check() {
216 if $1 --version 2>&amp;1 | grep -qi $2
217 then printf "OK: %-4s is $2\n" "$1";
218 else printf "ERROR: %-4s is NOT $2\n" "$1"; fi
219}
220echo "Aliases:"
221alias_check awk GNU
222alias_check yacc Bison
223alias_check sh Bash
224
225echo "Compiler check:"
226if printf "int main(){}" | g++ -x c++ -
227then echo "OK: g++ works";
228else echo "ERROR: g++ does NOT work"; fi
229rm -f a.out
230
231if [ "$(nproc)" = "" ]; then
232 echo "ERROR: nproc is not available or it produces empty output"
233else
234 echo "OK: nproc reports $(nproc) logical cores are available"
235fi</literal>
236EOF
237
238bash version-check.sh</userinput></screen>
239
240 </sect2>
241</sect1>
Note: See TracBrowser for help on using the repository browser.