blob: 39910e214037d77326a5662e099eeda03a92038a [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-------------------
40Using autoconf:
Garrett Coopere5387ce2010-08-18 02:00:52 -070041 $ make autotools # This must be run from "$TOP_SRCDIR"!
yaberauneya2d8710f2009-10-25 06:35:08 +000042 $ test -d "$TOP_BUILDDIR" || mkdir -p "$TOP_BUILDDIR"
Garrett Coopere5387ce2010-08-18 02:00:52 -070043 $ cd "$TOP_BUILDDIR" && "$TOP_SRCDIR/configure" \
yaberauneya2d8710f2009-10-25 06:35:08 +000044 # [configure args go here, e.g. CC=$CC, LDFLAGS=$LDFLAGS, etc]
45
46Not using autoconf:
47
48 $ test -d "$TOP_BUILDDIR" || mkdir -p "$TOP_BUILDDIR"
Garrett Coopere5387ce2010-08-18 02:00:52 -070049 $ cp "$TOP_SRCDIR/include/config.h.default" \
yaberauneya2d8710f2009-10-25 06:35:08 +000050 "$TOP_BUILDDIR/include/config.h"
Garrett Coopere5387ce2010-08-18 02:00:52 -070051 $ cp "$TOP_SRCDIR/include/mk/config.mk.default" \
yaberauneya2d8710f2009-10-25 06:35:08 +000052 "$TOP_BUILDDIR/include/mk/config.mk"
Garrett Cooper4f71cae2010-11-01 21:09:17 -070053 $ cp "$TOP_SRCDIR/include/mk/features.mk.default" \
54 "$TOP_BUILDDIR/include/mk/features.mk"
yaberauneya2d8710f2009-10-25 06:35:08 +000055
Garrett Coopere5387ce2010-08-18 02:00:52 -070056 # Fire up your favorite editor and set each value appropriately in
57 # include/mk/config.mk. Uncomment all values commented out, such as
yaberauneya2d8710f2009-10-25 06:35:08 +000058 # NUMA_LIBS, etc, but only if you're sure that the libraries exist and
59 # can be linked on your system.
60
61- $TOP_SRCDIR and $TOP_BUILDDIR are the same for in-build-tree scenarios.
62- $TOP_SRCDIR and $TOP_BUILDDIR differ for out-of-build-tree scenarios.
63
64See the In-build-tree and Out-of-build-tree sections below for more details on
65what to do next...
66
67Compiling LTP
68-------------------
69
Garrett Cooper7c67a092010-08-05 06:28:15 -070070"What's in a Path?"
71-------------------
72
73Before getting started, you should make sure that your build directory and
74source directory are as basic as possible: no commas, colons, semicolons,
75spaces, etc. In fact, this is a relatively good rule of thumb when dealing
76with any [Gnu?] make based opensource project.
77
78We won't `fix' the `issues' associated with these particular set of build
79errors resulting from non-sane pathnames, because it would introduce unneeded
80complexity into the build system and would require non-trivial effort to fix
81and validate the third-party packages, and thus wouldn't be a sustainable
82model to follow.
83
84So, we apologize for the inconvenience, but using other characters like
85underscores and dashes should help when disambiguating words between build
86and source pathnames.
87
yaberauneya2d8710f2009-10-25 06:35:08 +000088In-build-tree
89-------------------
90In-build-tree support is when you build binaries (applications, binary objects)
91in the same directory where the source files reside.
92
Garrett Coopere5387ce2010-08-18 02:00:52 -070093 $ make all
94 $ make \
yaberauneya2d8710f2009-10-25 06:35:08 +000095 "DESTDIR=$SYSROOT" \
96 SKIP_IDCHECK=[0|1] \
97 install
98
99- Specifying DESTDIR is optional, but required when installing to a non-host
100 sysroot, as opposed to the host system's sysroot.
101- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd}
102 on the target system's sysroot.
subrata_modakaba85b92008-12-11 10:30:33 +0000103
subrata_modak40455172009-01-05 08:35:21 +0000104If you get a build error, please report it to ltp-list@lists.sf.net with
105following information,
106
yaberauneya2d8710f2009-10-25 06:35:08 +0000107 1. The error output before the failure.
108 2. If you used configure:
109 i. include/config.h
110 ii. include/mk/config.mk
111 iii. config.log
subrata_modak40455172009-01-05 08:35:21 +0000112
yaberauneya2d8710f2009-10-25 06:35:08 +0000113Out-of-build-tree
114-------------------
115Out-of-build-tree support is when you build binaries (applications, binary
116objects, generated files) outside of the directory where the source files
117reside. This is typically used when cross-compiling for multiple targets.
subrata_modak40455172009-01-05 08:35:21 +0000118
yaberauneya2d8710f2009-10-25 06:35:08 +0000119NOTE: This is by and large correctly implemented, but there are several corner
Garrett Cooperc41bb212010-02-24 13:24:15 -0800120cases, where this isn't implemented properly. Please see TODO for a list of
121items which need fixing in the LTP tree.
subrata_modakaba85b92008-12-11 10:30:33 +0000122
yaberauneya2d8710f2009-10-25 06:35:08 +0000123 $ mkdir "$OUT_OF_BUILD_TREE_DIR"
124 $ make \
125 -C "$OUT_OF_BUILD_TREE_DIR" \
126 -f "$TOP_SRCDIR/Makefile" \
127 "top_srcdir=$TOP_SRCDIR" \
128 "top_builddir=$OUT_OF_BUILD_TREE_DIR"
129 $ make \
130 -C "$OUT_OF_BUILD_TREE_DIR" \
131 -f "$TOP_SRCDIR/Makefile" \
132 "top_srcdir=$TOP_SRCDIR" \
133 "top_builddir=$OUT_OF_BUILD_TREE_DIR" \
134 "DESTDIR=$SYSROOT" \
135 SKIP_IDCHECK=[0|1]
136 install
137
138- Specifying DESTDIR is optional, but required when installing to a non-host
139 sysroot, as opposed to the host system's sysroot.
140- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd}
141 on the target system's sysroot.
alaffine15dd682000-05-08 20:31:30 +0000142
nstraz0312c252000-09-26 20:59:21 +0000143Quick Start
144-----------
whrb973f2b2000-05-05 19:34:50 +0000145
robbiew57404482001-09-19 16:11:23 +00001461> tar xzf ltp-XXXXXXXX.tar.gz
nstraz0312c252000-09-26 20:59:21 +00001472> cd ltp
yaberauneyabf3aeec2009-11-07 01:30:29 +00001483> ./configure
1494> make all
1505> make install
Garrett Cooperc41bb212010-02-24 13:24:15 -08001516> /opt/ltp/runltp
whrb973f2b2000-05-05 19:34:50 +0000152
yaberauneya934df0e2010-01-07 10:43:24 +0000153*NOTE:
154- LTP assumes the existence of the nobody, bin, and daemon users and their
Garrett Cooperc41bb212010-02-24 13:24:15 -0800155groups. If these IDs do not exist, certain tests will fail. The respective
156user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then
157its group ID should also be 99. The names of the groups are irrelevant.
158- The installation directory is /opt/ltp by default. Please see
159"Using autoconf" above and specify the appropriate path via --prefix.
160DESTDIR= is also honored for install and will install into $DESTDIR/$prefix,
161if you want to install into a chroot or a rootfs for instance.
whrb973f2b2000-05-05 19:34:50 +0000162
nstraz0312c252000-09-26 20:59:21 +0000163Detailed Installation
164---------------------
165
166Beyond the "Quick Start" instructions, there are only a few other things
167that should be done. The Linux Test Project build process uses a
168minimalist approach. There is a lot of room for improvement and
169contributions are welcome.
170
robbiewb6c5fe72001-09-18 20:44:30 +00001711. Log in as root.
172
1732. Untar the ltp tarball into a spare directory. There is not a
robbiewfc0708b2004-03-01 22:16:02 +0000174 standard location for it yet. We put it in our home directory
robbiew0eea3522004-02-05 17:33:10 +0000175 while we're working on it.
subrata_modakf43b3802009-08-28 05:33:40 +0000176 Note that the full path to this location must be accessible for
177 unprivileged users, as some tests are run as a different user than root.
178 Hence /root is not a good choice on several distributions.
nstraz0312c252000-09-26 20:59:21 +0000179
yaberauneya2d8710f2009-10-25 06:35:08 +00001803. Build and install everything, as described above. Note the minimum software
181 requirements above before doing so.
nstraz0312c252000-09-26 20:59:21 +0000182
yaberauneya2d8710f2009-10-25 06:35:08 +00001834. You can run all of the tests sequentially using the example test script
184 runalltests.sh. The script is provided to get you started.
subrata_modakdddeb902009-05-29 10:06:08 +0000185 See ltp-pan(1) for more information on the test driver we have provided.
robbiew0eea3522004-02-05 17:33:10 +0000186 It is simple, but it can do a lot of stuff.
robbiewb6c5fe72001-09-18 20:44:30 +0000187
Garrett Cooperc41bb212010-02-24 13:24:15 -0800188 NOTE: The diskio and network tests will NOT be run by the runltp script;
189 they are separate from the other tests because of additional required setup
190 overhead.
nstraz0312c252000-09-26 20:59:21 +0000191
yaberauneya2d8710f2009-10-25 06:35:08 +00001925. The disk I/O tests can be run by executing the diskio.sh script. In order
robbiewba422042001-09-19 15:25:43 +0000193 for these tests to successfully operate a writable high-density 3.5" floppy
194 must be in the disk drive and a CD-ROM with more than 100Mb of data must be
195 in the CD-ROM drive. The corresponding tests will fail if either disk is
196 missing.
nstraz0312c252000-09-26 20:59:21 +0000197
robbiewba422042001-09-19 15:25:43 +00001986. The network tests are executed by running the networktests.sh script. The
199 network tests require some configuration for them to work correctly:
200
201 i) First, there MUST be another test machine setup to act as the server
202 to these client side tests. This machine MUST have the LTP installed
203 in the same exact location, i.e. if the client has /root/ltp, then the
204 server must have /root/ltp. This is required because certain tests
205 expect to find server files in certain locations. Make sure to compile
206 the LTP on this server machine also.
207
robbiew0eea3522004-02-05 17:33:10 +0000208 ii) Second, the server must be setup to allow the client to connect using
subrata_modak08978d22008-12-18 04:58:57 +0000209 the "r" commands, such as rsh. This is done by simply creating/editing
210 the ".rhosts" file under /root. Place the hostname of the client
211 machine in this file to allow root to remotely connect without the use
212 of a password. If server has the PAM system security tool, you need
213 to add the following lines to /etc/securetty:
214 rlogin
215 rsh
216 rexec
217 pts/0
218 pts/1
219 :
220 pts/9
robbiewba422042001-09-19 15:25:43 +0000221
robbiew0eea3522004-02-05 17:33:10 +0000222 iii) Next, certain services must be activated in order for certain tests to
robbiewba422042001-09-19 15:25:43 +0000223 execute. The following services are activated via inetd/xinetd:
224 rlogind
225 ftpd
226 telnetd
227 echo (stream)
228 fingerd
229 rshd
subrata_modak08978d22008-12-18 04:58:57 +0000230 Also, because certain RPC programs are tested, the "portmapper" daemon
231 MUST be started, as well as NFS server AND lock services.
robbiewba422042001-09-19 15:25:43 +0000232
robbiew0eea3522004-02-05 17:33:10 +0000233 iv) Finally, before running the networktests.sh script, two variables must
subrata_modak08978d22008-12-18 04:58:57 +0000234 be set within the script file. The "RHOST" variable should be set to
235 the hostname of the server. The "PASSWD" variable should be set to
236 root's password on the server machine. This is necessary for tests
237 such as telnet01 and ftp01.
robbiewba422042001-09-19 15:25:43 +0000238
239 You can now successfully execute the networktests.sh script.
subrata_modak08978d22008-12-18 04:58:57 +0000240 When you would like to run the whole network tests, specify -w option:
241 # ./networktests.sh -w
242
243 When you would like to run the same tests which networktests.sh ran till
244 2008, specify no option or -d option:
245 # ./networktests.sh
246
247 You can run the test category which you are interested in, -h option shows
248 the list of the test category:
249 # ./netwoktests.sh -h
vapier36ab22f2009-01-19 03:37:35 +0000250
251
252Cross compiling
253---------------
254
yaberauneya2d8710f2009-10-25 06:35:08 +0000255To cross compile, you must specify the correct variables:
vapier36ab22f2009-01-19 03:37:35 +0000256
yaberauneya2d8710f2009-10-25 06:35:08 +00002571. When running configure (CC, CXX, CXXFLAGS, LDLIBS, etc).
2582. Manually edit include/mk/config.mk, as described in Configuration.
vapier36ab22f2009-01-19 03:37:35 +0000259
Chris Dearman37550cf2012-10-17 19:54:01 -0700260Note: Do not specify variables on the command-line. Use config.mk instead.
vapier36ab22f2009-01-19 03:37:35 +0000261
yaberauneya2d8710f2009-10-25 06:35:08 +0000262uClinux Users
263--------------
264Specify UCLINUX=1 when calling make; -DUCLINUX=1 use is deprecated and highly
265discouraged.
vapier36ab22f2009-01-19 03:37:35 +0000266
267Variables in Makefile
268----------------------
269
yaberauneya2d8710f2009-10-25 06:35:08 +0000270The conventions enforced are standard ones. Here's a quick summary:
vapier36ab22f2009-01-19 03:37:35 +0000271
yaberauneya2d8710f2009-10-25 06:35:08 +0000272CFLAGS - used when compiling/linking C code, e.g. -D_GNU_SOURCE (no CPPFLAGS!)
vapier36ab22f2009-01-19 03:37:35 +0000273
274CXXFLAGS - used when compiling/linking C++ code (no CPPFLAGS!)
275
yaberauneya2d8710f2009-10-25 06:35:08 +0000276CPPFLAGS - used when preprocessor is run (so C/C++ compiling with $(CPP)
Garrett Coopere5387ce2010-08-18 02:00:52 -0700277 functions, e.g. -I$SYSROOT/usr/include -I$SYSROOT/include -I$SYSROOT
vapier36ab22f2009-01-19 03:37:35 +0000278
yaberauneya2d8710f2009-10-25 06:35:08 +0000279LDFLAGS - linker flags, e.g. "-L$SYSROOT/usr/lib" "-L$SYSROOT/lib". DO NOT
Garrett Coopere5387ce2010-08-18 02:00:52 -0700280 PUT LIBRARIES IN THIS LIST (see LDLIBS for that).
vapier36ab22f2009-01-19 03:37:35 +0000281
yaberauneya2d8710f2009-10-25 06:35:08 +0000282LDLIBS - libraries listed after objects during link, e.g. -lc, -lpthread,
Garrett Coopere5387ce2010-08-18 02:00:52 -0700283 -lltp.
vapier36ab22f2009-01-19 03:37:35 +0000284
yaberauneya2d8710f2009-10-25 06:35:08 +0000285See README.mk-devel for a more terse description of what's available.
yaberauneya9079a9f2009-11-05 08:38:40 +0000286
287Common Issues
288----------------------
289
yaberauneyacef79622009-11-12 11:57:37 +0000290Issue: When executing configure it says:
291
292checking for a BSD-compatible install... /usr/bin/install -c
293checking whether build environment is sane... yes
294checking for gawk... gawk
295checking whether make sets $(MAKE)... yes
296configure: error: cannot run /bin/sh ./config.sub
297
yaberauneya44cac8e2009-11-12 12:08:09 +0000298Solution: 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 +0000299
yaberauneya9079a9f2009-11-05 08:38:40 +0000300Issue: When executing make [all] it says:
301
302 " *** No rule to make target `/$*', needed by `pan-all'. Stop."
303
304Solution: You must upgrade to make 3.81. Please see the Requirements section above.
305
306Issue: When executing make [all] it says something like:
307
308 # ...
309 install -m 00644 "/scratch/ltp-dev2/ltp/include/test.h" "/scratch/ltp-install12/include/test.h"
310 install -m 00644 "/scratch/ltp-dev2/ltp/include/tlibio.h" "/scratch/ltp-install12/include/tlibio.h"
311 install -m 00644 "/scratch/ltp-dev2/ltp/include/usctest.h" "/scratch/ltp-install12/include/usctest.h"
312 install -m 00644 "/scratch/ltp-dev2/ltp/include/write_log.h" "/scratch/ltp-install12/include/write_log.h"
313 make[1]: Leaving directory `/scratch/ltp-dev2/ltp/include'
Chris Dearman37550cf2012-10-17 19:54:01 -0700314 make -C lib -f "/scratch/ltp-dev2/ltp/lib/Makefile" all
yaberauneya9079a9f2009-11-05 08:38:40 +0000315 make[1]: Entering directory `/scratch/ltp-dev2/ltp/lib'
316 " *** No rule to make target `dataascii.o', needed by `libltp.a'. Stop." # <-- the error
317
318Solution: You cannot build LTP with -r / --no-builtin-rules and/or
Garrett Coopere5387ce2010-08-18 02:00:52 -0700319 -R / --no-builtin-variables specified. LTP relies heavily on built-in
320 implicit rules and variables to function properly.
yaberauneya340292d2010-01-18 23:46:09 +0000321
322Issue: When executing make (no target, 3.80), it does the following, and doesn't execute all:
323
324 #
325 make -C testcases/realtime autotools
326 make[1]: Entering directory `/scratch/ltp/testcases/realtime'
327 autoheader
328 make[1]: Leaving directory `/scratch/ltp/testcases/realtime'