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 05-06-2011, 08:50 AM   #1
Luyan
LQ Newbie
 
Registered: Sep 2009
Distribution: Slackware64 13.37
Posts: 8

Rep: Reputation: 0
gcc 4.4.6 on slackware64 13.37


Due to the fact that the gcc 4.5 is not currently supported by CUDA 4.0 I need to install an earlier version. I need to run nvcc with option --compiler-bindir. I chose a gcc 4.4.6. I downloaded gcc-4.4.6.tar.bz2 from here ftp://ftp.gnu.org/gnu/gcc/gcc-4.4.6/ and made the following steps:
Code:
/opt/gcc-4.4.6# ./configure --prefix=/opt/gcc-4.4.6
/opt/gcc-4.4.6# make
And after making I have some errors.
Code:
../.././gcc/cp/cfns.gperf:84: error: 'gnu_inline' attribute present on 'libc_name_p'
../.././gcc/cp/cfns.gperf:9: error: but not here
make[3]: *** [cp/except.o] Error 1
make[3]: Leaving directory `/opt/gcc-4.4.6/host-x86_64-unknown-linux-gnu/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/opt/gcc-4.4.6'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/opt/gcc-4.4.6'
make: *** [all] Error 2
What did I do wrong and how to fix it?

Last edited by Luyan; 05-06-2011 at 08:51 AM.
 
Old 05-06-2011, 11:25 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,551

Rep: Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862
I think you compiled it from the directory you told it to install to. That was brave. How about something like
cd ~/
rm -rf /opt/gcc-4.4.6
tar -zxvf /path/to/gcc-4.4.6.tar.gz

Which should make a directory gcc-4.4.6 in your homedir. then
cd gcc-4.4.6
./configure --prefix=/opt/gcc-4.4.6 --libdir=/opt/lib(64) --includedir=/opt/include -I/usr/include along with any other options you want and see how that goes.
 
1 members found this post helpful.
Old 05-06-2011, 11:40 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
GCC requires a build directory outside the gcc-4.4.6/ source.

Then it is :
cd build-gcc/ && ../gcc-4.4.6/configure --prefix=/opt/gcc446 --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

Details post # 2 here
http://www.linuxquestions.org/questi...-1-a-842567/#2

Other example, post # 10 here
http://www.linuxquestions.org/questi...2-a-874019/#10

..

Last edited by knudfl; 05-06-2011 at 11:54 AM.
 
1 members found this post helpful.
Old 05-06-2011, 12:28 PM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi,

Wouldn't it be better to take the Slackbuild.script for gcc ftp://sunsite.informatik.rwth-aachen.../source/d/gcc/ ? It should build gcc even with an older gcc-version, maybe one has to adapt the "version" variable in the script.

Markus
 
1 members found this post helpful.
Old 05-06-2011, 04:58 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
Quote:
Wouldn't it be better to take the Slackbuild.script for gcc ..
Not really. The gcc files in /usr/bin/ and /usr/lib/libgcc* will be
overwritten by a second install.

/opt/gcc446/ is perfect.
Then links 'gcc446' and 'g++446' can be made in /usr/bin/.

..
 
Old 05-06-2011, 05:10 PM   #6
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Well, this options can be changed in the Slackbuildscript:
Code:
...
./configure \
--prefix=/opt/gc466 \
--libdir=/usr/lib$LIBDIRSUFFIX \
--mandir=/usr/man \
--infodir=/usr/info \
--build=$ARCH-slackware-linux
...
here the relevant part which would have to be changed. Additional options can be added.

But maybe I'm wrong and did not fully understand the problem.

Markus
 
Old 05-07-2011, 10:25 AM   #7
Luyan
LQ Newbie
 
Registered: Sep 2009
Distribution: Slackware64 13.37
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
GCC requires a build directory outside the gcc-4.4.6/ source.
Exactly.

Thanks all for detailed answers with links.
Yes! I installed it without any errors!

markush, I thought about using Slackbuild, but it will take more time than compiling only what I need. See ftp://sunsite.informatik.rwth-aachen.../source/d/gcc/ (~50 mb!).
 
  


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
upgrading slackware64 13.1 multilib to slackware64 -current multilib Cultist Slackware 4 03-12-2011 10:04 AM
[SOLVED] SEGMENTATION FAULT using gcc 4.4.4 -O2 , works with gcc 4.1.0 -O2 or gcc 4.4.4 -O1 amir1981 Programming 36 07-26-2010 07:07 PM
[SOLVED] slackware64-13.0 + gcc -3.x dangazda Slackware 4 12-18-2009 05:10 PM
Updating from Slackware64-current to Slackware64 13. glore2002 Slackware 4 08-28-2009 07:50 PM
[SOLVED] Slackware64-C client wont detect Slackware64-C Samba server slackass Slackware 5 08-08-2009 12:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:05 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