LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Do I have gcc & gfortran installed? (https://www.linuxquestions.org/questions/linux-newbie-8/do-i-have-gcc-and-gfortran-installed-4175499960/)

AlexBB 03-30-2014 12:28 PM

Do I have gcc & gfortran installed?
 
1 Attachment(s)
Hi there. I have tried to install gcc and gfortran and it seems I succeeded although when I try to use search window I get negative results. Please, take a look at the image I posted. I used two commands: man gcc and gcc. When I typed gcc it gave me an error saying that no input file was provided which is true. The same happened when I typed gfortran.

Does it mean that I have both packages installed?

Thanks, - Alex

bcwagne 03-30-2014 02:31 PM

From your screenshot, it looks like they are installed.

To be sure, type the following, which will tell you the version numbers of gcc and gfortran:

Code:

gcc -v
gfortran -v

If you get something that says a bunch of stuff that tells you the version, target, etc. you have them installed. If you get "command not found" they are not installed.

Good luck!

AlexBB 03-30-2014 04:14 PM

2 Attachment(s)
bcwagne, thank you. This is what I got when I typed the first line:

Quote:

gcc -v
You can see it in the snapshot. So much output came out. It surprised me. and the next thumbnail will be about gfortran. Thanks for the idea. So, do you think everything is OK? - Alex

timl 03-30-2014 07:00 PM

Hi Alex,

I don't know about gfortran but I installed gcc on my fedora box and used this to compile an existing c file. I would say you are on the right track :)

Code:

[tim@beiderbeck ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-isl=/builddir/build/BUILD/gcc-4.8.2-20131212/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.2-20131212/obj-x86_64-redhat-linux/cloog-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC)
[tim@beiderbeck ~]$ ll /mnt/coding/
total 4096
-rwxrwxrwx. 1 506 506 4985 May 22  2013 selectserver.c
-rwxrwxrwx. 1 506 506 1028 May 21  2013 sizes.c
drwxr-xr-x. 2 502 502    0 May 17  2013 t2
-rwxrwxrwx. 1 506 506 2071 May 21  2013 universal.h
-rwxrwxrwx. 1 506 506 7745 May 22  2013 vitsim.c
[tim@beiderbeck ~]$ gcc /mnt/coding/selectserver.c -o /mnt/coding/selectserver.o
[tim@beiderbeck ~]$ ll /mnt/coding/
total 5120
-rwxrwxrwx. 1 506 506  4985 May 22  2013 selectserver.c
-rwxrwxrwx. 1 506 506 13640 Mar 31  2014 selectserver.o
-rwxrwxrwx. 1 506 506  1028 May 21  2013 sizes.c
drwxr-xr-x. 2 502 502    0 May 17  2013 t2
-rwxrwxrwx. 1 506 506  2071 May 21  2013 universal.h
-rwxrwxrwx. 1 506 506  7745 May 22  2013 vitsim.c


timl 03-30-2014 07:07 PM

gfortran looks good as well. Unfortunately I don't have any fortran files kicking around to try with but this is the response I received.

Code:

[tim@beiderbeck ~]$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-isl=/builddir/build/BUILD/gcc-4.8.2-20131212/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.2-20131212/obj-x86_64-redhat-linux/cloog-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC)
[tim@beiderbeck ~]$


AlexBB 03-30-2014 07:14 PM

Thank you timl.


All times are GMT -5. The time now is 11:44 AM.