LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-25-2013, 09:57 AM   #1
r0w225
Member
 
Registered: Jul 2012
Location: South Africa
Distribution: Ubuntu precise pangolin 12.04LTS
Posts: 48

Rep: Reputation: Disabled
How to force NS2 to use the version 4.4 of gcc instead of 4.6.3


hi all
am having some problem with my ns2 , it was working fine up until it doesnt anymore and i am suspecting the updates to be incompatible with the version of my unix system [Ubuntu 12.04 LTS]. in fact when i ran a tcl script it runs in half and exits while it was running perfectely before. i dont know what must be the error because there is no error printd in the screen, apart of the fact that when i check the trace file i can see that the packets were not sent.
i would like to downgrade the gcc to the 4.4 version. How can i do this?
Code:
boris@boris-Veriton-M680G:~/ns-allinone-2.35$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
 
Old 11-25-2013, 02:02 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,321

Rep: Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581
First : You can have as many versions of gcc/g++ as you want,
installed at the same time.

Using gcc/g++ version 4.4 :
$ cd ns-allinone-2.35/ && export CC=gcc-4.4 CXX=g++-4.4 && ./install
*** This is not "forcing", but a quite ordinary command !

Reconfiguring in ns-2.35 :
$ cd ns-allinone-2.35/ns-2.35/ && export CC=gcc-4.4 CXX=g++-4.4 && ./configure


All versions, ns-2.26 ... ns-2.34 : Use gcc/g++ version 4.1.2 :
Post #18 http://www.linuxquestions.org/questi...022/page2.html

-
 
1 members found this post helpful.
Old 11-25-2013, 02:54 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,465

Rep: Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605
you can export the version ( as above , VERY good option for ns2)

set the version in "Alternatives" ( this is what it is meant for )

or use a shell script to set the links in /usr/bin to the version you want to use
-- the last way is what i use ( very old habit from before alternatives )
 
1 members found this post helpful.
Old 11-26-2013, 03:49 AM   #4
r0w225
Member
 
Registered: Jul 2012
Location: South Africa
Distribution: Ubuntu precise pangolin 12.04LTS
Posts: 48

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
First : You can have as many versions of gcc/g++ as you want,
installed at the same time.

Using gcc/g++ version 4.4 :
$ cd ns-allinone-2.35/ && export CC=gcc-4.4 CXX=g++-4.4 && ./install
*** This is not "forcing", but a quite ordinary command !

Reconfiguring in ns-2.35 :
$ cd ns-allinone-2.35/ns-2.35/ && export CC=gcc-4.4 CXX=g++-4.4 && ./configure


All versions, ns-2.26 ... ns-2.34 : Use gcc/g++ version 4.1.2 :
Post #18 http://www.linuxquestions.org/questi...022/page2.html

-
Hi knudfl
indeed i did that command before posting, while i was installing the 2.35 version (was using ns-allinone2.34)
and i thought it will appear when i typed gcc -v, but it shows the 4.6 version of gcc. so i thought it failed.
Thank you anyway for the assistance, i think of downgrading my version of ubuntu as well to see if ns2 will work again.
thanks
 
Old 11-26-2013, 05:00 AM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,465

Rep: Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605
There is NO NEED to reinstall a old version of Ubuntu
Just install a older copy of Gcc
i currently have Gcc 3.4, 4.3 and 4.6 installed and checking Gcc 4.8 for problems with the programs i MUST HAVE
 
Old 11-26-2013, 05:05 AM   #6
r0w225
Member
 
Registered: Jul 2012
Location: South Africa
Distribution: Ubuntu precise pangolin 12.04LTS
Posts: 48

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
There is NO NEED to reinstall a old version of Ubuntu
Just install a older copy of Gcc
i currently have Gcc 3.4, 4.3 and 4.6 installed and checking Gcc 4.8 for problems with the programs i MUST HAVE
Understood, but a question though, isnt it going to tell me that i already have the most current version of gcc and therefore refuse to download the old one?
if anyone is using ns2, can i forward to him the module to test-on

Last edited by r0w225; 11-26-2013 at 06:18 AM.
 
Old 11-26-2013, 02:15 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,465

Rep: Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605Reputation: 2605
NO
you install gcc 4.4 along side 4.6
you then export the version to use
or set the version id alternatives
or you set the version using a shell script

BUT you HAVE to install an older version of GCC
i normally have 3 or 4 different versions installed


The software IS DESIGNED so that more than one version can be installed

just like Python is designed
i have 3 versions on Python installed and 4 versions of gcc

Last edited by John VV; 11-26-2013 at 02:17 PM.
 
1 members found this post helpful.
Old 11-26-2013, 02:48 PM   #8
r0w225
Member
 
Registered: Jul 2012
Location: South Africa
Distribution: Ubuntu precise pangolin 12.04LTS
Posts: 48

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
NO
you install gcc 4.4 along side 4.6
you then export the version to use
or set the version id alternatives
or you set the version using a shell script

BUT you HAVE to install an older version of GCC
i normally have 3 or 4 different versions installed


The software IS DESIGNED so that more than one version can be installed

just like Python is designed
i have 3 versions on Python installed and 4 versions of gcc
Okay. I did all of that. Ns ia working but still run my tcl script
in half. Guess the problem is elsewhere but for this thread
I could do what i asked for. And installed an old version of gcc
thank you for your assistance, i will mark it as solve.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Version of gcc ns2 with ubuntu 12.04 ines8989 Linux - Networking 3 02-09-2015 04:59 AM
NS2 installation problem: no rule to make target 'VERSION' , needed by gen/version.c bilabongster Linux - Newbie 23 12-07-2011 12:54 PM
Firefox not emerging because of autoconf version - how to force older version? sirgregsalot Linux - Desktop 5 12-11-2006 07:37 PM
force gcc to compile in different version??? mu664life Linux - Newbie 5 04-08-2004 12:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration