blob: 5f9aa17c4f5df968f76585904806124239ec2587 [file] [log] [blame]
yaberauneya4f493d82009-11-03 16:12:12 +00001$Id: INSTALL,v 1.28 2009/11/03 16:12:12 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-------------------
yaberauneya4f493d82009-11-03 16:12:12 +00005In order to compile and use pan, you must have bison/yacc, flex, and make
63.81+ installed.
subrata_modak3960cc82009-01-20 10:47:29 +00007
yaberauneya2d8710f2009-10-25 06:35:08 +00008bison can be obtained here:
9- http://ftp.gnu.org/gnu/bison/bison-2.4.1.tar.gz
subrata_modak16147ad2009-01-21 11:30:52 +000010
yaberauneya2d8710f2009-10-25 06:35:08 +000011Berkeley yacc can be obtained here:
12- ftp://invisible-island.net/byacc/byacc.tar.gz
subrata_modak16147ad2009-01-21 11:30:52 +000013
yaberauneya2d8710f2009-10-25 06:35:08 +000014flex can be obtained here:
15- http://downloads.sourceforge.net/project/flex/flex/flex-2.5.33/flex-2.5.33.tar.bz2
subrata_modak3960cc82009-01-20 10:47:29 +000016
yaberauneya4f493d82009-11-03 16:12:12 +000017make 3.81 can be obtained here:
18- http://ftp.gnu.org/gnu/make/make-3.81.tar.bz2
19
yaberauneya2d8710f2009-10-25 06:35:08 +000020If you want to use auto configuration, be sure autoconf-2.61+ & automake-1.10+
21are installed.
22
23automake-1.10.2's sources can be downloaded from:
24- ftp://ftp.gnu.org/gnu/automake/automake-1.10.2.tar.bz2
25- ftp://ftp.gnu.org/gnu/automake/automake-1.10.2.tar.gz
26
27autoconf-2.61's sources can be downloaded from:
28- ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2
29- ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz
30
31autoconf-2.61 also requires m4-1.4.7+ be installed. Its sources can be
32downloaded from:
33- http://ftp.gnu.org/gnu/m4/m4-1.4.7.tar.bz2
34- http://ftp.gnu.org/gnu/m4/m4-1.4.7.tar.gz
35
36Configuring
37-------------------
38Using autoconf:
yaberauneya420ebba2009-10-25 10:44:14 +000039 $ make autotools # This must be run from "$TOP_SRCDIR!"
yaberauneya2d8710f2009-10-25 06:35:08 +000040 $ test -d "$TOP_BUILDDIR" || mkdir -p "$TOP_BUILDDIR"
41 $ cd "$TOP_BUILDDIR" && "$TOP_SRCDIR/configure" \
42 # [configure args go here, e.g. CC=$CC, LDFLAGS=$LDFLAGS, etc]
43
44Not using autoconf:
45
46 $ test -d "$TOP_BUILDDIR" || mkdir -p "$TOP_BUILDDIR"
47 $ cp "$TOP_SRCDIR/include/config.h.default" \
48 "$TOP_BUILDDIR/include/config.h"
49 $ cp "$TOP_SRCDIR/include/mk/config.mk.default" \
50 "$TOP_BUILDDIR/include/mk/config.mk"
51
52 # Fire up your favorite editor and set each value appropriately in
53 # include/mk/config.mk. Uncomment all values commented out, such as
54 # NUMA_LIBS, etc, but only if you're sure that the libraries exist and
55 # can be linked on your system.
56
57- $TOP_SRCDIR and $TOP_BUILDDIR are the same for in-build-tree scenarios.
58- $TOP_SRCDIR and $TOP_BUILDDIR differ for out-of-build-tree scenarios.
59
60See the In-build-tree and Out-of-build-tree sections below for more details on
61what to do next...
62
63Compiling LTP
64-------------------
65
66In-build-tree
67-------------------
68In-build-tree support is when you build binaries (applications, binary objects)
69in the same directory where the source files reside.
70
71 $ make all
72 $ make \
73 "DESTDIR=$SYSROOT" \
74 SKIP_IDCHECK=[0|1] \
75 install
76
77- Specifying DESTDIR is optional, but required when installing to a non-host
78 sysroot, as opposed to the host system's sysroot.
79- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd}
80 on the target system's sysroot.
subrata_modakaba85b92008-12-11 10:30:33 +000081
subrata_modak40455172009-01-05 08:35:21 +000082If you get a build error, please report it to ltp-list@lists.sf.net with
83following information,
84
yaberauneya2d8710f2009-10-25 06:35:08 +000085 1. The error output before the failure.
86 2. If you used configure:
87 i. include/config.h
88 ii. include/mk/config.mk
89 iii. config.log
subrata_modak40455172009-01-05 08:35:21 +000090
yaberauneya2d8710f2009-10-25 06:35:08 +000091Out-of-build-tree
92-------------------
93Out-of-build-tree support is when you build binaries (applications, binary
94objects, generated files) outside of the directory where the source files
95reside. This is typically used when cross-compiling for multiple targets.
subrata_modak40455172009-01-05 08:35:21 +000096
yaberauneya2d8710f2009-10-25 06:35:08 +000097NOTE: This is by and large correctly implemented, but there are several corner
98case, where this isn't implemented properly. Please see TODO for a list of items
99which need fixing in the LTP tree.
subrata_modakaba85b92008-12-11 10:30:33 +0000100
yaberauneya2d8710f2009-10-25 06:35:08 +0000101 $ mkdir "$OUT_OF_BUILD_TREE_DIR"
102 $ make \
103 -C "$OUT_OF_BUILD_TREE_DIR" \
104 -f "$TOP_SRCDIR/Makefile" \
105 "top_srcdir=$TOP_SRCDIR" \
106 "top_builddir=$OUT_OF_BUILD_TREE_DIR"
107 $ make \
108 -C "$OUT_OF_BUILD_TREE_DIR" \
109 -f "$TOP_SRCDIR/Makefile" \
110 "top_srcdir=$TOP_SRCDIR" \
111 "top_builddir=$OUT_OF_BUILD_TREE_DIR" \
112 "DESTDIR=$SYSROOT" \
113 SKIP_IDCHECK=[0|1]
114 install
115
116- Specifying DESTDIR is optional, but required when installing to a non-host
117 sysroot, as opposed to the host system's sysroot.
118- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd}
119 on the target system's sysroot.
alaffine15dd682000-05-08 20:31:30 +0000120
nstraz0312c252000-09-26 20:59:21 +0000121Quick Start
122-----------
whrb973f2b2000-05-05 19:34:50 +0000123
robbiew57404482001-09-19 16:11:23 +00001241> tar xzf ltp-XXXXXXXX.tar.gz
nstraz0312c252000-09-26 20:59:21 +00001252> cd ltp
robbiew0eea3522004-02-05 17:33:10 +00001263> make
robbiew502f4ca2003-02-05 16:30:06 +00001274> make install
1285> ./runalltests.sh
whrb973f2b2000-05-05 19:34:50 +0000129
robbiew0eea3522004-02-05 17:33:10 +0000130*NOTE: The LTP assumes the existence of the nobody, bin, and daemon users and
131their groups. If these IDs do not exist, certain tests will fail. The users
132and groups IDs should be the same, i.e. if user "nobody" is 99, then it's
133group should also be "99". The names of the groups are irrelevant.
robbiew5be3ca52001-10-12 20:21:49 +0000134
whrb973f2b2000-05-05 19:34:50 +0000135
nstraz0312c252000-09-26 20:59:21 +0000136Detailed Installation
137---------------------
138
139Beyond the "Quick Start" instructions, there are only a few other things
140that should be done. The Linux Test Project build process uses a
141minimalist approach. There is a lot of room for improvement and
142contributions are welcome.
143
robbiewb6c5fe72001-09-18 20:44:30 +00001441. Log in as root.
145
1462. Untar the ltp tarball into a spare directory. There is not a
robbiewfc0708b2004-03-01 22:16:02 +0000147 standard location for it yet. We put it in our home directory
robbiew0eea3522004-02-05 17:33:10 +0000148 while we're working on it.
subrata_modakf43b3802009-08-28 05:33:40 +0000149 Note that the full path to this location must be accessible for
150 unprivileged users, as some tests are run as a different user than root.
151 Hence /root is not a good choice on several distributions.
nstraz0312c252000-09-26 20:59:21 +0000152
yaberauneya2d8710f2009-10-25 06:35:08 +00001533. Build and install everything, as described above. Note the minimum software
154 requirements above before doing so.
nstraz0312c252000-09-26 20:59:21 +0000155
yaberauneya2d8710f2009-10-25 06:35:08 +00001564. You can run all of the tests sequentially using the example test script
157 runalltests.sh. The script is provided to get you started.
subrata_modakdddeb902009-05-29 10:06:08 +0000158 See ltp-pan(1) for more information on the test driver we have provided.
robbiew0eea3522004-02-05 17:33:10 +0000159 It is simple, but it can do a lot of stuff.
robbiewb6c5fe72001-09-18 20:44:30 +0000160
robbiew0eea3522004-02-05 17:33:10 +0000161 NOTE: The diskio and network tests will NOT be run by the runalltests.sh
yaberauneya2d8710f2009-10-25 06:35:08 +0000162 script. They are separate from the other tests because of the additional
163 required setup overhead.
nstraz0312c252000-09-26 20:59:21 +0000164
yaberauneya2d8710f2009-10-25 06:35:08 +00001655. The disk I/O tests can be run by executing the diskio.sh script. In order
robbiewba422042001-09-19 15:25:43 +0000166 for these tests to successfully operate a writable high-density 3.5" floppy
167 must be in the disk drive and a CD-ROM with more than 100Mb of data must be
168 in the CD-ROM drive. The corresponding tests will fail if either disk is
169 missing.
nstraz0312c252000-09-26 20:59:21 +0000170
robbiewba422042001-09-19 15:25:43 +00001716. The network tests are executed by running the networktests.sh script. The
172 network tests require some configuration for them to work correctly:
173
174 i) First, there MUST be another test machine setup to act as the server
175 to these client side tests. This machine MUST have the LTP installed
176 in the same exact location, i.e. if the client has /root/ltp, then the
177 server must have /root/ltp. This is required because certain tests
178 expect to find server files in certain locations. Make sure to compile
179 the LTP on this server machine also.
180
robbiew0eea3522004-02-05 17:33:10 +0000181 ii) Second, the server must be setup to allow the client to connect using
subrata_modak08978d22008-12-18 04:58:57 +0000182 the "r" commands, such as rsh. This is done by simply creating/editing
183 the ".rhosts" file under /root. Place the hostname of the client
184 machine in this file to allow root to remotely connect without the use
185 of a password. If server has the PAM system security tool, you need
186 to add the following lines to /etc/securetty:
187 rlogin
188 rsh
189 rexec
190 pts/0
191 pts/1
192 :
193 pts/9
robbiewba422042001-09-19 15:25:43 +0000194
robbiew0eea3522004-02-05 17:33:10 +0000195 iii) Next, certain services must be activated in order for certain tests to
robbiewba422042001-09-19 15:25:43 +0000196 execute. The following services are activated via inetd/xinetd:
197 rlogind
198 ftpd
199 telnetd
200 echo (stream)
201 fingerd
202 rshd
subrata_modak08978d22008-12-18 04:58:57 +0000203 Also, because certain RPC programs are tested, the "portmapper" daemon
204 MUST be started, as well as NFS server AND lock services.
robbiewba422042001-09-19 15:25:43 +0000205
robbiew0eea3522004-02-05 17:33:10 +0000206 iv) Finally, before running the networktests.sh script, two variables must
subrata_modak08978d22008-12-18 04:58:57 +0000207 be set within the script file. The "RHOST" variable should be set to
208 the hostname of the server. The "PASSWD" variable should be set to
209 root's password on the server machine. This is necessary for tests
210 such as telnet01 and ftp01.
robbiewba422042001-09-19 15:25:43 +0000211
212 You can now successfully execute the networktests.sh script.
subrata_modak08978d22008-12-18 04:58:57 +0000213 When you would like to run the whole network tests, specify -w option:
214 # ./networktests.sh -w
215
216 When you would like to run the same tests which networktests.sh ran till
217 2008, specify no option or -d option:
218 # ./networktests.sh
219
220 You can run the test category which you are interested in, -h option shows
221 the list of the test category:
222 # ./netwoktests.sh -h
vapier36ab22f2009-01-19 03:37:35 +0000223
224
225Cross compiling
226---------------
227
yaberauneya2d8710f2009-10-25 06:35:08 +0000228To cross compile, you must specify the correct variables:
vapier36ab22f2009-01-19 03:37:35 +0000229
yaberauneya2d8710f2009-10-25 06:35:08 +00002301. When running configure (CC, CXX, CXXFLAGS, LDLIBS, etc).
2312. Manually edit include/mk/config.mk, as described in Configuration.
vapier36ab22f2009-01-19 03:37:35 +0000232
yaberauneya2d8710f2009-10-25 06:35:08 +0000233Note: Do not specify variables on the command-line. Use config.mk instead.
vapier36ab22f2009-01-19 03:37:35 +0000234
yaberauneya2d8710f2009-10-25 06:35:08 +0000235uClinux Users
236--------------
237Specify UCLINUX=1 when calling make; -DUCLINUX=1 use is deprecated and highly
238discouraged.
vapier36ab22f2009-01-19 03:37:35 +0000239
240Variables in Makefile
241----------------------
242
yaberauneya2d8710f2009-10-25 06:35:08 +0000243The conventions enforced are standard ones. Here's a quick summary:
vapier36ab22f2009-01-19 03:37:35 +0000244
yaberauneya2d8710f2009-10-25 06:35:08 +0000245CFLAGS - used when compiling/linking C code, e.g. -D_GNU_SOURCE (no CPPFLAGS!)
vapier36ab22f2009-01-19 03:37:35 +0000246
247CXXFLAGS - used when compiling/linking C++ code (no CPPFLAGS!)
248
yaberauneya2d8710f2009-10-25 06:35:08 +0000249CPPFLAGS - used when preprocessor is run (so C/C++ compiling with $(CPP)
250 functions, e.g. -I$SYSROOT/usr/include -I$SYSROOT/include -I$SYSROOT
vapier36ab22f2009-01-19 03:37:35 +0000251
yaberauneya2d8710f2009-10-25 06:35:08 +0000252LDFLAGS - linker flags, e.g. "-L$SYSROOT/usr/lib" "-L$SYSROOT/lib". DO NOT
253 PUT LIBRARIES IN THIS LIST (see LDLIBS for that).
vapier36ab22f2009-01-19 03:37:35 +0000254
yaberauneya2d8710f2009-10-25 06:35:08 +0000255LDLIBS - libraries listed after objects during link, e.g. -lc, -lpthread,
256 -lltp.
vapier36ab22f2009-01-19 03:37:35 +0000257
yaberauneya2d8710f2009-10-25 06:35:08 +0000258See README.mk-devel for a more terse description of what's available.