Difference between revisions of "Applications/Gcc"
From HPC
MSummerbell (talk | contribs) (→C Compiler) |
MSummerbell (talk | contribs) |
||
Line 26: | Line 26: | ||
===C Compiler=== | ===C Compiler=== | ||
<pre style="background-color:#000000; color: white; font-family: monospace, sans-serif;"> | <pre style="background-color:#000000; color: white; font-family: monospace, sans-serif;"> | ||
− | [username@login01 ~]$ gcc -o test test.c | + | [username@login01 ~]$ gcc -o test -fopenmp test.c |
[username@login01 ~]$ ./test.c | [username@login01 ~]$ ./test.c | ||
</pre> | </pre> | ||
− | |||
===C++ Compiler=== | ===C++ Compiler=== | ||
− | + | <pre style="background-color:#000000; color: white; font-family: monospace, sans-serif;"> | |
+ | [username@login01 ~]$ g++ -o test -fopenmp test.c | ||
+ | [username@login01 ~]$ ./test.c | ||
+ | </pre> | ||
===Fortran Compiler=== | ===Fortran Compiler=== | ||
− | + | <pre style="background-color:#000000; color: white; font-family: monospace, sans-serif;"> | |
+ | [username@login01 ~]$ gfortran -o test test.f03 | ||
+ | [username@login01 ~]$ ./test.f | ||
+ | </pre> | ||
===Further Information=== | ===Further Information=== | ||
+ | [https://gcc.gnu.org/ GCC] |
Revision as of 10:15, 15 March 2017
Contents
Application Details
- Description: The GNU Compiler Collection is a collection of compilers for C, C++, Objective-C, Fortran, Ada and Go.
- Version(s):legacy, 4.9.3, 5.2.0, 6.3.0
- Module(s):gcc/legacy, gcc/4.9.3, gcc/5.2.0, gcc/6.3.0
- Licence: GNU Licence
Module
Legacy
[username@login01 ~]$ module add gcc/legacy
4.9.3
[username@login01 ~]$ module add gcc/4.9.3
5.2.0
[username@login01 ~]$ module add gcc/5.2.0
6.3.0
[username@login01 ~]$ module add gcc/6.3.0
Compilers
C Compiler
[username@login01 ~]$ gcc -o test -fopenmp test.c [username@login01 ~]$ ./test.c
C++ Compiler
[username@login01 ~]$ g++ -o test -fopenmp test.c [username@login01 ~]$ ./test.c
Fortran Compiler
[username@login01 ~]$ gfortran -o test test.f03 [username@login01 ~]$ ./test.f