blob: cc0ace13dc5f4c763caca840203bba366b3266b9 [file] [log] [blame]
yaberauneyacef79622009-11-12 11:57:37 +00001$Id: INSTALL,v 1.33 2009/11/12 11:57:37 yaberauneya Exp $
subrata_modakaba85b92008-12-11 10:30:33 +00002
yaberauneya2d8710f2009-10-25 06:35:08 +00003Requirements
subrata_modakaba85b92008-12-11 10:30:33 +00004-------------------
yaberauneyafbc90452009-11-06 18:21:37 +00005
yaberauneya1513ca12009-11-06 18:23:01 +000061. In order to compile ltp you must have make 3.81+.
yaberauneyafbc90452009-11-06 18:21:37 +000072. In order to compile and use pan, you must have bison/yacc, and flex installed.
subrata_modak3960cc82009-01-20 10:47:29 +00008
yaberauneya2d8710f2009-10-25 06:35:08 +00009bison can be obtained here:
10- http://ftp.gnu.org/gnu/bison/bison-2.4.1.tar.gz
subrata_modak16147ad2009-01-21 11:30:52 +000011
yaberauneya2d8710f2009-10-25 06:35:08 +000012Berkeley yacc can be obtained here:
13- ftp://invisible-island.net/byacc/byacc.tar.gz
subrata_modak16147ad2009-01-21 11:30:52 +000014
yaberauneya2d8710f2009-10-25 06:35:08 +000015flex can be obtained here:
16- http://downloads.sourceforge.net/project/flex/flex/flex-2.5.33/flex-2.5.33.tar.bz2
subrata_modak3960cc82009-01-20 10:47:29 +000017
yaberauneya4f493d82009-11-03 16:12:12 +000018make 3.81 can be obtained here:
19- http://ftp.gnu.org/gnu/make/make-3.81.tar.bz2
20
yaberauneya2d8710f2009-10-25 06:35:08 +000021If you want to use auto configuration, be sure autoconf-2.61+ & automake-1.10+
22are installed.
23
24automake-1.10.2's sources can be downloaded from:
25- ftp://ftp.gnu.org/gnu/automake/automake-1.10.2.tar.bz2
26- ftp://ftp.gnu.org/gnu/automake/automake-1.10.2.tar.gz
27
28autoconf-2.61's sources can be downloaded from:
29- ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2
30- ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz
31
32autoconf-2.61 also requires m4-1.4.7+ be installed. Its sources can be
33downloaded from:
34- http://ftp.gnu.org/gnu/m4/m4-1.4.7.tar.bz2
35- http://ftp.gnu.org/gnu/m4/m4-1.4.7.tar.gz
36
yaberauneyabf3aeec2009-11-07 01:30:29 +000037Configuration
yaberauneya2d8710f2009-10-25 06:35:08 +000038-------------------
39Using autoconf:
yaberauneyabf3aeec2009-11-07 01:30:29 +000040 $ make autotools # This must be run from "$TOP_SRCDIR"!
yaberauneya2d8710f2009-10-25 06:35:08 +000041 $ test -d "$TOP_BUILDDIR" || mkdir -p "$TOP_BUILDDIR"
42 $ cd "$TOP_BUILDDIR" && "$TOP_SRCDIR/configure" \
43 # [configure args go here, e.g. CC=$CC, LDFLAGS=$LDFLAGS, etc]
44
45Not using autoconf:
46
47 $ test -d "$TOP_BUILDDIR" || mkdir -p "$TOP_BUILDDIR"
48 $ cp "$TOP_SRCDIR/include/config.h.default" \
49 "$TOP_BUILDDIR/include/config.h"
50 $ cp "$TOP_SRCDIR/include/mk/config.mk.default" \
51 "$TOP_BUILDDIR/include/mk/config.mk"
52
53 # Fire up your favorite editor and set each value appropriately in
54 # include/mk/config.mk. Uncomment all values commented out, such as
55 # NUMA_LIBS, etc, but only if you're sure that the libraries exist and
56 # can be linked on your system.
57
58- $TOP_SRCDIR and $TOP_BUILDDIR are the same for in-build-tree scenarios.
59- $TOP_SRCDIR and $TOP_BUILDDIR differ for out-of-build-tree scenarios.
60
61See the In-build-tree and Out-of-build-tree sections below for more details on
62what to do next...
63
64Compiling LTP
65-------------------
66
67In-build-tree
68-------------------
69In-build-tree support is when you build binaries (applications, binary objects)
70in the same directory where the source files reside.
71
72 $ make all
73 $ make \
74 "DESTDIR=$SYSROOT" \
75 SKIP_IDCHECK=[0|1] \
76 install
77
78- Specifying DESTDIR is optional, but required when installing to a non-host
79 sysroot, as opposed to the host system's sysroot.
80- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd}
81 on the target system's sysroot.
subrata_modakaba85b92008-12-11 10:30:33 +000082
subrata_modak40455172009-01-05 08:35:21 +000083If you get a build error, please report it to ltp-list@lists.sf.net with
84following information,
85
yaberauneya2d8710f2009-10-25 06:35:08 +000086 1. The error output before the failure.
87 2. If you used configure:
88 i. include/config.h
89 ii. include/mk/config.mk
90 iii. config.log
subrata_modak40455172009-01-05 08:35:21 +000091
yaberauneya2d8710f2009-10-25 06:35:08 +000092Out-of-build-tree
93-------------------
94Out-of-build-tree support is when you build binaries (applications, binary
95objects, generated files) outside of the directory where the source files
96reside. This is typically used when cross-compiling for multiple targets.
subrata_modak40455172009-01-05 08:35:21 +000097
yaberauneya2d8710f2009-10-25 06:35:08 +000098NOTE: This is by and large correctly implemented, but there are several corner
99case, where this isn't implemented properly. Please see TODO for a list of items
100which need fixing in the LTP tree.
subrata_modakaba85b92008-12-11 10:30:33 +0000101
yaberauneya2d8710f2009-10-25 06:35:08 +0000102 $ mkdir "$OUT_OF_BUILD_TREE_DIR"
103 $ make \
104 -C "$OUT_OF_BUILD_TREE_DIR" \
105 -f "$TOP_SRCDIR/Makefile" \
106 "top_srcdir=$TOP_SRCDIR" \
107 "top_builddir=$OUT_OF_BUILD_TREE_DIR"
108 $ make \
109 -C "$OUT_OF_BUILD_TREE_DIR" \
110 -f "$TOP_SRCDIR/Makefile" \
111 "top_srcdir=$TOP_SRCDIR" \
112 "top_builddir=$OUT_OF_BUILD_TREE_DIR" \
113 "DESTDIR=$SYSROOT" \
114 SKIP_IDCHECK=[0|1]
115 install
116
117- Specifying DESTDIR is optional, but required when installing to a non-host
118 sysroot, as opposed to the host system's sysroot.
119- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd}
120 on the target system's sysroot.
alaffine15dd682000-05-08 20:31:30 +0000121
nstraz0312c252000-09-26 20:59:21 +0000122Quick Start
123-----------
whrb973f2b2000-05-05 19:34:50 +0000124
robbiew57404482001-09-19 16:11:23 +00001251> tar xzf ltp-XXXXXXXX.tar.gz
nstraz0312c252000-09-26 20:59:21 +00001262> cd ltp
yaberauneyabf3aeec2009-11-07 01:30:29 +00001273> ./configure
1284> make all
1295> make install
1306> ./runalltests.sh
whrb973f2b2000-05-05 19:34:50 +0000131
robbiew0eea3522004-02-05 17:33:10 +0000132*NOTE: The LTP assumes the existence of the nobody, bin, and daemon users and
133their groups. If these IDs do not exist, certain tests will fail. The users
134and groups IDs should be the same, i.e. if user "nobody" is 99, then it's
135group should also be "99". The names of the groups are irrelevant.
robbiew5be3ca52001-10-12 20:21:49 +0000136
whrb973f2b2000-05-05 19:34:50 +0000137
nstraz0312c252000-09-26 20:59:21 +0000138Detailed Installation
139---------------------
140
141Beyond the "Quick Start" instructions, there are only a few other things
142that should be done. The Linux Test Project build process uses a
143minimalist approach. There is a lot of room for improvement and
144contributions are welcome.
145
robbiewb6c5fe72001-09-18 20:44:30 +00001461. Log in as root.
147
1482. Untar the ltp tarball into a spare directory. There is not a
robbiewfc0708b2004-03-01 22:16:02 +0000149 standard location for it yet. We put it in our home directory
robbiew0eea3522004-02-05 17:33:10 +0000150 while we're working on it.
subrata_modakf43b3802009-08-28 05:33:40 +0000151 Note that the full path to this location must be accessible for
152 unprivileged users, as some tests are run as a different user than root.
153 Hence /root is not a good choice on several distributions.
nstraz0312c252000-09-26 20:59:21 +0000154
yaberauneya2d8710f2009-10-25 06:35:08 +00001553. Build and install everything, as described above. Note the minimum software
156 requirements above before doing so.
nstraz0312c252000-09-26 20:59:21 +0000157
yaberauneya2d8710f2009-10-25 06:35:08 +00001584. You can run all of the tests sequentially using the example test script
159 runalltests.sh. The script is provided to get you started.
subrata_modakdddeb902009-05-29 10:06:08 +0000160 See ltp-pan(1) for more information on the test driver we have provided.
robbiew0eea3522004-02-05 17:33:10 +0000161 It is simple, but it can do a lot of stuff.
robbiewb6c5fe72001-09-18 20:44:30 +0000162
robbiew0eea3522004-02-05 17:33:10 +0000163 NOTE: The diskio and network tests will NOT be run by the runalltests.sh
yaberauneya2d8710f2009-10-25 06:35:08 +0000164 script. They are separate from the other tests because of the additional
165 required setup overhead.
nstraz0312c252000-09-26 20:59:21 +0000166
yaberauneya2d8710f2009-10-25 06:35:08 +00001675. The disk I/O tests can be run by executing the diskio.sh script. In order
robbiewba422042001-09-19 15:25:43 +0000168 for these tests to successfully operate a writable high-density 3.5" floppy
169 must be in the disk drive and a CD-ROM with more than 100Mb of data must be
170 in the CD-ROM drive. The corresponding tests will fail if either disk is
171 missing.
nstraz0312c252000-09-26 20:59:21 +0000172
robbiewba422042001-09-19 15:25:43 +00001736. The network tests are executed by running the networktests.sh script. The
174 network tests require some configuration for them to work correctly:
175
176 i) First, there MUST be another test machine setup to act as the server
177 to these client side tests. This machine MUST have the LTP installed
178 in the same exact location, i.e. if the client has /root/ltp, then the
179 server must have /root/ltp. This is required because certain tests
180 expect to find server files in certain locations. Make sure to compile
181 the LTP on this server machine also.
182
robbiew0eea3522004-02-05 17:33:10 +0000183 ii) Second, the server must be setup to allow the client to connect using
subrata_modak08978d22008-12-18 04:58:57 +0000184 the "r" commands, such as rsh. This is done by simply creating/editing
185 the ".rhosts" file under /root. Place the hostname of the client
186 machine in this file to allow root to remotely connect without the use
187 of a password. If server has the PAM system security tool, you need
188 to add the following lines to /etc/securetty:
189 rlogin
190 rsh
191 rexec
192 pts/0
193 pts/1
194 :
195 pts/9
robbiewba422042001-09-19 15:25:43 +0000196
robbiew0eea3522004-02-05 17:33:10 +0000197 iii) Next, certain services must be activated in order for certain tests to
robbiewba422042001-09-19 15:25:43 +0000198 execute. The following services are activated via inetd/xinetd:
199 rlogind
200 ftpd
201 telnetd
202 echo (stream)
203 fingerd
204 rshd
subrata_modak08978d22008-12-18 04:58:57 +0000205 Also, because certain RPC programs are tested, the "portmapper" daemon
206 MUST be started, as well as NFS server AND lock services.
robbiewba422042001-09-19 15:25:43 +0000207
robbiew0eea3522004-02-05 17:33:10 +0000208 iv) Finally, before running the networktests.sh script, two variables must
subrata_modak08978d22008-12-18 04:58:57 +0000209 be set within the script file. The "RHOST" variable should be set to
210 the hostname of the server. The "PASSWD" variable should be set to
211 root's password on the server machine. This is necessary for tests
212 such as telnet01 and ftp01.
robbiewba422042001-09-19 15:25:43 +0000213
214 You can now successfully execute the networktests.sh script.
subrata_modak08978d22008-12-18 04:58:57 +0000215 When you would like to run the whole network tests, specify -w option:
216 # ./networktests.sh -w
217
218 When you would like to run the same tests which networktests.sh ran till
219 2008, specify no option or -d option:
220 # ./networktests.sh
221
222 You can run the test category which you are interested in, -h option shows
223 the list of the test category:
224 # ./netwoktests.sh -h
vapier36ab22f2009-01-19 03:37:35 +0000225
226
227Cross compiling
228---------------
229
yaberauneya2d8710f2009-10-25 06:35:08 +0000230To cross compile, you must specify the correct variables:
vapier36ab22f2009-01-19 03:37:35 +0000231
yaberauneya2d8710f2009-10-25 06:35:08 +00002321. When running configure (CC, CXX, CXXFLAGS, LDLIBS, etc).
2332. Manually edit include/mk/config.mk, as described in Configuration.
vapier36ab22f2009-01-19 03:37:35 +0000234
yaberauneya2d8710f2009-10-25 06:35:08 +0000235Note: Do not specify variables on the command-line. Use config.mk instead.
vapier36ab22f2009-01-19 03:37:35 +0000236
yaberauneya2d8710f2009-10-25 06:35:08 +0000237uClinux Users
238--------------
239Specify UCLINUX=1 when calling make; -DUCLINUX=1 use is deprecated and highly
240discouraged.
vapier36ab22f2009-01-19 03:37:35 +0000241
242Variables in Makefile
243----------------------
244
yaberauneya2d8710f2009-10-25 06:35:08 +0000245The conventions enforced are standard ones. Here's a quick summary:
vapier36ab22f2009-01-19 03:37:35 +0000246
yaberauneya2d8710f2009-10-25 06:35:08 +0000247CFLAGS - used when compiling/linking C code, e.g. -D_GNU_SOURCE (no CPPFLAGS!)
vapier36ab22f2009-01-19 03:37:35 +0000248
249CXXFLAGS - used when compiling/linking C++ code (no CPPFLAGS!)
250
yaberauneya2d8710f2009-10-25 06:35:08 +0000251CPPFLAGS - used when preprocessor is run (so C/C++ compiling with $(CPP)
252 functions, e.g. -I$SYSROOT/usr/include -I$SYSROOT/include -I$SYSROOT
vapier36ab22f2009-01-19 03:37:35 +0000253
yaberauneya2d8710f2009-10-25 06:35:08 +0000254LDFLAGS - linker flags, e.g. "-L$SYSROOT/usr/lib" "-L$SYSROOT/lib". DO NOT
255 PUT LIBRARIES IN THIS LIST (see LDLIBS for that).
vapier36ab22f2009-01-19 03:37:35 +0000256
yaberauneya2d8710f2009-10-25 06:35:08 +0000257LDLIBS - libraries listed after objects during link, e.g. -lc, -lpthread,
258 -lltp.
vapier36ab22f2009-01-19 03:37:35 +0000259
yaberauneya2d8710f2009-10-25 06:35:08 +0000260See README.mk-devel for a more terse description of what's available.
yaberauneya9079a9f2009-11-05 08:38:40 +0000261
262Common Issues
263----------------------
264
yaberauneyacef79622009-11-12 11:57:37 +0000265Issue: When executing configure it says:
266
267checking for a BSD-compatible install... /usr/bin/install -c
268checking whether build environment is sane... yes
269checking for gawk... gawk
270checking whether make sets $(MAKE)... yes
271configure: error: cannot run /bin/sh ./config.sub
272
273Solution: You must upgrade m4 to 1.4.7+. 1.4.5 (at least) has known issues where it doesn't produce the config.sub file, unlike 1.4.7+.
274
yaberauneya9079a9f2009-11-05 08:38:40 +0000275Issue: When executing make [all] it says:
276
277 " *** No rule to make target `/$*', needed by `pan-all'. Stop."
278
279Solution: You must upgrade to make 3.81. Please see the Requirements section above.
280
281Issue: When executing make [all] it says something like:
282
283 # ...
284 install -m 00644 "/scratch/ltp-dev2/ltp/include/test.h" "/scratch/ltp-install12/include/test.h"
285 install -m 00644 "/scratch/ltp-dev2/ltp/include/tlibio.h" "/scratch/ltp-install12/include/tlibio.h"
286 install -m 00644 "/scratch/ltp-dev2/ltp/include/usctest.h" "/scratch/ltp-install12/include/usctest.h"
287 install -m 00644 "/scratch/ltp-dev2/ltp/include/write_log.h" "/scratch/ltp-install12/include/write_log.h"
288 make[1]: Leaving directory `/scratch/ltp-dev2/ltp/include'
289 make -C lib -f "/scratch/ltp-dev2/ltp/lib/Makefile" all
290 make[1]: Entering directory `/scratch/ltp-dev2/ltp/lib'
291 " *** No rule to make target `dataascii.o', needed by `libltp.a'. Stop." # <-- the error
292
293Solution: You cannot build LTP with -r / --no-builtin-rules and/or
294 -R / --no-builtin-variables specified. LTP relies heavily on built-in
295 implicit rules and variables to function properly.