Difference between revisions of "Compilers:Frontenac"
(→Setup) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | '''Note: This pertains to the Frontenac system which is currently being built. Our users are gradually moved to it. You can only access this system if access has been activated. We will contact you when this has happened. If you are interested in migrating ahead of schedule, please contact us at cac.help@queensu.ca''' | ||
+ | |||
= Compilers at the Centre for Advanced Computing (Frontenac Cluster) = | = Compilers at the Centre for Advanced Computing (Frontenac Cluster) = | ||
Line 16: | Line 18: | ||
* For setting up the '''Intel Compiler Suite''' you need to issue the command <pre>module load intel</pre>. This defaults to the 2017.1 version of the compiler suite. An older version (2016.4) is available by specifying the version number <pre>module load intel/2016.4</pre> | * For setting up the '''Intel Compiler Suite''' you need to issue the command <pre>module load intel</pre>. This defaults to the 2017.1 version of the compiler suite. An older version (2016.4) is available by specifying the version number <pre>module load intel/2016.4</pre> | ||
− | * The public-domain compilers "gcc" and "gfortran" are available by default, i.e. they '''require no set-up'''. The current version for | + | * The public-domain compilers "gcc" and "gfortran" are available by default, i.e. they '''require no set-up'''. The current version for the default StdEnv/2020 is 9.3.0. Older versions can be accessed through version specification <pre>module load gcc/4.8.3</pre>. These compilers are often required when compiling public-domain programs. We recommend the use of these compilers unless Intel is required to improve performance. |
|} | |} | ||
Line 39: | Line 41: | ||
|ifort | |ifort | ||
|colspan="2"|icc | |colspan="2"|icc | ||
− | | | + | |module load intel |
|- | |- | ||
|Gnu | |Gnu | ||
Line 45: | Line 47: | ||
|gcc | |gcc | ||
|g++ | |g++ | ||
− | | | + | |module load gcc |
|} | |} | ||
Latest revision as of 18:40, 19 December 2023
Note: This pertains to the Frontenac system which is currently being built. Our users are gradually moved to it. You can only access this system if access has been activated. We will contact you when this has happened. If you are interested in migrating ahead of schedule, please contact us at cac.help@queensu.ca
Contents
Compilers at the Centre for Advanced Computing (Frontenac Cluster)
This is an introduction to the Fortran, C, and C++ compilers used on our Frontenac Compute Cluster. It is meant to give the user a basic idea about the usage of the compilers and about code optimization options. It cannot replace the documentation of the individual compilers.
Available CompilersWe are currently supporting two types Compiler Suites on the Frontenac Linux cluster :
Setup
|
Compiling and Linking
Compiling and linking is best done with a makefile. Here are a few common flags. Consult man pages for specific details (for instance "man gcc"). Compilingcompiler -c [options] name.ext where "compiler" stands for the compiler name, for instance "gfortran" for the GNU Fortran compiler. The file extension "ext" determines what source code is being compiled, for instance "f" means "fixed format" Fortran, f90 means "free format" Fortran (90), or "c" stands for C. "[options]" denotes additional compiler flags that usually start with a '-'. Linkingcompiler -o name [options] [libraries] list "compiler" see above. "name" is the name of the executable (if not specified, the default is "a.out". [options] see above. [libraries] is a list of libraries that need to be linked in, usually as a list of file names with full path, or as '-L' and '-l' combinations [see below]. "list" means a list of object files, usually with ".o" extension. Using the compilers and the linker in the above manner requires the proper setting of the PATH environment variable, i.e. prior set-up. Options / flagsThere are hundreds of compiler flags, and many of them are not required most of the time. A few that are in more frequent use are:
There are many more flags. They are documented in the man pages (e.g. "man ifort" for the Intel Fortran compiler), as well in the documentation for the compiler. Some compiler flags are only useful for parallel programs and will be discussed later. |
DocumentationThe best way to get a quick list of compiler options is to use the "man pages". Just type "man compiler" where "compiler" stands for the name of the compiler you want to use, and get a long explanation of all the relevant options. This is not very user-friendly, but great for a quick look-up.
Help
|