GCC mayhem and duplicity


 
Thread Tools Search this Thread
Operating Systems Solaris GCC mayhem and duplicity
# 1  
Old 07-24-2007
Question GCC mayhem and duplicity

Hello there.
I have solaris 10 installed on a sun ultra 10 machine. I recently installed the gcc compiler suite from sunfreeware .

I was assuming that there was no C compiler installed with the solaris installtion by default. I checked this by typing gcc in the console only to find it saying command not found. Hence I installed the compiler suite and I thought now i have it taken care of.

Recently while trying to build the mplayer from source i stumbled upon a post
that updates the links to the gcc compiler and the gmake utility. This struck me that perhaps i might already have had the C/C++ compiler installed on by default. Just that it was not in the path and hence was not able to run when i typed gcc -v in the console.

Being curios I again tried the command gcc -v and this is what i got on the console:
Code:
Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs
Configured with: /gates/sfw10/builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/config
ure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/cc
s/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)

And i checked out the sunfreeware site again and it said the gcc compiler suite should get installed in /usr/local/. So now i see that there is another binary file called gcc located in /usr/local/bin/ and on executing /usr/local/bin/gcc -v this is what i get:
Code:
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/l
d --enable-shared --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.6

So it means that the version of the gcc compiler that gets invoked when i type gcc on the console is the one from /usr/sfw/lib/ and not from /usr/local/lib/ as in my path the former comes before the latter.
SO how do I uninstall the latter one? Do i even need to uninstall the latter one?

The latter one has a later version than the former one. Is there a way to tell the whole system that i want my default C/C++ compiler to be the latter one and not the former one?

If you see the post that i mentioned above, the person has done the following two things:
Code:
 
ln -s /usr/sfw/bin/gmake /usr/bin/make
ln -s /usr/sfw/bin/gcc /usr/bin/cc

Does doing these tell the system that my "default" C/C++ compiler is the one at /usr/sfw/bin/?
In my own case can i replace /usr/sfw/bin/gcc with /usr/local/bin/gcc? With regards to make, the "default" make utility found on my machine it seems is the one at /usr/ccs/bin/ . And then there is a gmake utility at /usr/sfw/bin/. So i can differentiate between make and gmake just by their names.

so do i need to make the symbolic links shown above or can i just ignore the fact that I now have two versions of the gcc compiler and two versions of the make untility. Im sure the gcc compilers are the GNU ones as sun does not ship its own compilers alongwith solaris 10 or does it? The make utility is from Sun and the gmake utility is obviosuly the Gnu variant.

I hope to hear from you people,

Regards,
Aijaz
# 2  
Old 07-24-2007
When I build something I explicitly specify the compiler using CC=/usr/local/bin/gcc or whatever to ensure I use the appropriate compiler.

Also, seriously consider using Sun's Studio11 with Solaris 9 or above rather than gcc.
# 3  
Old 07-24-2007
/usr/sfw has been discussed at length on opensolaris.org. But I didn't know that it's currently an official part of the OS. Does everyone else have /usr/sfw too?

Anyway the idea behind /usr/sfw is that it follows the model of /usr/ucb, /usr/xpg4, /usr/xpg5, etc. By fiddling with your PATH, you can decide which versions of various programs you use. /usr/sfw (which perhaps should have been called /usr/gnu) is supposed to skew everything to the gnu utilities. This "duplicity" has been a part of Solaris for quite a while. All that is happening is one more "standard" (well, gnu hates that term, "paradigm" maybe?) is being tossed into the mix.
# 4  
Old 07-24-2007
Quote:
Also, seriously consider using Sun's Studio11 with Solaris 9 or above rather than gcc.
Well..i installed the whole 5 CD set except the sendmail feature as I knew it gives problems later and i wudn't even use it anyways.

I haven't seen the studio 11 or any such thing on my system. Perhaps you may be referring to the additonal DVD tht gets shipped with the original OS release. May be that contains the required compilers and other utilities.

Anyway, would anyone please look at the post that i mentioned a link to and let me know if i need to update the links as the original author has done?.

Ive left a question there as well, but id like to hear from you guys as well...

REgards,
Aijaz
# 5  
Old 07-24-2007
Quote:
Originally Posted by aijazbaig1
I haven't seen the studio 11 or any such thing on my system.
You have to deliberately install it from media or a download.

Quote:
Originally Posted by aijazbaig1
Anyway, would anyone please look at the post that i mentioned a link to and let me know if i need to update the links as the original author has done?.
I have not had to update such links and I use both Studio11 and sunfreeware's gcc on my system.
# 6  
Old 07-25-2007
Quote:
I have not had to update such links and I use both Studio11 and sunfreeware's gcc on my system.
Great. I would soon try to see if I can build my own mplayer on my sparc machine and would post the details here. has any one of you tried that before? The author has narrated the steps for his 64 bit machine which isn't a sparc so I am a bit confused with regards to the crle command that he mentions somewhere in the middle of the post.

Does any one have any idea as to what that command actually does and do i need to execute that command for a sparc machine too?

Hoping to hear from you guys,

Regards,
Aijaz.
# 7  
Old 07-25-2007
crle has a man page
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

GCC installation .

I m trying to Install FTP (vsftpd-2.3.2) on my linux machine. # lsb_release -a LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: EnterpriseEnterpriseServer Description: Enterprise Linux Enterprise Linux Server release 5.2 (Carthage)... (7 Replies)
Discussion started by: pinga123
7 Replies

2. UNIX for Dummies Questions & Answers

Help with gcc and g++

Hi, I have recently got a job in unix, now training is going on and we have been practicing on telnet, so to practice at home I have installed vmware(virtual machine) and planning to download ubuntu. So my doubt is that whether I can write c and cpp progs in vi editor and can I run them by default... (5 Replies)
Discussion started by: vishal.973s
5 Replies

3. Solaris

Installing gcc - recieve error message gcc : cannot execute

AIM- Install Oracle 11g on Solaris using VMWare Steps 1.Logged on as root 2.Created subfolders à /usr/local/bin & /usr/local/bin/gcc 3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD 4.Copied files from CD to /usr/local/bin/gcc 5.Terminal (root) à pkgadd -d... (8 Replies)
Discussion started by: Ackers
8 Replies

4. SuSE

Linux gcc

Hi all, I am trying to create 64-bit shared libraries on Power PC "ppc64" architecture SuSe Linux 10 machine using gcc compiler. I am using "-m64" as an option for gcc to create 64-bit libraries which needs pam module. As we specify -m64 the compiler should look for all 64-bit... (0 Replies)
Discussion started by: vyshu2112
0 Replies

5. UNIX for Dummies Questions & Answers

gcc upgrade to 4.2

hi! i've done upgrading my gcc version from 3.4.4 to 4.2 from ports (make && make install) but when querying gcc --version, it still shows as follows: someone told me that after upgrade i need to use gcc42 command so meaning now I have 2 gcc version installed (3.4.4 and 4.2.0) ?... (1 Reply)
Discussion started by: rdns
1 Replies

6. Programming

gcc *.c -lcurses

Can someone tell me what does -|curses do here when the C program got compiled? gcc *.c -lcurses Thanks! (1 Reply)
Discussion started by: whatisthis
1 Replies

7. Programming

Gcc

Dear all, Any body please guide, i require a C which will run in Linux environment. Its urgent please. warm regards, Senthil K (1 Reply)
Discussion started by: Senthil
1 Replies

8. Programming

warning from gcc

I get this error warning. test.c: In function 'main': test.c:5: warning: incompatible implicit declaration of built-in function 'memset' After compiling this code #include <stdio.h> int main() { char pBuffer; memset(pBuffer, 0, 32); return 0; } What seems... (2 Replies)
Discussion started by: sledge76
2 Replies

9. Programming

Linking with gcc

Forgive as I am new to the gcc compiler and to linux. I am trying to compile/link a program for the first time and am receiving an error complaining about the crtbegin.o file. I use the -v option and get the following: Using built-in specs. Configured with: ../configure --enable-threads=posix... (1 Reply)
Discussion started by: jbeauchamp
1 Replies

10. Programming

A problem of GCC

Hi mates, I am a new comer of this forums. I have a problem while using function "fread(buffer, size, number, file-pointer)" to read a binary file. While I used the "fread()" to read the binary file under Solaris UNIX System, it worked very well. But it gets a incorrect result... (6 Replies)
Discussion started by: cquedugdylp
6 Replies
Login or Register to Ask a Question