[SOLVED] How to install a C compiler

Issues related to software problems.
Post Reply
saravr
Posts: 4
Joined: 2012/06/21 19:19:59

[SOLVED] How to install a C compiler

Post by saravr » 2012/06/22 18:25:12

Hi
I realized, after I ran a program, that I do not have any C compiler installed because in the output file I can read the next:
F77C = /usr/bin/g77 -O -fno-automatic
CC = 0
Where the path for f77 compiler is indicated, but the C compiler path not. I have been looking in /usr/bin directory but I did not find anyone. Can you say to me how to install a C compiler please?

pjwelsh
Posts: 2632
Joined: 2007/01/07 02:18:02
Location: Central IL USA

[SOLVED] How to install a C compiler

Post by pjwelsh » 2012/06/22 19:32:07

For CentOS 5, the /usr/bin/g77 belongs to a package called compat-gcc-34-g77. You can:[code]yum install compat-gcc-34-g77[/code]as root to get at least that package and dependencies.

saravr
Posts: 4
Joined: 2012/06/21 19:19:59

Re: How to install a C compiler

Post by saravr » 2012/06/25 19:38:54

Thank you pjwelsh, but I had alredy done it, I used yum install compat-gcc-34-g77 compat-libf2c-34 to install g77 and I did not have problem. My really problem is that I need to specify the path and the compiler for C. Just like CC = \path of my C comipler\c_compiler_command, but I do not know that path.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How to install a C compiler

Post by jlehtone » 2012/06/25 21:03:50

[code]yum list \*gcc\*[/code]
There seem to be packages compat-gcc-34, gcc, and gcc44, all providing a C compiler. There are corresponding C++ anf Fortran compiler packages as well (although only the compat* offers F77 -- the others have F95 or something).

Is it really necessary to use the old 3.4?

saravr
Posts: 4
Joined: 2012/06/21 19:19:59

Re: How to install a C compiler

Post by saravr » 2012/06/26 17:36:00

Thank you jlehtone, I saw the list following your indication and I installed gcc and all is fine. About your question, is not necesary the old 3.4, I just needed any F77 and C compiler to run a program and I used yum install compat-gcc-34-g77 compat-libf2c-34 because looking for an answer to my problem I saw that reccomendation in other forum and I applied.

saravr
Posts: 4
Joined: 2012/06/21 19:19:59

Re: How to install a C compiler

Post by saravr » 2012/06/28 17:02:58

SOLVED.
To insall g77: yum install compat-gcc-34-g77
To install gcc: yum install gcc

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: [SOLVED] How to install a C compiler

Post by AlanBartlett » 2012/06/28 20:06:17

Thank you for reporting back.

On your behalf and for posterity, this thread is marked [SOLVED].

Post Reply