/
BUILD_NOTES
784 lines (638 loc) · 31.6 KB
/
BUILD_NOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
Build Notes for XORP (eXtensible Open Router Platform)
0. Preface
==========
XORP builds on Linux and BSD variants that support the 'scons' build
system and GNU g++ compiler toolset. Please ask on the xorp-hackers
mailing list if your preferred system is not currently supported.
1. Compilation
==============
1.1 Compiling the binaries
==========================
To compile XORP, you must have SCons installed. Then just
run the following commands in the top-level directory:
scons
scons install
To change the default C and C++ compilers, then assign the binary
names to the CC and CXX user environmental variables respectively.
E.g., if you want to use the gcc34/g++34 compilers, then use (in case
of csh/tcsh) the following commands before running "scons":
setenv CC gcc34
setenv CXX g++34
To compile XORP with additional user-specified compiler flags, assign
those flags to the CFLAGS and CXXFLAGS environmental variables (for the
C and C++ compiler respectively) before running "scons".
To compile using clang and llvm:
# Install latest clang & llvm
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ..
./configure --enable-optimized
make
(as root): make install
Then, in xorp directory, build using clang/llvm compiler:
scons CC=clang CXX=clang++
To compile using uSTL instead of standard STL library:
* Get latest ustl code:
git clone git://ustl.git.sourceforge.net/gitroot/ustl/ustl
Apply xorp_ustl.patch found in ../other/patches/
(Read the README file too)
Compile and install ustl.
* Buld subset of xorp using uSTL libraries (Not all modules support
uSTL, but it's of primary use to folks wanting small multicast router
packages I think):
git://ustl.git.sourceforge.net/gitroot/ustl/ustl
Apply xorp_ustl.patch found in ../other/patches/
(Read the README file too)
Compile and install ustl.
* Ensure build environment is clean:
rm -fr obj
* Buld subset of xorp using uSTL libraries (Not all modules support
uSTL, but it's of primary use to folks wanting small multicast router
packages I think). If uSTL proves useful, more modules can be patched
to work with uSTL.
scons disable_ipv6=yes disable_fw=yes disable_warninglogs=yes \
disable_tracelogs=yes disable_fatallogs=yes disable_infologs=yes \
disable_assertlogs=yes disable_errorlogs=yes enable_olsr=no \
enable_bgp=no enable_ospf=no enable_vrrp=no enable_policy=no \
enable_rip=no optimize=size enable_fea_dummy=no enable_xorpsh=no \
disable_profile=yes enable_ustl=no
For various compile options use: scons --help
1.2 Generating documentation
============================
The documentation for each XORP release is available from the XORP Web
site. The following procedure can be used to generate the
documentation directly from the source files.
The documentation is now in a separate area of the XORP SVN repository,
and is no longer part of the source tree itself.
1.2.1. Install TeX and LaTeX
* FreeBSD
cd /usr/ports/print/teTeX
make
make install
# Optionally install the Prosper LaTeX class:
cd /usr/ports/textproc/prosper
make
make install
* Ubuntu Linux
apt-get install texlive
apt-get install texlive-latex-extra
apt-get install texlive-math-extra
1.2.2. Compile the documentation.
# Note that this must be done directly in the XORP docs directory with the
# original source files.
cd /path/to/xorp/docs
scons
2. Internal tests
=================
As of September 2009, not all of the regression tests are active in
the public SVN tree.
To run the internal tests, you must have "bash" and "python" installed.
Note that if the python's executable filename is not "python", then
you would have to create a symbolic link with such name. E.g., execute
as a root:
cd /path/to/python/binary
ln -s python2.4 python
After the code is compiled, you need to run the following command
in the top-level XORP directory:
scons check
3. OS-specific notes
====================
3.1. DragonFlyBSD
=================
* DragonFlyBSD-1.4
- The code compiles with the default compiler, and the internal tests
appear to succeed:
gcc (GCC) 3.4.5 20050809 (prerelease) [DragonFly] (propolice, visibility)
* DragonFlyBSD-1.6
- The following system header file has a bug (it uses the C++ keyword
"new" for the name of a variable):
/usr/include/machine/atomic.h
The following patch must be applied to that file before compiling XORP:
http://www.dragonflybsd.org/cvsweb/src/sys/i386/include/atomic.h.diff?r1=1.20.2.1&r2=1.20.2.2
- The code compiles with the default compiler, and the internal tests
appear to succeed:
gcc (GCC) 3.4.5 20050809 (prerelease) [DragonFly] (propolice, visibility)
* DragonFlyBSD-1.8
- The code compiles with the default compiler, and the internal tests
appear to succeed:
gcc (GCC) 3.4.6 [DragonFly] (propolice, visibility)
* DragonFlyBSD-1.10.1
- The code compiles with the default compiler, and the internal tests
appear to succeed:
gcc (GCC) 3.4.6 [DragonFly] (propolice, visibility)
* DragonFlyBSD-1.12.2
- The code compiles with the default compiler, and the internal tests
appear to succeed:
gcc (GCC) 4.1.2 (DragonFly)
3.2. FreeBSD
============
* FreeBSD-4.5, FreeBSD-4.6.2, FreeBSD-4.6-RELEASE, FreeBSD-4.8-RELEASE:
- Earlier XORP releases have been developed and tested on those
platforms.
* FreeBSD-4.9-RELEASE and FreeBSD-4.10-RELEASE:
- No known issues.
- The code should compile with the following versions of the
gcc/g++ compiler: 2.95.4 (default), 3.3.4,
3.4.2 20040827 (prerelease), and 3.4.6.
* FreeBSD-5.1:
- The default gcc/g++ compiler (version 3.2.2) has a bug, hence
you must install a new compiler (e.g., gcc-3.3 from
/usr/ports/lang/gcc33 in the ports collection). Then, you must
set environmental variables CC and CXX to point to the new compiler
before running "./configure"
(e.g., "setenv CC gcc33; setenv CXX g++33").
- The code compiles with the new compiler, and the internal tests
appear to succeed.
* FreeBSD-5.2, FreeBSD-5.3, FreeBSD-5.4
- The code compiles with the default compiler, and the internal tests
appear to succeed.
* FreeBSD-6.0 on i386
- No known issues.
* FreeBSD-6.0 on amd64
- Multicast routing doesn't work because of a broken "struct igmpmsg"
definition inside <netinet/ip_mroute.h>.
The fix (already in FreeBSD-6.1) is to replace
u_long with uint32_t inside the body of "struct igmpmsg", and
then recompile both the FreeBSD kernel and XORP.
- The SNMP support inside the "mibs" directory fails to compile.
- The rest of code compiles with the default compiler, and the internal
tests appear to succeed:
gcc (GCC) 3.4.4 [FreeBSD] 20050518
* The following compiler is known to be buggy, and should not be used
to compile XORP:
- gcc34 (GCC) 3.4.0 20040310 (prerelease) [FreeBSD]
A newer compiler such as the following should be used instead:
- gcc34 (GCC) 3.4.2 20040827 (prerelease) [FreeBSD]
* FreeBSD-6.1 on i386
- The code compiles with the default compiler, and the internal tests
appear to succeed:
gcc (GCC) 3.4.4 [FreeBSD] 20050518
* FreeBSD-6.1 on amd64
- The SNMP support inside the "mibs" directory can be compiled only
if the "--enable-shared" flag is used when running "./configure":
./configure --with-snmp --enable-shared
- The rest of code compiles with the following compilers, and the internal
tests appear to succeed:
gcc (GCC) 3.4.4 [FreeBSD] 20050518 (default)
gcc42 (GCC) 4.2.0 20060218 (experimental)
gcc43 (GCC) 4.3.0 20070223 (experimental)
* FreeBSD-6.2 on i386
- The code compiles with the default compiler, and the internal tests
appear to succeed:
gcc (GCC) 3.4.6 [FreeBSD] 20060305
* FreeBSD-7.0 on i386 and amd64
- The code compiles with the default compiler, and the internal tests
appear to succeed:
gcc (GCC) 4.2.1 20070719 [FreeBSD]
3.3. NetBSD
===========
* NetBSD-2.0, NetBSD-3.0, NetBSD-3.0.1, and NetBSD-3.1
- The SNMP support inside the "mibs" directory may fail to compile.
- The rest of code compiles, and the internal tests appear to succeed:
gcc (GCC) 3.3.3 (NetBSD nb3 20040520)
- If the compilation fails with the following error:
"/usr/pkg/bin/bash: Undefined PLT symbol "read" (reloc type = 7, symnum = 92)"
then just run "gmake" again, and the compilation should continue from
the point it has failed.
- The default datasize limit per user may not be sufficient to compile
some parts of the code, hence you may need to increase the datasize
limit. If you see a compilation error like:
ld: final link failed: Memory exhausted
then you should increase the data size limit by
"limit datasize 200000" in csh/tcsh or "ulimit -d 200000" in sh.
If necessary, increase further the datasize limit.
- The default limit of maximum opened file descriptors per process
is 64 which may not be sufficient. If you run a XORP program and
there are errors like:
[ 2004/06/20 22:26:09 ERROR test_pim:31634 LIBCOMM +582 comm_sock.c comm_sock_accept ] Error accepting socket 4: Too many open files
then you should increase the file descriptors limit by
"limit descriptors 400" in csh/tcsh or "ulimit -n 400" in sh.
* NetBSD-4.0
- The code compiles with the default compiler, and the internal tests
appear to succeed:
gcc (GCC) 4.1.2 20061021 prerelease (NetBSD nb3 20061125)
3.4. OpenBSD
============
* If the system would be used as a multicast router, then add the
following lines to /etc/rc.conf.local and reboot:
# Enable multicast routing (see netstart(8) for details).
multicast_host=NO
multicast_router=YES
Note that OpenBSD-3.7 is the first release that has PIM multicast routing
support in the kernel.
* OpenBSD-3.5:
- The default gcc/g++ compiler (version 2.95.x) has a bug, hence
you must install a new compiler (e.g., gcc-3.3.2 and g++-3.3.2 from
packages). Then, you must set environmental variables CC and CXX
to point to the new compiler before running "./configure"
(e.g., "setenv CC egcc; setenv CXX eg++").
- The code compiles with the new compiler, but some of the internal
tests fail.
- The default datasize limit per user may not be sufficient to compile
some parts of the code, hence you may need to increase the datasize
limit. If you see a compilation error like:
/usr/bin/ld: final link failed: Memory exhausted
collect2: ld returned 1 exit status
then you should increase the data size limit by
"limit datasize 200000" in csh/tcsh or "ulimit -d 200000" in sh.
If necessary, increase further the datasize limit.
- The default limit of maximum opened file descriptors per process
is 64 which may not be sufficient. If you run a XORP program and
there are errors like:
[ 2004/06/20 22:26:09 ERROR test_pim:31634 LIBCOMM +582 comm_sock.c comm_sock_accept ] Error accepting socket 4: Too many open files
then you should increase the file descriptors limit by
"limit descriptors 400" in csh/tcsh or "ulimit -n 400" in sh.
* OpenBSD-3.6-current (as of February 2005) on i386 and amd64,
OpenBSD-3.8, OpenBSD-3.9, OpenBSD-4.0, OpenBSD-4.1, OpenBSD-4.2,
OpenBSD-4.3, OpenBSD-4.4
- The default gcc/g++ compiler (version 3.3.5 (propolice)) has a bug
in the propolice implementation:
http://www.monkey.org/openbsd/archive2/tech/200503/msg00011.html
Hence, you must disable the propolice feature. You need to add the
"-fno-stack-protector" flag to your CFLAGS and CXXFLAGS
environmental variables. E.g. (in csh/tcsh):
setenv CFLAGS -fno-stack-protector
setenv CXXFLAGS -fno-stack-protector
./configure
- The code compiles, and the internal tests appear to succeed.
Multicast routing seems to work.
- The default datasize limit per user may not be sufficient to compile
some parts of the code, hence you may need to increase the datasize
limit. If you see a compilation error like:
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
then you should increase the data size limit by
"limit datasize 200000" in csh/tcsh or "ulimit -d 200000" in sh.
If necessary, increase further the datasize limit.
- The default limit of maximum opened file descriptors per process
- The default limit of maximum opened file descriptors per process
is 64 (increased to 128 in OpenBSD-4.2) which may not be
sufficient. If you run a XORP program and there are errors like:
[ 2004/06/20 22:26:09 ERROR test_pim:31634 LIBCOMM +582 comm_sock.c comm_sock_accept ] Error accepting socket 4: Too many open files
then you should increase the file descriptors limit by
"limit descriptors 400" in csh/tcsh or "ulimit -n 400" in sh.
3.5. Linux
==========
* It is difficult to get distributions older than Fedora Core 5
to compile XORP 1.7 and above, primarily due to scons and
python dependencies.
* If compiling with shared=no, you should also install static glibc
openssl and other needed libraries.
* Linux Red Hat Enterprise Linux Server release 5 (Tikanga)
(kernel 2.6.18-8.el5)
- Optionally install the following packages:
- libpcap-devel (e.g., libpcap-devel.x86_64)
This package is needed for sending/receiving link layer data frames.
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
- Tested on the following architectures: x86_64 (amd64)
* Linux Fedora Core5 (2.6.16-1.2080_FC5smp):
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.1.0 20060304 (Red Hat 4.1.0-3)
* Linux Fedora Core6 (2.6.18-1.2798.fc6PAE):
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.1.1 20061011 (Red Hat 4.1.1-30)
* Linux Fedora 7 (2.6.21-1.3194.fc7):
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.1.2 20070502 (Red Hat 4.1.2-12)
* Linux Fedora 8 (2.6.21-2950.fc8xen):
- Optionally install the following packages:
- libpcap-dev
This package is needed for sending/receiving link layer data frames.
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33)
* Linux Fedora 9 (2.6.25-14.fc9.i686):
- Optionally install the following packages:
- libpcap-devel
This package is needed for sending/receiving link layer data frames.
- gcc (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)
* Linux Fedora 10 (2.6.27.5-117.fc10.i686):
- Optionally install the following packages:
- libpcap-devel
This package is needed for sending/receiving link layer data frames.
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7)
* Linux CentOS 5.2 (2.6.18-92.el5):
- You must install the following packages:
- gcc
- gcc-c++
- openssl-devel
- Optionally install the following packages:
- libpcap-devel
This package is needed for sending/receiving link layer data frames.
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)
* Linux Debian-3.1 (sarge) (2.4.27-3-386):
- You must install the following packages:
- libssl (e.g., libssl0.9.7)
- libssl-dev
- gcc (e.g., gcc-3.3)
- g++ (e.g., g++-3.3)
- The binaries for the GCC C and C++ compilers might not be called
gcc/g++, but gcc-3.3 and g++-3.3.
Either create a link from gcc to gcc-3.3 and from g++ to g++-3.3,
or set the CC and CXX environments to point to the binary names.
E.g., in csh/tcsh: setenv CC gcc-3.3; setenv CXX g++-3.3
- The code compiles, and the internal tests appear to succeed.
- gcc-3.3 (GCC) 3.3.5 (Debian 1:3.3.5-13)
* Linux Debian-4.0 (etch) (2.6.18-5-486):
- Optionally install the following packages:
- libpcap0.8-dev
This package is needed for sending/receiving link layer data frames.
- The binaries for the GCC C and C++ compilers might not be called
gcc/g++, but gcc-4.1 and g++-4.1.
Either create a link from gcc to gcc-4.1 and from g++ to g++-4.1,
or set the CC and CXX environments to point to the binary names.
E.g., in csh/tcsh: setenv CC gcc-4.1; setenv CXX g++-4.1
- The code compiles, and the internal tests appear to succeed.
- gcc-4.1 (GCC) 4.1.1-15 (Debian 4:4.1.1-15)
- gcc-4.1 (GCC) 4.1.3 20070812 (prerelease) (Debian 4.1.2-15)
* Linux Debian-5.0 (lenny, unreleased) (2.6.25-2-686 and 2.6.26-1-686):
- You must install the following packages:
- gcc (e.g., gcc-4.3)
- g++ (e.g., g++-4.3)
- libssl-dev
- Optionally install the following packages:
- libpcap-dev
This package is needed for sending/receiving link layer data frames.
- The code compiles, and the internal tests appear to succeed.
- gcc (Debian 4.3.1-2) 4.3.1
- Tested on the following architectures: i386
* Linux Gentoo 2006.1:
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3)
* Linux Gentoo 2007.0 with hardened profile:
- The following hardened compiler has some issues (correct C++ programs
might coredump), and should not be used:
g++ (GCC) 3.4.6 (Gentoo Hardened 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.10)
The solution is to use gcc-config and switch to a gcc profile that
disables ssp, e.g., the "hardenednossp" profile.
* Linux Gentoo 2008.0 (kernel 2.6.24-gentoo-r7):
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.1)
* Linux Ubuntu-7.04 (Server Edition, kernel 2.6.20-15-server):
- You must install the following packages:
- libssl-dev (e.g., version 0.9.8c-4build1)
- gcc (e.g., gcc-4.1)
- g++ (e.g., g++-4.1)
- Optionally install the following packages:
- libpcap0.8-dev
This package is needed for sending/receiving link layer data frames.
- snmpd and libsnmp-dev
Those packages are needed for SNMP support.
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
- Tested on the following architectures: i386, sparc64
* Linux Ubuntu-7.10 (Server Edition, kernel 2.6.22-14-server):
- You must install the following packages:
- libssl-dev (e.g., version 0.9.8e-5ubuntu3.1)
- gcc (e.g., gcc-4.1)
- g++ (e.g., g++-4.1)
- Optionally install the following packages:
- libpcap0.8-dev
This package is needed for sending/receiving link layer data frames.
- iptables-dev
This package is needed for configuring firewall rules using XORP.
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
- Tested on the following architectures: i386, amd64
* Linux Ubuntu-8.04.1 (Server Edition, kernel 2.6.24-19-server):
- You must install the following packages:
- libssl-dev (e.g., version 0.9.8g-4ubuntu3.3)
- gcc (e.g., gcc-4.2)
- g++ (e.g., g++-4.2)
- Optionally install the following packages:
- libpcap0.8-dev
This package is needed for sending/receiving link layer data frames.
- iptables-dev
This package is needed for configuring firewall rules using XORP.
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
- Tested on the following architectures: i386
* Linux Ubuntu-8.10 (Server Edition, kernel 2.6.27-7-server):
- You must install the following packages:
- libssl-dev (e.g., 0.9.8g-10.1ubuntu2)
- gcc (e.g., gcc-4.3)
- g++ (e.g., g++-4.3)
- Optionally install the following packages:
- libpcap0.8-dev
This package is needed for sending/receiving link layer data frames.
- iptables-dev
This package is needed for configuring firewall rules using XORP.
- The code compiles, and the internal tests appear to succeed.
- gcc (GCC) 4.3.2 (Ubuntu 4.3.2-1ubuntu11)
- Tested on the following architectures: i386
* Linux openSUSE 11.0 (2.6.25.11-0.1-default):
- You must install the following packages:
- gcc
- g++
- libopenssl-devel
- Optionally install the following packages:
- libpcap-devel
This package is needed for sending/receiving link layer data frames.
- The code compiles, and the internal tests appear to succeed.
- gcc (SUSE Linux) 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036]
* There is a known problem with building XORP on Linux with gcc-4.0.x
and optimization enabled. It is a bug in gcc, see XORP Bugzilla #435
for details:
http://www.xorp.org/bugzilla/show_bug.cgi?id=435
A simple work-around is not to enable compiler's optimization, or
just to upgrade to a newer compiler (4.1.x or later).
* There is a known problem with building XORP on Linux with gcc-3.3
or gcc-3.4 and post-2.15 binutils.
It is a bug in gcc, see XORP Bugzilla #497 for details:
http://www.xorp.org/bugzilla/show_bug.cgi?id=497
Newer versions of the gcc compiler (e.g., gcc-4.0.2 or gcc-4.1) should
be used instead.
* Intel C/C++ compiler 9.x can be used to compile XORP on Linux
platform.
3.6. Mac OS X
=============
* NOTE: I have no idea if XORP 1.7 and above on Mac OS X compiles
at all. --Ben
* All:
- Unicast routing appears to work.
- Multicast routing doesn't work, because the kernel doesn't have
the appropriate support.
* OS X 10.3.8 (Darwin 7.8.0):
- gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)
- The code compiles, and the internal tests appear to succeed.
* OS X 10.4.2 - 10.4.9 (Darwin 8.2.0 - 8.9.0) on PowerPC:
- gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)
- The code compiles, and the internal tests appear to succeed.
* OS X 10.4.5 (Darwin 8.5.3) on i386:
- gcc version 4.0.1 (Apple Computer, Inc. build 5250)
- The code compiles, and the internal tests appear to succeed.
* OS X 10.5.2 (Darwin 9.2.2), OS X 10.5.3 (Darwin 9.3.0),
OS X 10.5.4 (Darwin 9.4.0) on i386:
- gcc version 4.0.1 (Apple Computer, Inc. build 5465)
- The code compiles, and the internal tests appear to succeed.
3.7 Microsoft Windows
=====================
* Not supported any longer.
3.8. Cross-compilation
======================
If you do not already have a functional cross-compiler chain,
the directions below might work for you.
* If you want to build your own tool chain, check out crosstool-NG:
http://ymorin.is-a-geek.org/projects/crosstool
The example here is from my use of the:
arm-unknown-linux-gnueabi
config file for crosstool-NG 1.7.1. I disabled gcj and fortran.
Make sure you have a static glibc installed as cross-tools uses that
as part of it's compilation step. On Fedora: yum install glibc-static
* Cross-compile openssl (1.0.0.a):
cd to openssl-1.0.0.a
# Configure for arm cross-compiler
CC=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
RANLIB=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ranlib \
AR=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar \
./Configure --prefix=~/x-tools/arm-unknown-linux-gnueabi/local linux-armv4
# Build with arm cross compiler
CC=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
RANLIB=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ranlib \
AR=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar \
make
# install in cross-compiler tree.
chmod u+w ~/x-tools/arm-unknown-linux-gnueabi/
CC=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
RANLIB=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ranlib \
AR=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar \
make install
* Cross-compile ncurses. I'm using 5.7 with patches from here applied:
ftp://invisible-island.net/ncurses/5.7/
NOTE: Do not use -j4 or similar. Ncurses doesn't have good enough makefiles
for this to work properly.
# Configure for arm-linux
BUILD_CC=gcc \
BUILD_CPP=g++ \
CC=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
CXX=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
RANLIB=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ranlib \
LD=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ld \
AR=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar \
AS=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-as \
./configure --host=arm-unknown-linux-gnueabi --with-shared \
--prefix=${HOME}/x-tools/arm-unknown-linux-gnueabi/local
# Compile ncurses. On my system, this fails to link towards the end,
# but it gets far enough that the second build below with hacked CC
# can complete.
make \
CC=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
CXX=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
RANLIB=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ranlib \
LD=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ld \
AR=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar \
AS=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-as
# Finish compiling ncurses. Setting CC to g++ below isn't a typo..otherwise it
# it tries to link c++ code with gcc for some bone-headed reason.
make \
CC=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
CXX=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
RANLIB=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ranlib \
LD=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ld \
AR=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar \
AS=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-as
make \
CC=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
CXX=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
RANLIB=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ranlib \
LD=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ld \
AR=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar \
AS=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-as \
install
* Cross-compile libpcap (version 1.1.1)
# Configure it for cross-compiling.
CC=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
CXX=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
RANLIB=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ranlib \
LD=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ld \
AR=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar \
AS=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-as \
ac_cv_linux_vers=2 \
./configure --host=arm-unknown-linux-gnueabi --with-shared \
--prefix=${HOME}/x-tools/arm-unknown-linux-gnueabi/local \
--with-pcap=linux
# Build it
make \
CC=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
CXX=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
RANLIB=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ranlib \
LD=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ld \
AR=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar \
AS=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-as
# Install it
make \
CC=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
CXX=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
RANLIB=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ranlib \
LD=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ld \
AR=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar \
AS=~/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-as \
install
* Build xorp with the cross-compiler, specifying the path to openssl
scons build=arm-unknown-linux-gnu \
STRIP=${HOME}/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-sstrip \
CC=${HOME}/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
CXX=${HOME}/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
CFLAGS=-I${HOME}/x-tools/arm-unknown-linux-gnueabi/local/include \
CXXFLAGS=-I${HOME}/x-tools/arm-unknown-linux-gnueabi/local/include \
LINKFLAGS=-L${HOME}/x-tools/arm-unknown-linux-gnueabi/local/lib
This builds binaries, but I have no way actually to test them. --Ben
4. Performance optimization
===========================
By default, XORP is compiled with compiler debug information enabled
and moderate optimization.
See 'scons --help' for more options.
5. Setting-up Ubuntu for XORP Installation
==========================================
[ This section is at least partially out-dated. ]
1)Install Ubuntu from Live CD - all default values hold good.
2)Add your login name to the sudoers file
3)Edit interfaces file
a.sudo vim /etc/network/interfaces
b.Edit the config for eth0 and other required interfaces, remove dhcp
configuration.
Example eth0 configuration:
Remove the following eth0 config, if present:
auto eth0
iface eth0 inet dhcp
Key-in the following config.
auto eth0
iface eth0 inet static
address 10.10.10.50 --- specify interface ip address
netmask 255.255.255.0 --- specify subnet mask
network 10.10.10.0 --- specify network
broadcast 10.10.10.255 --- specify broadcast address
gateway 10.10.10.1 --- specify default gateway
Repeat for the other interfaces if necessary.
4)sudo /etc/init.d/networking restart
5)Create a group called "xorp" - Mandatory to run xorp.
addgroup xorp
6)Add yourself to the group "xorp". This is mandatory to run xorpsh.
adduser <username> xorp
7)Relogin/Reboot the system to take these permission changes into effect.
8)sudo apt-get update
9)sudo apt-get remove dhcp-client
10)sudo apt-get install openssh-server openssh-client
11)sudo apt-get install make
12)sudo apt-get install gcc
13)sudo apt-get install g++
14)sudo apt-get install openssl
15)sudo apt-get install cvs - To access xorpcvs
16)sudo apt-get install traceroute - To get rid of the warning when xorpsh
is installed.
17)sudo apt-get install libssl-dev
18)sudo apt-get install libpcap0.8-dev [optional]
19)sudo apt-get install snmpd [optional, but necessary if snmp compilation
is enabled via configure script]
20)sudo apt-get install libsnmp-dev [optional, but necessary if snmp
compilation is enabled via configure script]
21)sudo apt-get install iptables-dev
22)sudo apt-get install tcpdump [optional - to help in debugging]
23)sudo apt-get install wireshart [optional - to help in debugging]
24)sudo apt-get install tclsh [optional - to enable TCL scripting]
25)sudo apt-get install expect [optional]
6. Known problems
=================
See file ${XORP}/ERRATA.