blob: 3d86415a93fe4f2abd25367e044f7d45a13e0309 [file] [log] [blame]
yaberauneya340292d2010-01-18 23:46:09 +00001$Id: INSTALL,v 1.36 2010/01/18 23:46:09 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
Garrett Cooper525c4d22010-02-22 10:11:46 -080061. In order to compile ltp you must have make 3.80+ (make 3.81 preferred).
yaberauneya340292d2010-01-18 23:46:09 +000072. In order to compile and use ltp-scanner (a utility in the pan directory),
8 you must have bison/yacc, and flex installed.
subrata_modak3960cc82009-01-20 10:47:29 +00009
yaberauneya2d8710f2009-10-25 06:35:08 +000010bison can be obtained here:
11- http://ftp.gnu.org/gnu/bison/bison-2.4.1.tar.gz
subrata_modak16147ad2009-01-21 11:30:52 +000012
yaberauneya2d8710f2009-10-25 06:35:08 +000013Berkeley yacc can be obtained here:
14- ftp://invisible-island.net/byacc/byacc.tar.gz
subrata_modak16147ad2009-01-21 11:30:52 +000015
yaberauneya2d8710f2009-10-25 06:35:08 +000016flex can be obtained here:
17- http://downloads.sourceforge.net/project/flex/flex/flex-2.5.33/flex-2.5.33.tar.bz2
subrata_modak3960cc82009-01-20 10:47:29 +000018
yaberauneya4f493d82009-11-03 16:12:12 +000019make 3.81 can be obtained here:
20- http://ftp.gnu.org/gnu/make/make-3.81.tar.bz2
21
yaberauneya2d8710f2009-10-25 06:35:08 +000022If you want to use auto configuration, be sure autoconf-2.61+ & automake-1.10+
23are installed.
24
25automake-1.10.2's sources can be downloaded from:
26- ftp://ftp.gnu.org/gnu/automake/automake-1.10.2.tar.bz2
27- ftp://ftp.gnu.org/gnu/automake/automake-1.10.2.tar.gz
28
29autoconf-2.61's sources can be downloaded from:
30- ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2
31- ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz
32
33autoconf-2.61 also requires m4-1.4.7+ be installed. Its sources can be
34downloaded from:
35- http://ftp.gnu.org/gnu/m4/m4-1.4.7.tar.bz2
36- http://ftp.gnu.org/gnu/m4/m4-1.4.7.tar.gz
37
yaberauneyabf3aeec2009-11-07 01:30:29 +000038Configuration
yaberauneya2d8710f2009-10-25 06:35:08 +000039-------------------
Mike Frysingere168ad22014-06-18 01:55:46 -040040
Petr Vorel400ac9b2019-11-04 07:31:41 +010041Configuration requires autoconf:
yaberauneya2d8710f2009-10-25 06:35:08 +000042
Petr Vorel400ac9b2019-11-04 07:31:41 +010043 $ cd $TOP_SRCDIR
44 $ make autotools
45 $ mkdir -p $TOP_BUILDDIR
46 $ cd $TOP_BUILDDIR && ./configure # configure args go here, e.g. CC=$CC, LDFLAGS=$LDFLAGS, etc
yaberauneya2d8710f2009-10-25 06:35:08 +000047
48- $TOP_SRCDIR and $TOP_BUILDDIR are the same for in-build-tree scenarios.
49- $TOP_SRCDIR and $TOP_BUILDDIR differ for out-of-build-tree scenarios.
50
51See the In-build-tree and Out-of-build-tree sections below for more details on
Petr Vorel400ac9b2019-11-04 07:31:41 +010052what to do next.
yaberauneya2d8710f2009-10-25 06:35:08 +000053
54Compiling LTP
55-------------------
56
Garrett Cooper7c67a092010-08-05 06:28:15 -070057"What's in a Path?"
58-------------------
59
60Before getting started, you should make sure that your build directory and
61source directory are as basic as possible: no commas, colons, semicolons,
62spaces, etc. In fact, this is a relatively good rule of thumb when dealing
63with any [Gnu?] make based opensource project.
64
65We won't `fix' the `issues' associated with these particular set of build
66errors resulting from non-sane pathnames, because it would introduce unneeded
67complexity into the build system and would require non-trivial effort to fix
68and validate the third-party packages, and thus wouldn't be a sustainable
69model to follow.
70
71So, we apologize for the inconvenience, but using other characters like
72underscores and dashes should help when disambiguating words between build
73and source pathnames.
74
yaberauneya2d8710f2009-10-25 06:35:08 +000075In-build-tree
76-------------------
77In-build-tree support is when you build binaries (applications, binary objects)
78in the same directory where the source files reside.
79
Garrett Coopere5387ce2010-08-18 02:00:52 -070080 $ make all
81 $ make \
yaberauneya2d8710f2009-10-25 06:35:08 +000082 "DESTDIR=$SYSROOT" \
83 SKIP_IDCHECK=[0|1] \
84 install
85
86- Specifying DESTDIR is optional, but required when installing to a non-host
87 sysroot, as opposed to the host system's sysroot.
88- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd}
89 on the target system's sysroot.
subrata_modakaba85b92008-12-11 10:30:33 +000090
Cyril Hrubis70d7e8c2015-09-15 12:50:31 +020091If you get a build error, please report it to ltp@lists.linux.it with
subrata_modak40455172009-01-05 08:35:21 +000092following information,
93
yaberauneya2d8710f2009-10-25 06:35:08 +000094 1. The error output before the failure.
95 2. If you used configure:
Mike Frysingere168ad22014-06-18 01:55:46 -040096 i. include/config.h
yaberauneya2d8710f2009-10-25 06:35:08 +000097 ii. include/mk/config.mk
98 iii. config.log
subrata_modak40455172009-01-05 08:35:21 +000099
yaberauneya2d8710f2009-10-25 06:35:08 +0000100Out-of-build-tree
101-------------------
102Out-of-build-tree support is when you build binaries (applications, binary
103objects, generated files) outside of the directory where the source files
104reside. This is typically used when cross-compiling for multiple targets.
subrata_modak40455172009-01-05 08:35:21 +0000105
yaberauneya2d8710f2009-10-25 06:35:08 +0000106NOTE: This is by and large correctly implemented, but there are several corner
Garrett Cooperc41bb212010-02-24 13:24:15 -0800107cases, where this isn't implemented properly. Please see TODO for a list of
108items which need fixing in the LTP tree.
subrata_modakaba85b92008-12-11 10:30:33 +0000109
yaberauneya2d8710f2009-10-25 06:35:08 +0000110 $ mkdir "$OUT_OF_BUILD_TREE_DIR"
111 $ make \
112 -C "$OUT_OF_BUILD_TREE_DIR" \
113 -f "$TOP_SRCDIR/Makefile" \
114 "top_srcdir=$TOP_SRCDIR" \
115 "top_builddir=$OUT_OF_BUILD_TREE_DIR"
116 $ make \
117 -C "$OUT_OF_BUILD_TREE_DIR" \
118 -f "$TOP_SRCDIR/Makefile" \
119 "top_srcdir=$TOP_SRCDIR" \
120 "top_builddir=$OUT_OF_BUILD_TREE_DIR" \
121 "DESTDIR=$SYSROOT" \
122 SKIP_IDCHECK=[0|1]
123 install
124
125- Specifying DESTDIR is optional, but required when installing to a non-host
126 sysroot, as opposed to the host system's sysroot.
127- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd}
128 on the target system's sysroot.
alaffine15dd682000-05-08 20:31:30 +0000129
nstraz0312c252000-09-26 20:59:21 +0000130Quick Start
131-----------
whrb973f2b2000-05-05 19:34:50 +0000132
robbiew57404482001-09-19 16:11:23 +00001331> tar xzf ltp-XXXXXXXX.tar.gz
nstraz0312c252000-09-26 20:59:21 +00001342> cd ltp
yaberauneyabf3aeec2009-11-07 01:30:29 +00001353> ./configure
1364> make all
1375> make install
Garrett Cooperc41bb212010-02-24 13:24:15 -08001386> /opt/ltp/runltp
whrb973f2b2000-05-05 19:34:50 +0000139
yaberauneya934df0e2010-01-07 10:43:24 +0000140*NOTE:
141- LTP assumes the existence of the nobody, bin, and daemon users and their
Garrett Cooperc41bb212010-02-24 13:24:15 -0800142groups. If these IDs do not exist, certain tests will fail. The respective
143user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then
144its group ID should also be 99. The names of the groups are irrelevant.
145- The installation directory is /opt/ltp by default. Please see
146"Using autoconf" above and specify the appropriate path via --prefix.
147DESTDIR= is also honored for install and will install into $DESTDIR/$prefix,
148if you want to install into a chroot or a rootfs for instance.
whrb973f2b2000-05-05 19:34:50 +0000149
nstraz0312c252000-09-26 20:59:21 +0000150Detailed Installation
151---------------------
152
153Beyond the "Quick Start" instructions, there are only a few other things
154that should be done. The Linux Test Project build process uses a
155minimalist approach. There is a lot of room for improvement and
156contributions are welcome.
157
robbiewb6c5fe72001-09-18 20:44:30 +00001581. Log in as root.
159
1602. Untar the ltp tarball into a spare directory. There is not a
robbiewfc0708b2004-03-01 22:16:02 +0000161 standard location for it yet. We put it in our home directory
robbiew0eea3522004-02-05 17:33:10 +0000162 while we're working on it.
subrata_modakf43b3802009-08-28 05:33:40 +0000163 Note that the full path to this location must be accessible for
164 unprivileged users, as some tests are run as a different user than root.
165 Hence /root is not a good choice on several distributions.
nstraz0312c252000-09-26 20:59:21 +0000166
yaberauneya2d8710f2009-10-25 06:35:08 +00001673. Build and install everything, as described above. Note the minimum software
168 requirements above before doing so.
nstraz0312c252000-09-26 20:59:21 +0000169
Xiao Yang3b3a8422016-11-14 17:55:09 +08001704. The disk I/O tests can be run by executing the diskio.sh script. In order
robbiewba422042001-09-19 15:25:43 +0000171 for these tests to successfully operate a writable high-density 3.5" floppy
172 must be in the disk drive and a CD-ROM with more than 100Mb of data must be
173 in the CD-ROM drive. The corresponding tests will fail if either disk is
174 missing.
nstraz0312c252000-09-26 20:59:21 +0000175
Xiao Yang3b3a8422016-11-14 17:55:09 +08001765. The network tests are executed by running the network.sh script. The network
Petr Vorel751785e2016-11-10 12:54:39 +0100177 tests require some configuration for them to work correctly:
robbiewba422042001-09-19 15:25:43 +0000178
179 i) First, there MUST be another test machine setup to act as the server
180 to these client side tests. This machine MUST have the LTP installed
181 in the same exact location, i.e. if the client has /root/ltp, then the
182 server must have /root/ltp. This is required because certain tests
183 expect to find server files in certain locations. Make sure to compile
184 the LTP on this server machine also.
185
robbiew0eea3522004-02-05 17:33:10 +0000186 ii) Second, the server must be setup to allow the client to connect using
subrata_modak08978d22008-12-18 04:58:57 +0000187 the "r" commands, such as rsh. This is done by simply creating/editing
188 the ".rhosts" file under /root. Place the hostname of the client
189 machine in this file to allow root to remotely connect without the use
190 of a password. If server has the PAM system security tool, you need
191 to add the following lines to /etc/securetty:
192 rlogin
193 rsh
194 rexec
195 pts/0
196 pts/1
197 :
198 pts/9
robbiewba422042001-09-19 15:25:43 +0000199
robbiew0eea3522004-02-05 17:33:10 +0000200 iii) Next, certain services must be activated in order for certain tests to
robbiewba422042001-09-19 15:25:43 +0000201 execute. The following services are activated via inetd/xinetd:
202 rlogind
203 ftpd
204 telnetd
205 echo (stream)
206 fingerd
207 rshd
subrata_modak08978d22008-12-18 04:58:57 +0000208 Also, because certain RPC programs are tested, the "portmapper" daemon
209 MUST be started, as well as NFS server AND lock services.
robbiewba422042001-09-19 15:25:43 +0000210
Petr Vorel751785e2016-11-10 12:54:39 +0100211 iv) Finally, before running the network.sh script, two variables must be
212 set: The "RHOST" variable should be set to the hostname of the server.
213 The "PASSWD" variable should be set to root's password on the server
Petr Vorel5e69bdf2019-08-01 10:34:25 +0200214 machine. This is necessary for tests such as telnet01.sh and ftp01.sh.
robbiewba422042001-09-19 15:25:43 +0000215
Petr Vorel751785e2016-11-10 12:54:39 +0100216 You can now successfully execute the network.sh script.
subrata_modak08978d22008-12-18 04:58:57 +0000217
218 You can run the test category which you are interested in, -h option shows
219 the list of the test category:
Petr Vorel751785e2016-11-10 12:54:39 +0100220 # ./network.sh -h
vapier36ab22f2009-01-19 03:37:35 +0000221
Petr Vorel751785e2016-11-10 12:54:39 +0100222 For more info about howto run network.sh see testcases/network/README.md.
vapier36ab22f2009-01-19 03:37:35 +0000223
224Cross compiling
225---------------
226
Mike Frysingere168ad22014-06-18 01:55:46 -0400227To cross compile, you must specify the correct variables when running configure.
Petr Vorelf377faf2019-08-02 15:50:52 +0200228e.g. CC, LDFLAGS, etc...
vapier36ab22f2009-01-19 03:37:35 +0000229
Mike Frysingere168ad22014-06-18 01:55:46 -0400230After configure has run, it will generate include/mk/config.mk. You can tweak
231settings in there if need be, but you should not specificy settings on the
232command-line when running make.
vapier36ab22f2009-01-19 03:37:35 +0000233
yaberauneya2d8710f2009-10-25 06:35:08 +0000234uClinux Users
235--------------
236Specify UCLINUX=1 when calling make; -DUCLINUX=1 use is deprecated and highly
237discouraged.
vapier36ab22f2009-01-19 03:37:35 +0000238
Steven Jackson34a7c822017-01-16 16:41:07 +0000239Android Users
240-------------
241Specify ANDROID=1 when calling make. Many tests which would otherwise work are
242currently not built because they share a directory with an incompatible test.
243
244The shell scripts expect /bin/sh to exist, so create a symlink.
245
vapier36ab22f2009-01-19 03:37:35 +0000246Variables in Makefile
247----------------------
248
yaberauneya2d8710f2009-10-25 06:35:08 +0000249The conventions enforced are standard ones. Here's a quick summary:
vapier36ab22f2009-01-19 03:37:35 +0000250
yaberauneya2d8710f2009-10-25 06:35:08 +0000251CFLAGS - used when compiling/linking C code, e.g. -D_GNU_SOURCE (no CPPFLAGS!)
vapier36ab22f2009-01-19 03:37:35 +0000252
yaberauneya2d8710f2009-10-25 06:35:08 +0000253CPPFLAGS - used when preprocessor is run (so C/C++ compiling with $(CPP)
Garrett Coopere5387ce2010-08-18 02:00:52 -0700254 functions, e.g. -I$SYSROOT/usr/include -I$SYSROOT/include -I$SYSROOT
vapier36ab22f2009-01-19 03:37:35 +0000255
yaberauneya2d8710f2009-10-25 06:35:08 +0000256LDFLAGS - linker flags, e.g. "-L$SYSROOT/usr/lib" "-L$SYSROOT/lib". DO NOT
Garrett Coopere5387ce2010-08-18 02:00:52 -0700257 PUT LIBRARIES IN THIS LIST (see LDLIBS for that).
vapier36ab22f2009-01-19 03:37:35 +0000258
yaberauneya2d8710f2009-10-25 06:35:08 +0000259LDLIBS - libraries listed after objects during link, e.g. -lc, -lpthread,
Garrett Coopere5387ce2010-08-18 02:00:52 -0700260 -lltp.
vapier36ab22f2009-01-19 03:37:35 +0000261
yaberauneya2d8710f2009-10-25 06:35:08 +0000262See README.mk-devel for a more terse description of what's available.
yaberauneya9079a9f2009-11-05 08:38:40 +0000263
264Common Issues
265----------------------
266
yaberauneyacef79622009-11-12 11:57:37 +0000267Issue: When executing configure it says:
268
269checking for a BSD-compatible install... /usr/bin/install -c
270checking whether build environment is sane... yes
271checking for gawk... gawk
272checking whether make sets $(MAKE)... yes
273configure: error: cannot run /bin/sh ./config.sub
274
yaberauneya44cac8e2009-11-12 12:08:09 +0000275Solution: You must upgrade autoconf to 0.10.2+ and m4 to 1.4.7+; config.guess and config.sub aren't necessarily generated with older revisions of the Gnu autotools chain.
yaberauneyacef79622009-11-12 11:57:37 +0000276
yaberauneya9079a9f2009-11-05 08:38:40 +0000277Issue: When executing make [all] it says:
278
279 " *** No rule to make target `/$*', needed by `pan-all'. Stop."
280
281Solution: You must upgrade to make 3.81. Please see the Requirements section above.
282
283Issue: When executing make [all] it says something like:
284
285 # ...
286 install -m 00644 "/scratch/ltp-dev2/ltp/include/test.h" "/scratch/ltp-install12/include/test.h"
287 install -m 00644 "/scratch/ltp-dev2/ltp/include/tlibio.h" "/scratch/ltp-install12/include/tlibio.h"
288 install -m 00644 "/scratch/ltp-dev2/ltp/include/usctest.h" "/scratch/ltp-install12/include/usctest.h"
289 install -m 00644 "/scratch/ltp-dev2/ltp/include/write_log.h" "/scratch/ltp-install12/include/write_log.h"
290 make[1]: Leaving directory `/scratch/ltp-dev2/ltp/include'
Chris Dearman37550cf2012-10-17 19:54:01 -0700291 make -C lib -f "/scratch/ltp-dev2/ltp/lib/Makefile" all
yaberauneya9079a9f2009-11-05 08:38:40 +0000292 make[1]: Entering directory `/scratch/ltp-dev2/ltp/lib'
293 " *** No rule to make target `dataascii.o', needed by `libltp.a'. Stop." # <-- the error
294
295Solution: You cannot build LTP with -r / --no-builtin-rules and/or
Garrett Coopere5387ce2010-08-18 02:00:52 -0700296 -R / --no-builtin-variables specified. LTP relies heavily on built-in
297 implicit rules and variables to function properly.
yaberauneya340292d2010-01-18 23:46:09 +0000298
299Issue: When executing make (no target, 3.80), it does the following, and doesn't execute all:
300
301 #
302 make -C testcases/realtime autotools
303 make[1]: Entering directory `/scratch/ltp/testcases/realtime'
304 autoheader
305 make[1]: Leaving directory `/scratch/ltp/testcases/realtime'