Difference between revisions of "Applications/Gcc"

From HPC
Jump to: navigation , search
m (MSummerbell moved page Applications/GCC to GCC without leaving a redirect)
m (Pysdlb moved page Applications/keep-Gcc to Applications/Gcc over redirect)
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__TOC__
 
__TOC__
===Application Details===
+
==Application Details==
 
*Description: The GNU Compiler Collection is a collection of compilers for C, C++, Objective-C, Fortran, Ada and Go.
 
*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
 
*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
+
*Module(s):gcc/legacy, gcc/4.9.3, gcc/5.2.0, gcc/6.3.0, gcc/7.3.0 and gcc/8.2.0
 
*Licence: GNU Licence
 
*Licence: GNU Licence
==Module==
+
 
 +
==Usage Examples==
 +
===Modules===
 
The gcc modules can be loaded by the following commands.
 
The gcc modules can be loaded by the following commands.
===Legacy===
+
====Legacy====
 
<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 ~]$ module add gcc/legacy
 
[username@login01 ~]$ module add gcc/legacy
 
</pre>
 
</pre>
===4.9.3===
+
====4.9.3====
 
<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 ~]$ module add gcc/4.9.3
 
[username@login01 ~]$ module add gcc/4.9.3
 
</pre>
 
</pre>
===5.2.0===
+
====5.2.0====
 
<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 ~]$ module add gcc/5.2.0
 
[username@login01 ~]$ module add gcc/5.2.0
 
</pre>
 
</pre>
===6.3.0===
+
====6.3.0====
 
<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 ~]$ module add gcc/6.3.0
 
[username@login01 ~]$ module add gcc/6.3.0
 +
</pre>
 +
====7.3.0====
 +
<pre style="background-color:#000000; color: white; font-family: monospace, sans-serif;">
 +
[username@login01 ~]$ module add gcc/7.3.0
 +
</pre>
 +
====8.2.0====
 +
<pre style="background-color:#000000; color: white; font-family: monospace, sans-serif;">
 +
[username@login01 ~]$ module add gcc/8.2.0
 
</pre>
 
</pre>
  
==Compilers==
+
===Compilers===
===C Compiler===
+
 
 +
The following are examples of how to compile programs using GCC.
 +
 
 +
====C Compiler====
 +
 
 
-fopenmp is not needed when compiling non openmp code
 
-fopenmp is not needed when compiling non openmp code
 
<pre style="background-color:#000000; color: white; font-family: monospace, sans-serif;">
 
<pre style="background-color:#000000; color: white; font-family: monospace, sans-serif;">
Line 32: Line 46:
 
</pre>
 
</pre>
  
===C++ Compiler===
+
====C++ Compiler====
 +
 
 
-fopenmp is not needed when compiling non openmp code
 
-fopenmp is not needed when compiling non openmp code
 
<pre style="background-color:#000000; color: white; font-family: monospace, sans-serif;">
 
<pre style="background-color:#000000; color: white; font-family: monospace, sans-serif;">
Line 39: Line 54:
 
</pre>
 
</pre>
  
===Fortran Compiler===
+
====Fortran 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 ~]$ gfortran -o test test.f03
 
[username@login01 ~]$ gfortran -o test test.f03
 
[username@login01 ~]$ ./test.f
 
[username@login01 ~]$ ./test.f
 
</pre>
 
</pre>
===Further Information===
+
 
[https://gcc.gnu.org/ GCC]
+
==Further Information==
 +
 
 +
* [https://gcc.gnu.org/ GCC]
 +
* [[Programming/C |Programming Support - C]]
 +
* [[Programming/C-Plusplus |Programming Support - C++]]
 +
 
 +
==Navigation==
 +
 
 +
* [[Main_Page|Home]]
 +
* [[Applications|Application support]] *
 +
* [[General|General]]
 +
* [[Programming|Programming support]]

Revision as of 12:49, 24 May 2019

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, gcc/7.3.0 and gcc/8.2.0
  • Licence: GNU Licence

Usage Examples

Modules

The gcc modules can be loaded by the following commands.

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

7.3.0

[username@login01 ~]$ module add gcc/7.3.0

8.2.0

[username@login01 ~]$ module add gcc/8.2.0

Compilers

The following are examples of how to compile programs using GCC.

C Compiler

-fopenmp is not needed when compiling non openmp code

[username@login01 ~]$ gcc -o test -fopenmp test.c
[username@login01 ~]$ ./test.c

C++ Compiler

-fopenmp is not needed when compiling non openmp code

[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

Further Information

Navigation