LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-01-2011, 11:30 AM   #1
Ztif
LQ Newbie
 
Registered: Jun 2011
Posts: 3

Rep: Reputation: Disabled
Assistance in compiling an old version of gcc with a newer one


I am working on a university workstation and need to use an old version of gcc (either 4.0 or 4.1) and am currently using 4.4.2. I do not have admin rights nor can I get them so using aptitude is out of the question. I was told I should compile the old version with the current one. I am very new to this sort of thing and haven't a clue what to do or how to go about compiling my program once I have gotten the older version.

Thanks for the help.
 
Old 07-01-2011, 11:59 AM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720
Just download the old version and compile it.
 
Old 07-01-2011, 01:01 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
GCC requires a build directory outside the source folder, and the
gmp + mpfr sources unpacked into the gcc-4.1.2/ folder.
'gmp' and 'mpfr' must be the same versions as used by your system gcc.


tar xvf gcc-4.1.2.tar.bz2 && cd gcc-4.1.2/ && tar xvf gmp-<version>
&& tar xvf mpfr-<version> && mv gmp* gmp && mv mpfr* mpfr
&& cd ../ && mkdir build-gcc && cd build-gcc/ &&
../gcc-4.1.2/configure --prefix=/home/Ztif/ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --with-system-zlib --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs
&& make && make install : And you will get /home/Ztif/bin/gcc : g++

..

Last edited by knudfl; 07-01-2011 at 01:02 PM.
 
  


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
one more error building GCC - related with the newer version of Glibc?? lfs63 Linux From Scratch 1 02-17-2008 10:20 AM
install or upgrade newer or older gcc version saistain Linux - Software 1 10-19-2007 11:26 PM
Gcc version for compiling kernel 2.6.18 TemplaraPheonix Linux - Kernel 3 10-02-2006 07:20 PM
Young studant in need of assistance with c compiling using gcc madh@ter Red Hat 3 08-09-2004 04:12 PM
Newer version of glibc means i cant install gcc coop Red Hat 0 09-21-2003 02:40 AM


All times are GMT -5. The time now is 12:58 AM.

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