blob: 8bf6fe0055de90762f5056635c27fc3b19b8fed1 [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
Petr Vorelb0098242020-03-17 19:58:19 +010022If you want to use auto configuration you also need autoconf-2.61+, automake-1.10+
23and pkg-config.
yaberauneya2d8710f2009-10-25 06:35:08 +000024
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
Petr Vorelb0098242020-03-17 19:58:19 +010038pkg-config can be downloaded from:
39- https://pkg-config.freedesktop.org/releases/
40
yaberauneyabf3aeec2009-11-07 01:30:29 +000041Configuration
yaberauneya2d8710f2009-10-25 06:35:08 +000042-------------------
Mike Frysingere168ad22014-06-18 01:55:46 -040043
Petr Vorel400ac9b2019-11-04 07:31:41 +010044Configuration requires autoconf:
yaberauneya2d8710f2009-10-25 06:35:08 +000045
Petr Vorel400ac9b2019-11-04 07:31:41 +010046 $ cd $TOP_SRCDIR
47 $ make autotools
48 $ mkdir -p $TOP_BUILDDIR
49 $ cd $TOP_BUILDDIR && ./configure # configure args go here, e.g. CC=$CC, LDFLAGS=$LDFLAGS, etc
yaberauneya2d8710f2009-10-25 06:35:08 +000050
51- $TOP_SRCDIR and $TOP_BUILDDIR are the same for in-build-tree scenarios.
52- $TOP_SRCDIR and $TOP_BUILDDIR differ for out-of-build-tree scenarios.
53
54See the In-build-tree and Out-of-build-tree sections below for more details on
Petr Vorel400ac9b2019-11-04 07:31:41 +010055what to do next.
yaberauneya2d8710f2009-10-25 06:35:08 +000056
57Compiling LTP
58-------------------
59
Garrett Cooper7c67a092010-08-05 06:28:15 -070060"What's in a Path?"
61-------------------
62
63Before getting started, you should make sure that your build directory and
64source directory are as basic as possible: no commas, colons, semicolons,
65spaces, etc. In fact, this is a relatively good rule of thumb when dealing
66with any [Gnu?] make based opensource project.
67
68We won't `fix' the `issues' associated with these particular set of build
69errors resulting from non-sane pathnames, because it would introduce unneeded
70complexity into the build system and would require non-trivial effort to fix
71and validate the third-party packages, and thus wouldn't be a sustainable
72model to follow.
73
74So, we apologize for the inconvenience, but using other characters like
75underscores and dashes should help when disambiguating words between build
76and source pathnames.
77
yaberauneya2d8710f2009-10-25 06:35:08 +000078In-build-tree
79-------------------
80In-build-tree support is when you build binaries (applications, binary objects)
81in the same directory where the source files reside.
82
Garrett Coopere5387ce2010-08-18 02:00:52 -070083 $ make all
84 $ make \
yaberauneya2d8710f2009-10-25 06:35:08 +000085 "DESTDIR=$SYSROOT" \
86 SKIP_IDCHECK=[0|1] \
87 install
88
89- Specifying DESTDIR is optional, but required when installing to a non-host
90 sysroot, as opposed to the host system's sysroot.
91- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd}
92 on the target system's sysroot.
subrata_modakaba85b92008-12-11 10:30:33 +000093
Cyril Hrubis70d7e8c2015-09-15 12:50:31 +020094If you get a build error, please report it to ltp@lists.linux.it with
subrata_modak40455172009-01-05 08:35:21 +000095following information,
96
yaberauneya2d8710f2009-10-25 06:35:08 +000097 1. The error output before the failure.
98 2. If you used configure:
Mike Frysingere168ad22014-06-18 01:55:46 -040099 i. include/config.h
yaberauneya2d8710f2009-10-25 06:35:08 +0000100 ii. include/mk/config.mk
101 iii. config.log
subrata_modak40455172009-01-05 08:35:21 +0000102
yaberauneya2d8710f2009-10-25 06:35:08 +0000103Out-of-build-tree
104-------------------
105Out-of-build-tree support is when you build binaries (applications, binary
106objects, generated files) outside of the directory where the source files
107reside. This is typically used when cross-compiling for multiple targets.
subrata_modak40455172009-01-05 08:35:21 +0000108
yaberauneya2d8710f2009-10-25 06:35:08 +0000109NOTE: This is by and large correctly implemented, but there are several corner
Garrett Cooperc41bb212010-02-24 13:24:15 -0800110cases, where this isn't implemented properly. Please see TODO for a list of
111items which need fixing in the LTP tree.
subrata_modakaba85b92008-12-11 10:30:33 +0000112
yaberauneya2d8710f2009-10-25 06:35:08 +0000113 $ mkdir "$OUT_OF_BUILD_TREE_DIR"
114 $ make \
115 -C "$OUT_OF_BUILD_TREE_DIR" \
116 -f "$TOP_SRCDIR/Makefile" \
117 "top_srcdir=$TOP_SRCDIR" \
118 "top_builddir=$OUT_OF_BUILD_TREE_DIR"
119 $ make \
120 -C "$OUT_OF_BUILD_TREE_DIR" \
121 -f "$TOP_SRCDIR/Makefile" \
122 "top_srcdir=$TOP_SRCDIR" \
123 "top_builddir=$OUT_OF_BUILD_TREE_DIR" \
124 "DESTDIR=$SYSROOT" \
125 SKIP_IDCHECK=[0|1]
126 install
127
128- Specifying DESTDIR is optional, but required when installing to a non-host
129 sysroot, as opposed to the host system's sysroot.
130- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd}
131 on the target system's sysroot.
alaffine15dd682000-05-08 20:31:30 +0000132
nstraz0312c252000-09-26 20:59:21 +0000133Quick Start
134-----------
whrb973f2b2000-05-05 19:34:50 +0000135
robbiew57404482001-09-19 16:11:23 +00001361> tar xzf ltp-XXXXXXXX.tar.gz
nstraz0312c252000-09-26 20:59:21 +00001372> cd ltp
yaberauneyabf3aeec2009-11-07 01:30:29 +00001383> ./configure
1394> make all
1405> make install
Garrett Cooperc41bb212010-02-24 13:24:15 -08001416> /opt/ltp/runltp
whrb973f2b2000-05-05 19:34:50 +0000142
yaberauneya934df0e2010-01-07 10:43:24 +0000143*NOTE:
144- LTP assumes the existence of the nobody, bin, and daemon users and their
Garrett Cooperc41bb212010-02-24 13:24:15 -0800145groups. If these IDs do not exist, certain tests will fail. The respective
146user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then
147its group ID should also be 99. The names of the groups are irrelevant.
148- The installation directory is /opt/ltp by default. Please see
149"Using autoconf" above and specify the appropriate path via --prefix.
150DESTDIR= is also honored for install and will install into $DESTDIR/$prefix,
151if you want to install into a chroot or a rootfs for instance.
whrb973f2b2000-05-05 19:34:50 +0000152
nstraz0312c252000-09-26 20:59:21 +0000153Detailed Installation
154---------------------
155
156Beyond the "Quick Start" instructions, there are only a few other things
157that should be done. The Linux Test Project build process uses a
158minimalist approach. There is a lot of room for improvement and
159contributions are welcome.
160
robbiewb6c5fe72001-09-18 20:44:30 +00001611. Log in as root.
162
1632. Untar the ltp tarball into a spare directory. There is not a
robbiewfc0708b2004-03-01 22:16:02 +0000164 standard location for it yet. We put it in our home directory
robbiew0eea3522004-02-05 17:33:10 +0000165 while we're working on it.
subrata_modakf43b3802009-08-28 05:33:40 +0000166 Note that the full path to this location must be accessible for
167 unprivileged users, as some tests are run as a different user than root.
168 Hence /root is not a good choice on several distributions.
nstraz0312c252000-09-26 20:59:21 +0000169
yaberauneya2d8710f2009-10-25 06:35:08 +00001703. Build and install everything, as described above. Note the minimum software
171 requirements above before doing so.
nstraz0312c252000-09-26 20:59:21 +0000172
Xiao Yang3b3a8422016-11-14 17:55:09 +08001734. The disk I/O tests can be run by executing the diskio.sh script. In order
robbiewba422042001-09-19 15:25:43 +0000174 for these tests to successfully operate a writable high-density 3.5" floppy
175 must be in the disk drive and a CD-ROM with more than 100Mb of data must be
176 in the CD-ROM drive. The corresponding tests will fail if either disk is
177 missing.
nstraz0312c252000-09-26 20:59:21 +0000178
Xiao Yang3b3a8422016-11-14 17:55:09 +08001795. The network tests are executed by running the network.sh script. The network
Petr Vorel751785e2016-11-10 12:54:39 +0100180 tests require some configuration for them to work correctly:
robbiewba422042001-09-19 15:25:43 +0000181
182 i) First, there MUST be another test machine setup to act as the server
183 to these client side tests. This machine MUST have the LTP installed
184 in the same exact location, i.e. if the client has /root/ltp, then the
185 server must have /root/ltp. This is required because certain tests
186 expect to find server files in certain locations. Make sure to compile
187 the LTP on this server machine also.
188
robbiew0eea3522004-02-05 17:33:10 +0000189 ii) Second, the server must be setup to allow the client to connect using
subrata_modak08978d22008-12-18 04:58:57 +0000190 the "r" commands, such as rsh. This is done by simply creating/editing
191 the ".rhosts" file under /root. Place the hostname of the client
192 machine in this file to allow root to remotely connect without the use
193 of a password. If server has the PAM system security tool, you need
194 to add the following lines to /etc/securetty:
195 rlogin
196 rsh
197 rexec
198 pts/0
199 pts/1
200 :
201 pts/9
robbiewba422042001-09-19 15:25:43 +0000202
robbiew0eea3522004-02-05 17:33:10 +0000203 iii) Next, certain services must be activated in order for certain tests to
robbiewba422042001-09-19 15:25:43 +0000204 execute. The following services are activated via inetd/xinetd:
205 rlogind
206 ftpd
207 telnetd
208 echo (stream)
209 fingerd
210 rshd
subrata_modak08978d22008-12-18 04:58:57 +0000211 Also, because certain RPC programs are tested, the "portmapper" daemon
212 MUST be started, as well as NFS server AND lock services.
robbiewba422042001-09-19 15:25:43 +0000213
Petr Vorel751785e2016-11-10 12:54:39 +0100214 iv) Finally, before running the network.sh script, two variables must be
215 set: The "RHOST" variable should be set to the hostname of the server.
216 The "PASSWD" variable should be set to root's password on the server
Petr Vorel5e69bdf2019-08-01 10:34:25 +0200217 machine. This is necessary for tests such as telnet01.sh and ftp01.sh.
robbiewba422042001-09-19 15:25:43 +0000218
Petr Vorel751785e2016-11-10 12:54:39 +0100219 You can now successfully execute the network.sh script.
subrata_modak08978d22008-12-18 04:58:57 +0000220
221 You can run the test category which you are interested in, -h option shows
222 the list of the test category:
Petr Vorel751785e2016-11-10 12:54:39 +0100223 # ./network.sh -h
vapier36ab22f2009-01-19 03:37:35 +0000224
Petr Vorel751785e2016-11-10 12:54:39 +0100225 For more info about howto run network.sh see testcases/network/README.md.
vapier36ab22f2009-01-19 03:37:35 +0000226
227Cross compiling
228---------------
229
Mike Frysingere168ad22014-06-18 01:55:46 -0400230To cross compile, you must specify the correct variables when running configure.
Petr Vorelf377faf2019-08-02 15:50:52 +0200231e.g. CC, LDFLAGS, etc...
vapier36ab22f2009-01-19 03:37:35 +0000232
Mike Frysingere168ad22014-06-18 01:55:46 -0400233After configure has run, it will generate include/mk/config.mk. You can tweak
234settings in there if need be, but you should not specificy settings on the
235command-line when running make.
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
Steven Jackson34a7c822017-01-16 16:41:07 +0000242Android Users
243-------------
244Specify ANDROID=1 when calling make. Many tests which would otherwise work are
245currently not built because they share a directory with an incompatible test.
246
247The shell scripts expect /bin/sh to exist, so create a symlink.
248
vapier36ab22f2009-01-19 03:37:35 +0000249Variables in Makefile
250----------------------
251
yaberauneya2d8710f2009-10-25 06:35:08 +0000252The conventions enforced are standard ones. Here's a quick summary:
vapier36ab22f2009-01-19 03:37:35 +0000253
yaberauneya2d8710f2009-10-25 06:35:08 +0000254CFLAGS - used when compiling/linking C code, e.g. -D_GNU_SOURCE (no CPPFLAGS!)
vapier36ab22f2009-01-19 03:37:35 +0000255
yaberauneya2d8710f2009-10-25 06:35:08 +0000256CPPFLAGS - used when preprocessor is run (so C/C++ compiling with $(CPP)
Garrett Coopere5387ce2010-08-18 02:00:52 -0700257 functions, e.g. -I$SYSROOT/usr/include -I$SYSROOT/include -I$SYSROOT
vapier36ab22f2009-01-19 03:37:35 +0000258
yaberauneya2d8710f2009-10-25 06:35:08 +0000259LDFLAGS - linker flags, e.g. "-L$SYSROOT/usr/lib" "-L$SYSROOT/lib". DO NOT
Garrett Coopere5387ce2010-08-18 02:00:52 -0700260 PUT LIBRARIES IN THIS LIST (see LDLIBS for that).
vapier36ab22f2009-01-19 03:37:35 +0000261
yaberauneya2d8710f2009-10-25 06:35:08 +0000262LDLIBS - libraries listed after objects during link, e.g. -lc, -lpthread,
Garrett Coopere5387ce2010-08-18 02:00:52 -0700263 -lltp.
vapier36ab22f2009-01-19 03:37:35 +0000264
yaberauneya2d8710f2009-10-25 06:35:08 +0000265See README.mk-devel for a more terse description of what's available.
yaberauneya9079a9f2009-11-05 08:38:40 +0000266
267Common Issues
268----------------------
269
yaberauneyacef79622009-11-12 11:57:37 +0000270Issue: When executing configure it says:
271
272checking for a BSD-compatible install... /usr/bin/install -c
273checking whether build environment is sane... yes
274checking for gawk... gawk
275checking whether make sets $(MAKE)... yes
276configure: error: cannot run /bin/sh ./config.sub
277
yaberauneya44cac8e2009-11-12 12:08:09 +0000278Solution: 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 +0000279
yaberauneya9079a9f2009-11-05 08:38:40 +0000280Issue: When executing make [all] it says:
281
282 " *** No rule to make target `/$*', needed by `pan-all'. Stop."
283
284Solution: You must upgrade to make 3.81. Please see the Requirements section above.
285
286Issue: When executing make [all] it says something like:
287
288 # ...
289 install -m 00644 "/scratch/ltp-dev2/ltp/include/test.h" "/scratch/ltp-install12/include/test.h"
290 install -m 00644 "/scratch/ltp-dev2/ltp/include/tlibio.h" "/scratch/ltp-install12/include/tlibio.h"
291 install -m 00644 "/scratch/ltp-dev2/ltp/include/usctest.h" "/scratch/ltp-install12/include/usctest.h"
292 install -m 00644 "/scratch/ltp-dev2/ltp/include/write_log.h" "/scratch/ltp-install12/include/write_log.h"
293 make[1]: Leaving directory `/scratch/ltp-dev2/ltp/include'
Chris Dearman37550cf2012-10-17 19:54:01 -0700294 make -C lib -f "/scratch/ltp-dev2/ltp/lib/Makefile" all
yaberauneya9079a9f2009-11-05 08:38:40 +0000295 make[1]: Entering directory `/scratch/ltp-dev2/ltp/lib'
296 " *** No rule to make target `dataascii.o', needed by `libltp.a'. Stop." # <-- the error
297
298Solution: You cannot build LTP with -r / --no-builtin-rules and/or
Garrett Coopere5387ce2010-08-18 02:00:52 -0700299 -R / --no-builtin-variables specified. LTP relies heavily on built-in
300 implicit rules and variables to function properly.
yaberauneya340292d2010-01-18 23:46:09 +0000301
302Issue: When executing make (no target, 3.80), it does the following, and doesn't execute all:
303
304 #
305 make -C testcases/realtime autotools
306 make[1]: Entering directory `/scratch/ltp/testcases/realtime'
307 autoheader
308 make[1]: Leaving directory `/scratch/ltp/testcases/realtime'