actually it doesn't matter if you which little version of gcc-2.95 or -3.3, the difference between 2.95.3&2.95.4 or between 3.3.5&3.3.6 is so small that it doesn't seem to matter anything when you compile the p2psim.
so, just install any version possible of 2.95 or 3.3 of the ubuntu, all wil be ok.
on the archive site of ubuntu, (http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/),we can find out the the deb package of gcc-2.95.4 or 3.3.6. so, just use these stuff and we are done.
what's more the 2.95.4 only have the i386 version and 3.3.6 have the amd64 version.
for the amd64 version, on this computer, in other words, mine, i've download the files:
cpp-3.3_3.3.6-15ubuntu6_amd64
g++-3.3_3.3.6-15ubuntu6_amd64
gcc-3.3_3.3.6-15ubuntu6_amd64
gcc-3.3-base_3.3.6-15ubuntu6_amd64
libstdc++5_3.3.6-15ubuntu6_amd64
libstdc++5-3.3-dbg_3.3.6-15ubuntu6_amd64
libstdc++5-3.3-dev_3.3.6-15ubuntu6_amd64
libstdc++5-3.3-pic_3.3.6-15ubuntu6_amd64
and use the command:
sudo dpkg --force-depends -i xxx.deb
to force the install of all the deb files.
while you are installing the packages, it may warn you that one may depend the other. so just try several times to make sure all files have their dependencies installed.
the following confused me a lot, but do as the instruction, we get what we want:
安装完成之后,在系统里会多出:gcc-3.3
目前系统里有两个版本的gcc,缺省时gcc4.4.3;需要改变系统的缺省配置:
看一下当前安装的gcc的各个版本
ls /usr/bin/gcc* -ll
lrwxrwxrwx 1 root root 7 2010-08-09 14:15 /usr/bin/gcc -> gcc-4.4
-rwxr-xr-x 1 root root 80916 2008-05-08 17:00 /usr/bin/gcc-3.3
-rwxr-xr-x 1 root root 220428 2010-03-27 06:46 /usr/bin/gcc-4.4
-rwxr-xr-x 1 root root 15970 2008-05-08 16:57 /usr/bin/gccbug-3.3
增加gcc3.3.6和gcc4.4.3可选项
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-3.3
切换版本到gcc-3.3
.1) 简单,方便
ln -sf /usr/bin/gcc-3.3 /usr/bin/gcc
.2) 麻烦,不好用
$ sudo update-alternatives --config gcc
现有 2 个可选项,它们都提供了“gcc”
< 选择 可选项----------------------------------------------- 1 /usr/bin/gcc-3.3*+
2 /usr/bin/gcc-4.4
要维持缺省值[*],按回车键,或者键入选择的编号:1
使用“/usr/bin/gcc-3.3”来提供“gcc”。
至此gcc3.3.6安装成功
==================
so that seems to be all about installing the gcc
then, let's come to the p2psim part
first, configure
we need to use the parameter "--build=i386-linux-gnu" to configure the p2psim for the i386, or it can't recgonize the x64 architecture.
pay attention to the configure message. mine is as the following:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets ${MAKE}... yes
checking build system type... i386-pc-linux-gnu
checking host system type... i386-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking for gm4... no
checking for gnum4... no
checking for m4... /usr/bin/m4
checking whether the compiler implements namespaces... yes
checking whether the compiler has ext/hash_map... yes
checking if malloc debugging is wanted... no
checking if Thomer's malloc debugging is wanted... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for restore_graph in -lgb... yes
checking if ssl is wanted... OpenSSL found in /usr
configure: creating ./config.status
config.status: creating Makefile
config.status: creating eventgenerators/Makefile
config.status: creating p2psim/Makefile
config.status: creating observers/Makefile
config.status: creating protocols/Makefile
config.status: creating failuremodels/Makefile
config.status: creating topologies/Makefile
config.status: creating events/Makefile
config.status: creating libtask/Makefile
config.status: creating misc/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing default-1 commands
it's not so complicated. don't be scared. and figure out whether the checking part works fine.
e.g.
the checking for m4 part, at the first try, my system didn't have it. and it seemed you can't google it out where you can get it. here, we need to install the automake or autoconfig, and all things done.
the checking for graph. it may warn you your system lacks of the stanford graph base. so just use the 'sync software manager' you get in the ubuntu to search and you will get it.
maybe that's all about that.
oh, yeah, the command to run p2psim is like,
p2psim/p2psim example/protocol.txt example/topology.txt example/events.txt
pay attention to the order of the files, it seems it's not so inteligent to figure out that