?
Solved

Solaris 5.8 COMPILER!!!

Posted on 2003-03-10
20
Medium Priority
?
788 Views
Last Modified: 2013-12-27
Hi everyone,
Itsme again, the lowly recent grad who can't figure his way out of a paper bag or a solaris box. Ok here is the problem. I just install 5.8 with a custom install that installed everything...(Solaris Software Group plus OEM). Everything loads up and everything looks. What I really want to do with this machine is install the new gcc and the new apache. I thought I should install the new gcc first. I downloaded the new version and un-tared it and have every set up the way they say to. When I run the configuration script I get thsi error:

Configuring for a sparc-sun-solaris2.8 host.
Created "Makefile" in /export/home/gcc/gcc-3.2.2/objdir using "mh-frag"
/usr/ucb/cc:  language optional software package not installed
*** The command 'cc -o conftest -g   conftest.c' failed.
*** You must set the environment variable CC to a working compiler.

well, I though I set the env var cc/CC and every other version of those that I can think of. What the heck can I do. It seems to me that it is pretty weird that there is no compiler on the system all ready if alot of apps need a complier to run. Any help will be much apprieciated.

                                                                                      T
0
Comment
Question by:tarek316
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +5
20 Comments
 
LVL 1

Expert Comment

by:SumeshDaftary
ID: 8105756
You have to set your PATH variable properly,

Once you installed gcc, you have to make right PATH or

link gcc to /usr/ucb/cc

confirm with command # which cc
0
 
LVL 1

Expert Comment

by:SumeshDaftary
ID: 8105814
You have to set your PATH variable properly,

Once you installed gcc, you have to make right PATH or

link gcc to /usr/ucb/cc

confirm with command # which cc
0
 

Author Comment

by:tarek316
ID: 8107382
I can't instasll gcc...that is the problem. What should the PATH be set to?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 38

Expert Comment

by:yuzh
ID: 8107578
Ok, here's an easy way to do it. download the binary from the following site: (free)

http://sunfreeware.com/

gunzip the file and then use packadd to install them.

I would use: gcc-2.95.3 (more stable), and you can get apache, autoconf-2.57, automake-1.7.2,make-3.80,binutils-2.11.2, flex-2.5.4a, gdb, glib-1.2.10,libgcc-3.2.2,libtool-1.4, perl-5.8.0, zlib-1.1.4 packages installed on your system. (You can pick more if want to).

Once your completed the installation. to use then, you need to set the env vars:

For sh/ksh/bash shells:

    PATH=$PATH:/usr/local/bin     # installed utilities
    MANPATH=$MANPATH:/usr/local/man # man page
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    export PATH MANPATH LD_LIBRARY_PATH

For csh/tcsh shell:
    set path=($path /usr/local/bin)         #installed utilities
    setenv MANPATH ${MANPATH}:/usr/local/man
    setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/lib


Cheers!
   


0
 
LVL 48

Expert Comment

by:Tintin
ID: 8107758
If you can't install a C compiler then you're stuffed!

No amount of setting paths is going to magically make a C compiler appear.
0
 

Author Comment

by:tarek316
ID: 8107800
I want thank you guys for your help so far....Tintin that is the problem exactly.....I did a full install from a actual Solaris CD....they must have given me a compile of some kind you would think....
0
 
LVL 48

Expert Comment

by:Tintin
ID: 8107859
The C Compiler was unbundled from the OS with the introduction of Solaris 2.x

It is a separately licenced product.

Mind you, most people just go off an install gcc as yuhz suggested.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 8108068
The GNU version of gcc should do the job for you. I use it.
0
 
LVL 8

Expert Comment

by:heskyttberg
ID: 8109409
Hi!

Just a few comments, in order for gnu gcc to work smoothly if you are planning on compiling anything like apache, openssh and the likes you might consider getting, automake, binutils, make from sunfreeware too.

I used thess in conjunction with gcc and never had any problems compiling apache and needed modules on Solaris 2.7.

Regards
/Hans - Erik Skyttberg
0
 
LVL 48

Expert Comment

by:Tintin
ID: 8110325
One other thing tarek,

You have Solaris 8 aka (mostly) SunOS 5.8

There's no such thing as Solaris 5.8
0
 
LVL 1

Accepted Solution

by:
SumeshDaftary earned 375 total points
ID: 8111048
Tarek,

Please select gcc-3.2.2-sol8-sparc-local.gz
(This is the more stable and right Gcc)

please move it to /tmp

# gunzip gcc-3.2.2-sol8-sparc-local.gz
# pkgadd -d /tmp/gcc-3.2.2-sol8-sparc-local

# PATH=$PATH:/usr/ucb/cc

This should be end of story.
0
 
LVL 1

Expert Comment

by:SumeshDaftary
ID: 8111313
Tarek,

Please select gcc-3.2.2-sol8-sparc-local.gz
(This is the more stable and right Gcc)

please move it to /tmp

# gunzip gcc-3.2.2-sol8-sparc-local.gz
# pkgadd -d /tmp/gcc-3.2.2-sol8-sparc-local

# PATH=$PATH:/usr/ucb/cc

This should be end of story.
0
 
LVL 8

Expert Comment

by:heskyttberg
ID: 8111756
Hi!

Oh also, I forgot one thing to untar gnu open source tars you need gnu tar and to unpack the .gz you might need gnu gunzip. The tar is becvause Solaris tar cannot handle too deep paths. This was supposed to be fixed in one of suns fixpacks, but it wasn't, at least not for me.

Good luck.

Regards
/Hans - Erik Skyttberg
0
 
LVL 48

Expert Comment

by:Tintin
ID: 8114711
Solaris 8 comes standard with gzip
0
 
LVL 2

Expert Comment

by:soupdragon
ID: 8116013
Just my 2 cents worth - I think gcc make and a whole bunch of freeware stuff is delivered on the Software Companion CD if you have the Solaris 8 media pack.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 8116097
The CD's are fine, but most people like to get a more recent version from http://sunfreeware.com/
0
 
LVL 38

Expert Comment

by:yuzh
ID: 8116544
If you want to do serious work with C compilier, pick a stable version rather than a new one!

I remember I have trouble with gcc-3.0.3 for compliing electric-6.05 (VLSI software), no problem with gcc-2.95.3 (I also try it for compling apache, msql, php, magic (VLSI) ..., tgif etc) works fine for me.

gcc-3.2.2 should be better than gcc-3.0.3, but I have never try it.

Cheers!


0
 
LVL 10

Expert Comment

by:elf_bin
ID: 8165338
For cc there's quite a lot to setup.  Including the following environmental variables:
1)  COMPILER_PATH (path to compiler)
2)  CPLUS_INCLUDE_PATH (path to C++ includes)
3)  C_INCLUDE_PATH (path to C includes)
4)  LIBRARY_PATH (library path)
5)  LD_LIBRARY_PATH (ld's library path - during linking)
6)  MANPATH (for additional man's you've installed)
7)  PATH (for the compiler you've installed)
8)  GCC_PREFIX (path to gcc software - if you've installed sfw)

Hope this helps.

0
 
LVL 10

Expert Comment

by:elf_bin
ID: 8172281
The environmental variables:

# Sun C 64-bits
CC=/opt/SUNWspro/bin/cc
CFLAGS="-fast -xarch=v9"
CXX=/opt/SUNWspro/bin/CC
CXXFLAGS="-fast -xarch=v9"
LDFLAGS="-s -xarch=v9"

# Sun C 32-bits
CC=/opt/SUNWspro/bin/cc
CFLAGS="-O"
CXX=/opt/SUNWspro/bin/CC
CXXFLAGS="-O"
LDFLAGS="-s"

# GCC
CC=/opt/sfw/bin/gcc
CFLAGS="-O"
CXX=/opt/sfw/bin/g++
CXXFLAGS="-O"
LDFLAGS="-s"
export CC CFLAGS CXX CXXFLAGS LDFLAGS

And here is a good link for what is exactly going on:
http://www.geocities.com/paedalbu/compile

I think that should make it all clear.
0
 

Expert Comment

by:RayZilla
ID: 11174231
Please select gcc-3.2.2-sol8-sparc-local.gz
(This is the more stable and right Gcc)

please move it to /tmp

# gunzip gcc-3.2.2-sol8-sparc-local.gz
# pkgadd -d /tmp/gcc-3.2.2-sol8-sparc-local

# PATH=$PATH:/usr/ucb/cc

I successfully used the Accepted Answer ( As seen Above ) from SumeshDaftary with a newer version :
gcc-3.3.2-sol8-sparc-local.gz  and it works too , great Job !!

RayZilla
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question