LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 03-29-2010, 03:05 AM   #1
r_titino
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Rep: Reputation: 0
GCC compiler check!


Hi Every one,
can someone tell me how i can check whether there is a valid C compiler ! thanks
 
Old 03-29-2010, 03:06 AM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Code:
shell# $(which gcc) --version
should get you some results if you have gcc installed.

Sasha
 
Old 03-30-2010, 02:35 AM   #3
r_titino
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
thanks Sacha,
i 've run the cmd that u posted but i've got a command not found response ! Additional information i am facing the problem on Solaris !
 
Old 03-30-2010, 04:41 AM   #4
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
I have requested that this thread be moved to the /Solaris forum, so that it gets the attention it deserves.

Sasha
 
Old 03-30-2010, 06:30 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,482

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
A common case with Solaris is that there is a valid C compiler installed (or even more) but none is available on the PATH.

Usual locations to look for are:
Code:
/opt/*/bin/cc
/usr/sfw/bin/gcc
/usr/gnu/bin/cc
/usr/local/bin/gcc
 
Old 03-30-2010, 08:01 AM   #6
r_titino
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
thanks, i found the files at the Locations u suggested but when i am trying to run a C compiled script i get the"configure: error: no acceptable C compiler found in $PATH", Any Help ! thanks
 
Old 03-30-2010, 08:06 AM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,482

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Did you update your PATH before running "configure" ?
 
Old 04-05-2010, 02:54 AM   #8
r_titino
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
hi , I am not able to find the "path= " in the configure file !any Idea? thans
 
Old 04-05-2010, 08:52 AM   #9
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,482

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
PATH is not something you'll find in the configure script but an environment variable you set and export in your shell before running configure.
 
Old 04-05-2010, 10:35 AM   #10
r_titino
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
hi , i updated the path but still i am not getting any success! Note: the added path were : /usr/sfw/bin/gcc and /usr/local/bin/gcc (there were only available) thanks!
 
Old 04-05-2010, 11:30 AM   #11
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 682

Rep: Reputation: 63
So did you add the gcc path or the directory GCC is in?

PATH=$PATH:/usr/sfw/bin
 
Old 04-06-2010, 01:31 AM   #12
r_titino
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks i found that i had add the whole path not the Directory is in ! after adding the "PATH=$PATH:/usr/sfw/bin" i was able to compile but later on when i run the commande make i got the resuldts bellow, thanks for your help !:
gcc: language strconst not recognized
gcc: check_mysql.c: linker input file unused because linking not done
mv -f .deps/check_mysql-check_mysql.Tpo .deps/check_mysql-check_mysql.Po
mv: cannot access .deps/check_mysql-check_mysql.Tpo
*** Error code 2
make: Fatal error: Command failed for target `check_mysql-check_mysql.o'
Current working directory /tmp/nagios-plugins-1.4.14/plugins
*** Error code 1
The following command caused the error:
failcom='exit 1'; \
for f in x $MAKEFLAGS; do \
case $f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
list='gl tap lib plugins plugins-scripts plugins-root po'; for subdir in $list; do \
echo "Making $target in $subdir"; \
if test "$subdir" = "."; then \
dot_seen=yes; \
local_target="$target-am"; \
else \
local_target="$target"; \
fi; \
(cd $subdir && make $local_target) \
|| eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
make "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'
Current working directory /tmp/nagios-plugins-1.4.14
*** Error code 1
make: Fatal error: Command failed for target `all'
 
Old 04-06-2010, 09:23 AM   #13
r_titino
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Any i dea on how i can successful the command "make all" refering on the error i posted above! thanks
 
Old 04-08-2010, 08:39 PM   #14
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,189

Rep: Reputation: 105Reputation: 105
This is getting a bit complicated, because you aren't giving much detail at any given point, so the questions and answers are stretching out over many posts.

I would suggest a couple of things. First, tell us what it is that you are trying to do and why. Give us some background on where you are starting from -- the system you have and your own background.

Then, I would probably suggest that you go to http://www.sunfreeware.com and get packages from there unless you have some particular reason you want/need to build your own. If you do need to build your own, then you might start by getting all the build tools you need from Sunfreeware. This also has the advantage that the entries there will tell you all the dependencies so that you know what other things you have to get and install.

Finally, if you do get into building your own stuff from source, you will want to have a proper environment. This will depend on your particular system and needs. I have some E250s running Solaris 9, and I have a file /usr/local/src/env that contains the following:

Code:
#!/bin/ksh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/ucb:/usr/ccs/bin
export PATH
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/sfw/lib
export LD_LIBRARY_PATH
CPPFLAGS="-I/usr/local/include"
export CPPFLAGS
CFLAGS="-L/usr/local/lib -R/usr/local/lib"
export CFLAGS
LDFLAGS="-L/usr/local/lib -R/usr/local/lib"
export LDFLAGS
CC=gcc
export CC
When I'm going to be building something, I start out by doing

$ . /usr/local/src/env

That syntax (note that there is a space after the dot) makes it execute that code in place in your current environment rather than making a subprocess. Thus, the environment variables are set.

I have some other systems that are T5220s running Solaris 10, and I'm using the Sun CoolTools gccfss compiler. That build environment is a bit more complex and the env file is different. I need to build things there that will tap the unique capabilities of the T2 chip and get me into the crypto accelerators if I'm building something that needs them.

Also, for whatever you are building, the Makefile should tell you what environment variables it respects -- for example, certain values for CPPFLAGS. Check that if you need to. But, be sure to look at the files README and/or INSTALL that come along with the source.

HTH

Last edited by choogendyk; 04-08-2010 at 08:41 PM.
 
Old 04-10-2010, 03:44 AM   #15
mn35
LQ Newbie
 
Registered: Apr 2010
Location: Beirut, Lebanon
Distribution: Solaris
Posts: 8

Rep: Reputation: 0
Dear r_titino,
I agree with choogendyk, and is this your code or is it a download in the first place?

and what are you checking on mysql ? if you want to check if it is running: # ptree | grep mysql
( I do this for sybase).

Jiliagre,
I am working on Solaris 8, and it was there when i came, i dont know its history, how can i know if gcc is installed (its is not found on the paths you mentioned above) # > man gcc doesn't give anything.

I have cc in /usr/ucb/cc

do i download gcc, compile it with cc then use it ?
 
  


Reply

Tags
compiler, gcc


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
GCC compiler j360 Programming 3 02-10-2010 09:37 PM
gcc compiler. lchisholm Linux - Newbie 2 04-12-2009 10:29 AM
What are the commands to use to check whether the gcc compiler is working? babyswan Linux - Software 19 07-20-2007 01:19 AM
GCC Compiler rr_rr_29 Linux - Software 2 10-17-2005 04:14 AM
GCC Compiler..... mani_iips Linux - Newbie 4 08-08-2005 08:55 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration