Page 1 of 1

[SOLVED] How to install a C compiler

Posted: 2012/06/22 18:25:12
by saravr
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?

[SOLVED] How to install a C compiler

Posted: 2012/06/22 19:32:07
by pjwelsh
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.

Re: How to install a C compiler

Posted: 2012/06/25 19:38:54
by saravr
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.

Re: How to install a C compiler

Posted: 2012/06/25 21:03:50
by jlehtone
[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?

Re: How to install a C compiler

Posted: 2012/06/26 17:36:00
by saravr
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.

Re: How to install a C compiler

Posted: 2012/06/28 17:02:58
by saravr
SOLVED.
To insall g77: yum install compat-gcc-34-g77
To install gcc: yum install gcc

Re: [SOLVED] How to install a C compiler

Posted: 2012/06/28 20:06:17
by AlanBartlett
Thank you for reporting back.

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