• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3930
  • Last Modified:

How to install gcc on Solaris?

I am running solaris 8 and I would like to install gcc. After reading the installation notes at http://gcc.gnu.org/install, I still don't understand how to do it.

I have added the package for libgcc. After pkgadd the gcc libraries, I have no clue how to proceed. I am not sure besides the libraries, what other packages I need to add as I could not find the gcc compiler.

Could someone provide me with a simple step by step instruction on how to install gcc and how to perform a simple compile using gcc?

I also have a C++ compiler /opt/SUNWspro. Will the installation of gcc has any impact on the C++ compiler?

Please be patient with me I am new to compiling C++ in unix.
Thanks
0
rosetalk
Asked:
rosetalk
1 Solution
 
OtetelisanuCommented:
1. Load from sunfreeware.com gcc compiler
2. unzip the file
3. pkgadd -d <name from file>
4. PATH=$PATH:/usr/local/bin
5. gcc file.c

the compilername  gcc is in /usr/local/bin

0
 
micahmanCommented:
Yeah, I've had issues with compiling gcc on Solaris boxes in the past.  After my ump-teenth try I decided it may be better to just pkgadd the darn thing.  You can get a Solaris gcc pkg from sunfreeware.com, www.freeware4sun.com, and even http://www.ibiblio.org/pub/.  Don't forget to check the versions on the pkgs as sometimes they lag from the most recent version out there.

--- M
0
 
rosetalkAuthor Commented:
I have downloaded gcc-3.2.2-sol8-sparc-local.gz and it is about 273MB. This package includes the GNU C, C++, g77, Java, and OBJC compiler suites and support files. I don't want to install so many things. Are they neccessary? Are there any downloads with only the gcc compiler.

There is this statement in the gcc-3.2.2 comments that says "To use the gcc package from sunfreeware.com you MUST install all of the SUNW deveoper packages that come on Sun's Solaris CDs."

I did not installed the Sun developer packages in my server and I can't afford to them because of disk space constraint.

Please advise. Thanks.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
OtetelisanuCommented:
0
 
poggaCommented:
My advise would be to get the gcc package from http://www.sunfreeware.com/.  You'll find any dependancies listed there along with detailed installation instructions.

Once you've installed that package, I'd recommend getting the gcc source and building from scratch.

Anyway, thats my 2cents.
- Pogga.
0
 
liddlerCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by  Otetelisanu

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

liddler
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now