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 08-10-2004, 03:44 PM   #1
hopbalt
Member
 
Registered: Jul 2003
Posts: 39

Rep: Reputation: 15
Using C compiler on Linux


OK, somebody gave me their old machine, its been completely abandoned, and I dont hardly know a thing about it. I am a complete newbie at Linux so please dont yell at me.

uname -a:

Linux machine_name 2.4.20-20.7.XFS.1.3.1smp #1 SMP <date> <time> i686 unknown

1) What kind of Linux is this? On startup, it doesnt tell me this information, so I have no clue if its redhat, caldera, mandrake, or what.

Now this is what happens when I type gcc or cc

gcc: Command not found

2) I thought all Linux software came with a C compiler?

3) So now I guess I have to download and install a compiler. This seems pretty complex to me. How do I do this?

Does one C compiler work on all the different types of Linux or do I have to find one that SPECIFICALLY matches that machine?

Please help


Last edited by hopbalt; 08-10-2004 at 03:47 PM.
 
Old 08-10-2004, 04:07 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
1.
Check if there is a file named /etc/redhat-release or /etc/debian_version.
Alternatively you can check /etc/issue and /etc/motd to get some more hints about the system.

2.
They should. But eg. SuSe personal doesn't. And you can always uninstall any component you want, but IMHO system is broken without c compiler (all W systems are broken).

3.
It is easiest to first figure out what distribution that is and then find a matching package that contains the c compiler in question.
 
Old 08-10-2004, 04:11 PM   #3
hopbalt
Member
 
Registered: Jul 2003
Posts: 39

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by ToniT
1.
Check if there is a file named /etc/redhat-release or /etc/debian_version.
Alternatively you can check /etc/issue and /etc/motd to get some more hints about the system.

2.
They should. But eg. SuSe personal doesn't. And you can always uninstall any component you want, but IMHO system is broken without c compiler (all W systems are broken).

3.
It is easiest to first figure out what distribution that is and then find a matching package that contains the c compiler in question.
OK I will look to see what can be found.
 
Old 08-10-2004, 04:13 PM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Personally I would start again anyway. Linux is free to download, get a copy of Fedora or Mandrake and start from scratch. You'll get a more up to date kernel for a start.

As for the line about:
Code:
 Linux machine_name 2.4.20-20.7.XFS.1.3.1smp #1 SMP <date> <time> i686 unknown
the 2.4.20 refers to the kernel version. Linux is only the kernel, the distributions add different packages to go with the kernel to give you a complete system. The system is technically GNU/Linux because the tools are part of the GNU project for a linux kernel architecture.
 
Old 08-10-2004, 04:17 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Many distro's will leave a file in
/etc
that gives an inidcation of what you're
dealing with ....

Mine for instance says
[tink@diggn:~]$ cat /etc/slackware-version
Slackware 10.0.0

I've seen similar things on debian, Redhat and
Mandrake machines ...
tink@server:~ ls -l /etc/*version*
-rw-r--r-- 1 root root 17 Jul 18 2002 /etc/debian_version


Cheers,
Tink
 
Old 08-10-2004, 04:19 PM   #6
hopbalt
Member
 
Registered: Jul 2003
Posts: 39

Original Poster
Rep: Reputation: 15
OK I looked:

In the etc directory, there IS a file called redhat-release.

There is no file called debian_version.

There is also a file called motd, but its an empty file.

There is also a file called issue, but it only says "GEMS Linux 1.8.9"

OK, so I'm assuming that this machine has Red Hat. Can I assume that its Redhat version 2.4 or what? Do those uname numbers go together with the Red Hat version or is that something else?
 
Old 08-10-2004, 04:19 PM   #7
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
hi have a look here for gcc

http://gcc.gnu.org/install/binaries.html
regards
 
Old 08-10-2004, 04:22 PM   #8
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Quote:
Originally posted by hopbalt

OK, so I'm assuming that this machine has Red Hat. Can I assume that its Redhat version 2.4 or what? Do those uname numbers go together with the Red Hat version or is that something else?
No, the uname numbers are JUST the linux kernel version. The distribution's own versioning system will be totally different. The current kernel is 2.6.x but Red Hat got upto release 9, Mandrake is on 10, Suse is on 9.1, Slackware is 10....the distribution numbering bears no resemblance to the kernel version.
 
Old 08-10-2004, 04:23 PM   #9
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 69
1) uname won't tell you which distribution you are running, only the version of the kernel that you have running.

Most Linux distributions will tell you a welcome message on each text console on a virtual terminal, so you can probably find this out by pressing Ctrl+Alt+F1 through Ctrl+Alt+F7 and seeing what it says. (F7 should get you back to a graphical desktop if you run one).

You could also try running “locate SuSE”, “locate debian” etc. as most distributions install at least one configuration or setup file containing the distro's name.

2) All major distributions usually ship with a C compiler on the install disks. This doesn't mean it will necessarily be installed. Assuming you're on an RPM based system (most distros except Debian seem to use RPM), you can run the command
Code:
rpm -qil gcc | more
to see information and installed files for the gcc package.

3) Debian is easy; you can install gcc by connecting to the 'net, and typing (as root)
Code:
apt-get --install gcc
If you don't have gcc (and you don't have the origninal install disks), then you'll need to go to http://www.rpmfind.net/ and download a binary RPM for gcc. rpmfind.net will also list several “dependency” programs and libraries like glibc; your system will need the right versions of all the various dependencies; either installed (rpm -qi name again to find out the versions you have) or downloaded as extra RPMs.

You can install the rpms using
Code:
rpm --install *.rpm
in the directory you downloaded from.

Note: gcc is big and will take a long time to download and install, especially if you try to download its dependencies as well.

You could also look at other C compilers for Linux, such as IBM's (which boasts slightly better optimisation than gcc for later processors).

4) As with any linux program, a C compiler will not work on all versions of Linux. It is, however, possible to compile a program and link it statically (copying the library routines instead of linking to them) so that it will work on any Linux or UNIX system with the same processor (and anything compiled for a 386 will run on later Intel processors too).

But I don't thing there are any staticly-linked C compilers out there. I may be wrong.

Hope that's of some help,

— Robert J. Lee
 
Old 08-10-2004, 04:26 PM   #10
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Quote:
Originally posted by Komakino


the 2.4.20 refers to the kernel version. Linux is only the kernel, the distributions add different packages to go with the kernel to give you a complete system. The system is technically GNU/Linux because the tools are part of the GNU project for a linux kernel architecture.
So technically it should be called KDE/Perl/GNU/linux........Richard Stallman did NOT write the "Kernel" and Richard Stallman did NOT have
any thing to do with Linux development at all.........so Technically GNU is NOT part of linux........
 
Old 08-10-2004, 04:26 PM   #11
hopbalt
Member
 
Registered: Jul 2003
Posts: 39

Original Poster
Rep: Reputation: 15
I went to that website for the binary pre-compiled gcc programs, and found the following available for download:

ftp://ftp.thewrittenword.com/package...ame/gcc-3.3.2/

gcc.3.3.2.rpm4.tar.z

The website said it was for i686 redhat linux 9. I guess I can try this and see if its compatible. Unfortunately, its 131 MB so I will be waiting many hours for download.

What if my Redhat is only release 7 or something? Does that mean this software wont work?


Last edited by hopbalt; 08-10-2004 at 04:31 PM.
 
Old 08-10-2004, 04:31 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally posted by hopbalt
In the etc directory, there IS a file called redhat-release.

OK, so I'm assuming that this machine has Red Hat.
Fair enough assumption ;)

Try a cat /etc/redhat-release


Cheers,
Tink
 
Old 08-10-2004, 04:31 PM   #13
penguin4
Senior Member
 
Registered: May 2004
Location: california
Distribution: mdklinux8.1
Posts: 1,209

Rep: Reputation: 45
hopbalt; from u r last post reply #6 u stated u found a reference to redhat
so it maybe remanents left by last owner. that could be a starting point. or as some of the others suggested acquire any other distro via download or
cd,whatever & update to that os acquired. my bet would be upgrade is better & probably newer more stable. 2nd ? compile if u wish its your machine (know what ur doing?) & that makes u boss(superuser/root) og for it!
 
Old 08-10-2004, 04:33 PM   #14
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Quote:
Originally posted by 320mb
So technically it should be called KDE/Perl/GNU/linux........Richard Stallman did NOT write the "Kernel" and Richard Stallman did NOT have
any thing to do with Linux development at all.........so Technically GNU is NOT part of linux........
I didn't say GNU was part of linux. A complete (though pretty useless) system would include the linux kernel and the gnu linker, gnu c, gnu make and gnu binutils. Hence GNU/Linux - in fact what Debian still refers to itself as. What you add on is optional but you are building on a GNU/Linux system. I'm just trying to describe around the issue, it can give new users a better insight into what linux actually is.

Hey it may even put an end to the "What version of linux is best for me?" questions that are forever posted by people too lazy to search.
 
Old 08-10-2004, 04:34 PM   #15
hopbalt
Member
 
Registered: Jul 2003
Posts: 39

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Tinkster
Fair enough assumption

Try a cat /etc/redhat-release


Cheers,
Tink
OK I did that and it said "GEMS Linux release"

GEMS is the name of the company that used to own this machine. They gave it away to a friend of mine who works there because they upgraded all their machines and threw the old ones away. Then the friend gave it to me.

What I dont understand is that even when the GUI loads up, it doesnt tell you antying about what version of Redhat it is.

I hope the RPM I'm downloading works.
 
  


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
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 01:35 PM
how i get C compiler in linux ss100 Linux - Software 2 01-10-2005 12:45 AM
Linux C++ Compiler hopmedic Programming 5 06-17-2004 04:37 PM
Is there a Forth compiler for LINUX quinnk Linux - Software 3 06-17-2004 12:07 PM
Compiler conundrum: Which came first, a compiler, or it's source code? fr0zen Programming 21 01-29-2004 05:31 AM


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