blob: c5b6d8c077813a5a37716f804e7de5b538729b36 [file] [log] [blame]
yaberauneyafbc90452009-11-06 18:21:37 +00001$Id: INSTALL,v 1.30 2009/11/06 18:21: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
61. In order to compile ltp YOU MUST have make 3.81+.
72. 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
37Configuring
38-------------------
39Using autoconf:
yaberauneya420ebba2009-10-25 10:44:14 +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
robbiew0eea3522004-02-05 17:33:10 +00001273> make
robbiew502f4ca2003-02-05 16:30:06 +00001284> make install
1295> ./runalltests.sh
whrb973f2b2000-05-05 19:34:50 +0000130
robbiew0eea3522004-02-05 17:33:10 +0000131*NOTE: The LTP assumes the existence of the nobody, bin, and daemon users and
132their groups. If these IDs do not exist, certain tests will fail. The users
133and groups IDs should be the same, i.e. if user "nobody" is 99, then it's
134group should also be "99". The names of the groups are irrelevant.
robbiew5be3ca52001-10-12 20:21:49 +0000135
whrb973f2b2000-05-05 19:34:50 +0000136
nstraz0312c252000-09-26 20:59:21 +0000137Detailed Installation
138---------------------
139
140Beyond the "Quick Start" instructions, there are only a few other things
141that should be done. The Linux Test Project build process uses a
142minimalist approach. There is a lot of room for improvement and
143contributions are welcome.
144
robbiewb6c5fe72001-09-18 20:44:30 +00001451. Log in as root.
146
1472. Untar the ltp tarball into a spare directory. There is not a
robbiewfc0708b2004-03-01 22:16:02 +0000148 standard location for it yet. We put it in our home directory
robbiew0eea3522004-02-05 17:33:10 +0000149 while we're working on it.
subrata_modakf43b3802009-08-28 05:33:40 +0000150 Note that the full path to this location must be accessible for
151 unprivileged users, as some tests are run as a different user than root.
152 Hence /root is not a good choice on several distributions.
nstraz0312c252000-09-26 20:59:21 +0000153
yaberauneya2d8710f2009-10-25 06:35:08 +00001543. Build and install everything, as described above. Note the minimum software
155 requirements above before doing so.
nstraz0312c252000-09-26 20:59:21 +0000156
yaberauneya2d8710f2009-10-25 06:35:08 +00001574. You can run all of the tests sequentially using the example test script
158 runalltests.sh. The script is provided to get you started.
subrata_modakdddeb902009-05-29 10:06:08 +0000159 See ltp-pan(1) for more information on the test driver we have provided.
robbiew0eea3522004-02-05 17:33:10 +0000160 It is simple, but it can do a lot of stuff.
robbiewb6c5fe72001-09-18 20:44:30 +0000161
robbiew0eea3522004-02-05 17:33:10 +0000162 NOTE: The diskio and network tests will NOT be run by the runalltests.sh
yaberauneya2d8710f2009-10-25 06:35:08 +0000163 script. They are separate from the other tests because of the additional
164 required setup overhead.
nstraz0312c252000-09-26 20:59:21 +0000165
yaberauneya2d8710f2009-10-25 06:35:08 +00001665. The disk I/O tests can be run by executing the diskio.sh script. In order
robbiewba422042001-09-19 15:25:43 +0000167 for these tests to successfully operate a writable high-density 3.5" floppy
168 must be in the disk drive and a CD-ROM with more than 100Mb of data must be
169 in the CD-ROM drive. The corresponding tests will fail if either disk is
170 missing.
nstraz0312c252000-09-26 20:59:21 +0000171
robbiewba422042001-09-19 15:25:43 +00001726. The network tests are executed by running the networktests.sh script. The
173 network tests require some configuration for them to work correctly:
174
175 i) First, there MUST be another test machine setup to act as the server
176 to these client side tests. This machine MUST have the LTP installed
177 in the same exact location, i.e. if the client has /root/ltp, then the
178 server must have /root/ltp. This is required because certain tests
179 expect to find server files in certain locations. Make sure to compile
180 the LTP on this server machine also.
181
robbiew0eea3522004-02-05 17:33:10 +0000182 ii) Second, the server must be setup to allow the client to connect using
subrata_modak08978d22008-12-18 04:58:57 +0000183 the "r" commands, such as rsh. This is done by simply creating/editing
184 the ".rhosts" file under /root. Place the hostname of the client
185 machine in this file to allow root to remotely connect without the use
186 of a password. If server has the PAM system security tool, you need
187 to add the following lines to /etc/securetty:
188 rlogin
189 rsh
190 rexec
191 pts/0
192 pts/1
193 :
194 pts/9
robbiewba422042001-09-19 15:25:43 +0000195
robbiew0eea3522004-02-05 17:33:10 +0000196 iii) Next, certain services must be activated in order for certain tests to
robbiewba422042001-09-19 15:25:43 +0000197 execute. The following services are activated via inetd/xinetd:
198 rlogind
199 ftpd
200 telnetd
201 echo (stream)
202 fingerd
203 rshd
subrata_modak08978d22008-12-18 04:58:57 +0000204 Also, because certain RPC programs are tested, the "portmapper" daemon
205 MUST be started, as well as NFS server AND lock services.
robbiewba422042001-09-19 15:25:43 +0000206
robbiew0eea3522004-02-05 17:33:10 +0000207 iv) Finally, before running the networktests.sh script, two variables must
subrata_modak08978d22008-12-18 04:58:57 +0000208 be set within the script file. The "RHOST" variable should be set to
209 the hostname of the server. The "PASSWD" variable should be set to
210 root's password on the server machine. This is necessary for tests
211 such as telnet01 and ftp01.
robbiewba422042001-09-19 15:25:43 +0000212
213 You can now successfully execute the networktests.sh script.
subrata_modak08978d22008-12-18 04:58:57 +0000214 When you would like to run the whole network tests, specify -w option:
215 # ./networktests.sh -w
216
217 When you would like to run the same tests which networktests.sh ran till
218 2008, specify no option or -d option:
219 # ./networktests.sh
220
221 You can run the test category which you are interested in, -h option shows
222 the list of the test category:
223 # ./netwoktests.sh -h
vapier36ab22f2009-01-19 03:37:35 +0000224
225
226Cross compiling
227---------------
228
yaberauneya2d8710f2009-10-25 06:35:08 +0000229To cross compile, you must specify the correct variables:
vapier36ab22f2009-01-19 03:37:35 +0000230
yaberauneya2d8710f2009-10-25 06:35:08 +00002311. When running configure (CC, CXX, CXXFLAGS, LDLIBS, etc).
2322. Manually edit include/mk/config.mk, as described in Configuration.
vapier36ab22f2009-01-19 03:37:35 +0000233
yaberauneya2d8710f2009-10-25 06:35:08 +0000234Note: Do not specify variables on the command-line. Use config.mk instead.
vapier36ab22f2009-01-19 03:37:35 +0000235
yaberauneya2d8710f2009-10-25 06:35:08 +0000236uClinux Users
237--------------
238Specify UCLINUX=1 when calling make; -DUCLINUX=1 use is deprecated and highly
239discouraged.
vapier36ab22f2009-01-19 03:37:35 +0000240
241Variables in Makefile
242----------------------
243
yaberauneya2d8710f2009-10-25 06:35:08 +0000244The conventions enforced are standard ones. Here's a quick summary:
vapier36ab22f2009-01-19 03:37:35 +0000245
yaberauneya2d8710f2009-10-25 06:35:08 +0000246CFLAGS - used when compiling/linking C code, e.g. -D_GNU_SOURCE (no CPPFLAGS!)
vapier36ab22f2009-01-19 03:37:35 +0000247
248CXXFLAGS - used when compiling/linking C++ code (no CPPFLAGS!)
249
yaberauneya2d8710f2009-10-25 06:35:08 +0000250CPPFLAGS - used when preprocessor is run (so C/C++ compiling with $(CPP)
251 functions, e.g. -I$SYSROOT/usr/include -I$SYSROOT/include -I$SYSROOT
vapier36ab22f2009-01-19 03:37:35 +0000252
yaberauneya2d8710f2009-10-25 06:35:08 +0000253LDFLAGS - linker flags, e.g. "-L$SYSROOT/usr/lib" "-L$SYSROOT/lib". DO NOT
254 PUT LIBRARIES IN THIS LIST (see LDLIBS for that).
vapier36ab22f2009-01-19 03:37:35 +0000255
yaberauneya2d8710f2009-10-25 06:35:08 +0000256LDLIBS - libraries listed after objects during link, e.g. -lc, -lpthread,
257 -lltp.
vapier36ab22f2009-01-19 03:37:35 +0000258
yaberauneya2d8710f2009-10-25 06:35:08 +0000259See README.mk-devel for a more terse description of what's available.
yaberauneya9079a9f2009-11-05 08:38:40 +0000260
261Common Issues
262----------------------
263
264Issue: When executing make [all] it says:
265
266 " *** No rule to make target `/$*', needed by `pan-all'. Stop."
267
268Solution: You must upgrade to make 3.81. Please see the Requirements section above.
269
270Issue: When executing make [all] it says something like:
271
272 # ...
273 install -m 00644 "/scratch/ltp-dev2/ltp/include/test.h" "/scratch/ltp-install12/include/test.h"
274 install -m 00644 "/scratch/ltp-dev2/ltp/include/tlibio.h" "/scratch/ltp-install12/include/tlibio.h"
275 install -m 00644 "/scratch/ltp-dev2/ltp/include/usctest.h" "/scratch/ltp-install12/include/usctest.h"
276 install -m 00644 "/scratch/ltp-dev2/ltp/include/write_log.h" "/scratch/ltp-install12/include/write_log.h"
277 make[1]: Leaving directory `/scratch/ltp-dev2/ltp/include'
278 make -C lib -f "/scratch/ltp-dev2/ltp/lib/Makefile" all
279 make[1]: Entering directory `/scratch/ltp-dev2/ltp/lib'
280 " *** No rule to make target `dataascii.o', needed by `libltp.a'. Stop." # <-- the error
281
282Solution: You cannot build LTP with -r / --no-builtin-rules and/or
283 -R / --no-builtin-variables specified. LTP relies heavily on built-in
284 implicit rules and variables to function properly.