LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   gcc 3.3.1 installation instead of gcc4.... (https://www.linuxquestions.org/questions/linux-newbie-8/gcc-3-3-1-installation-instead-of-gcc4-889781/)

kalsoufi 07-04-2011 02:15 AM

gcc 3.3.1 installation instead of gcc4....
 
hi every one,
it may not come as a surprise to anyone, however, I thought I can ask about it anyhow.
kindly i need your help.
I want to install NS2.28 on fedora 8, for that purpose I need to degrade my gcc 4.... to gcc 3.3.1.
I remove gcc4 by using yum remove gcc.
now I try to install the old version (gcc3.3.1)
for that purpose, I am following the instructions of the website (http://www.linuxfromscratch.org/blfs...neral/gcc.html)

when I type the following commands :

PATH_HOLD=$PATH &&
export PATH=/opt/gnat/bin:$PATH &&
cd gcc/ada &&
touch treeprs.ads [es]info.h nmake.ad[bs] &&
cd ../.. &&
mkdir ../gcc-build &&
cd ../gcc-build &&
CC=/usr/bin/gcc ../gcc-3.3.3/configure --prefix=/usr --enable-shared \
--enable-languages=c,c++,objc,f77,ada,java --enable-threads=posix \
--enable-__cxa_atexit --enable-clocale=gnu &&
make bootstrap &&
make -C gcc gnatlib_and_tools &&
make -k check &&
make install &&
ln -sf ../usr/bin/cpp /lib &&
ln -sf gcc /usr/bin/cc &&
ln -sf g77 /usr/bin/f77 &&
export PATH=$PATH_HOLD.

I got this error:
bash: --prefix=/usr/local: No such file or directory.

note that I have typed these commands as root.

anyone can help me , I will be grateful

knudfl 07-04-2011 03:49 AM

Welcome to LQ.

You can have as many compilers as you want, installed at the same time.

'ns-2.28' requires gcc-3.4.6 : # yum install compat-gcc-34-c++
The patch ns-2.28-gcc410.patch must be used.
(ns-allinone-2.28 may even build with the default compiler, g++-4.1.2:
one of the things I never tried on Fedora, gcc 3.4.6 is always present,
and nobody uses the old obsolete Fedora 8 any more.

Building ns-allinone-2.28 is described here, posts # 10 - # 11
http://www.linuxquestions.org/questi...failed-732164/
The complicated instruction is mostly for Ubuntu, Debian.
You can do with the patch alone.
And : export CC=gcc34 CXX=g++34 && ./install


About building a compiler : 1) Never replace the system compiler.
2) '--prefix=/usr' is not right. Should be to a hidden location e.g. opt/gcc333/.
And you can have links to a new compiler in /usr/bin/ gcc333 : g++333
A build example http://www.linuxquestions.org/questi...-1-a-842567/#2
> post #2. ( You don't want to build "gcc-java" / gcj.)

About the ada compiler : # yum install gcc-gnat
Yum Fedora 8 http://www.linuxquestions.org/questi...-5-a-849259/#3
> post #3.

..

kalsoufi 07-04-2011 02:37 PM

many thanks knudfl for your kind help as it is your behavior!
I have used yum install compat-gcc-34-c++,
but when I tried to check gcc version, I got this error:
[khaled@localhost ~]$ gcc -v
bash: gcc: command not found.

one thing more, should I install NS2.34 before going to do the steps that mentioned in Post #10 in http://www.linuxquestions.org/questi...failed-732164/

regards

knudfl 07-04-2011 05:09 PM

Fedora 8 : The simple method will do : No files from ns-allinone-2.34, no ns-allinone-2.34.

Tested on Fedora 8 today :
tar xvf ns-allinone-2.28 && patch -p0 < ns228-gcc40.patch && export CC=gcc34 CXX=g++34
&& cd ns-allinone-2.28/ && ./install

→ → No errors.

.

kalsoufi 07-04-2011 11:41 PM

Thank you very much for your help.
I has been installed successfully without NS2.34 or other version.
Dear:
I have changed "patch -p0 < ns228-gcc40.patch" to become "patch -p1 < ns228-gcc40.patch"
I do not know whether I am right or wrong, but anyway NS2.28 is working.

now I will try to patch 802.11e.
if you have suggestion for that, may you let me know.

again thank you very much!

kalsoufi 07-05-2011 01:38 AM

I tried to install 802_11e according the instructions of Readme of 802.11e.

however, when I typed make depend, I got this error:
make: *** No rule to make target `mac/802_11e/mac-802_11e.cc', needed by `depend'. Stop.
the major problem:

when I checked NS2 again:
[khaled@localhost ~]$ ns
bash: ns: command not found

so, what is your suggestion?
regards

knudfl 07-06-2011 08:28 AM

Quote:

No rule to make target `mac/802_11e/mac-802_11e.cc'
Which patch is this about ? ? A link please.


Adding ns and nam to a system PATH :
cd ns-allinone-2.28/ns-2.28/ ; su ; make install
cd ../nam-1.11/ && make install

( 'make install' will copy ns an nam to /usr/local/bin/ ).

..

kalsoufi 07-06-2011 12:14 PM

Thank you very much.
I installed Ns2.28 and 802.11e successfully.
I checked Ns2, it is working.
but nam is not working.

I have used Patch for 802.11 model (ns-2.28) in the following link:
http://www.tkn.tu-berlin.de/research/802.11e_ns2/

Next step, I'll try to edit tcl file.

knudfl 07-06-2011 12:38 PM

About nam : A patch "tk-8.4-lastevent.patch" is most often used for tk8.4*
to create a usable nam. I got an OK nam yesterday with no patching.

A binary nam for Fedora 8, etc., post #4 here
http://www.linuxquestions.org/questi...29-a-788391/#4



P.S. : #3 ... 'gcc -v' is for the default compiler, gcc-4.1.2 : # yum install gcc-c++
The gcc-3.4.6 compiler : 'gcc34 -v', and 'g++34 -v'

..


All times are GMT -5. The time now is 02:03 AM.