{"id":102,"date":"2013-04-19T17:47:49","date_gmt":"2013-04-19T17:47:49","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/?page_id=102"},"modified":"2018-04-13T09:04:07","modified_gmt":"2018-04-13T09:04:07","slug":"compilersgnu","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/software\/applications\/compilersgnu\/","title":{"rendered":"CompilersGNU"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>The GNU Compiler Collection supports a number of programming languages. <\/p>\n<p>Several versions are available on the CSF &#8211; please see the table below.<\/p>\n<p>Programming in Fortran or C is currently beyond the scope of this webpage. IT Services for Research run <a href=\"http:\/\/www.staffnet.manchester.ac.uk\/staff-learning-and-development\/academicandresearch\/practical-skills-and-knowledge\/it-skills\/research-computing\/research-courses\/\">training courses<\/a> which may be of interest.<\/p>\n<h2>Restrictions on use<\/h2>\n<p>Code may be compiled on the login node, but aside from &#8216;very&#8217; short test runs (e.g., one minute on fewer than 4 cores), executables must always be run by submitting to the batch system, SGE.<\/p>\n<h2>Set up procedure<\/h2>\n<p>This depends on which version you require.<\/p>\n<table>\n<tr>\n<td> <strong>Version<\/strong> <\/td>\n<td> <strong>Commands\/compilers available<\/strong> <\/td>\n<td width=\"35%\"><strong>Module required<\/strong> <\/td>\n<td> <strong>Additional Notes<\/strong> <\/td>\n<\/tr>\n<tr>\n<td> 3.4.6 <\/td>\n<td> gcc34, g++34 <\/td>\n<td> None <\/td>\n<td> <\/td>\n<\/tr>\n<tr>\n<td> 4.4.7 <\/td>\n<td> gcc, g++, gfortran <\/td>\n<td> None <\/td>\n<td> This is considered the system default <\/td>\n<\/tr>\n<tr>\n<td> 4.6.2  <\/td>\n<td> gcc, g++, gfortran <\/td>\n<td> module load compilers\/gcc\/4.6.2 <\/td>\n<td> <\/td>\n<\/tr>\n<tr>\n<td> 4.7.0 <\/td>\n<td> gcc, g++, gfortran <\/td>\n<td> module load compilers\/gcc\/4.7.0 <\/td>\n<td> <\/td>\n<\/tr>\n<tr>\n<td> 4.8.2 <\/td>\n<td> gcc, g++, gfortran <\/td>\n<td> module load compilers\/gcc\/4.8.2 <\/td>\n<td> <\/td>\n<\/tr>\n<tr>\n<td> 4.9.0 <\/td>\n<td> gcc, g++, gfortran <\/td>\n<td> module load compilers\/gcc\/4.9.0 <\/td>\n<td> <\/td>\n<\/tr>\n<tr>\n<td> 6.3.0 <\/td>\n<td> gcc, g++, gfortran <\/td>\n<td> module load compilers\/gcc\/6.3.0 <\/td>\n<td> <\/td>\n<\/tr>\n<\/table>\n<p>By loading\/swapping modules, the correct <code>LD_LIBRARY_PATH<\/code> will be set.<\/p>\n<h2>Running the application<\/h2>\n<h3>Example Code Compilations<\/h3>\n<pre>\r\n   gcc hello_world.c -o hello\r\n       #\r\n       # ...produces executable binary called \"hello\"...\r\n       #\r\n\r\n   gfortran hello_fworld.f77 -o f77hello\r\n   gfortran hello_fworld.f95 -o f95hello\r\n       #\r\n       # ...produce executable binary called \"f77hello\" or \"f95hello\"...\r\n       #\r\n<\/pre>\n<h3>Serial batch job submission<\/h3>\n<p>To submit a single core batch job to SGE:<\/p>\n<ul>\n<li>Make sure you have the correct module loaded if appropriate (see table above).<\/li>\n<li>An example SGE qsub script for use with a binary executable called myfortranprog compiled by using the GNU compilers:<\/li>\n<\/ul>\n<pre>\r\n    ## SGE stuff\r\n    ### Use the current\/submission directory as the working directory\r\n    #$ -cwd\r\n    ### Inherit the user environment settings from the login node (important so the job can find all commands)\r\n    #$ -V\r\n\r\n    .\/myfortranprog\r\n<\/pre>\n<ul>\n<li>To submit:<\/li>\n<\/ul>\n<pre>\r\n     qsub jobscript\r\n           #\r\n           # where 'jobscript' is replaced with the name of your file\r\n           #\r\n<\/pre>\n<h3>Parallel batch job submission<\/h3>\n<p>Your code, and thus the resulting executable, must use either OpenMP and\/or MPI in order to run in parallel. Please follow these links to find out how to submit batch of these types to SGE:<\/p>\n<ul>\n<li><a href=\"\/csf-apps\/software\/applications\/openmp\">CSF OpenMP information<\/a><\/li>\n<li><a href=\"\/csf-apps\/software\/applications\/openmpi\">CSF Open MPI information<\/a><\/li>\n<\/ul>\n<h2>Further info<\/h2>\n<ul>\n<li>Online manuals available from the command line:<\/li>\n<\/ul>\n<pre>\r\n     man gcc\r\n         # for the C\/C++ compiler\r\n\r\n     man gfortran\r\n         # for the fortran compiler\r\n<\/pre>\n<ul>\n<li><a href=\"http:\/\/gcc.gnu.org\/\">GNU Compiler Collection website<\/a><\/li>\n<li><a href=\"http:\/\/www.staffnet.manchester.ac.uk\/staff-learning-and-development\/academicandresearch\/practical-skills-and-knowledge\/it-skills\/research-computing\/research-courses\/\">Training Courses<\/a> run by IT Services for Research.<\/li>\n<li>If you require advice on programming matters, for example how to debug a code, or how to use MKL, please email i&#116;&#x73;&#x2d;r&#105;&#x2d;&#x74;e&#97;&#109;&#x40;&#x6d;a&#110;&#x63;&#x68;e&#115;&#x74;&#x65;r&#46;&#97;&#x63;&#x2e;u&#107;<\/li>\n<\/ul>\n<h2>Updates<\/h2>\n<p>During the August 2012 OS upgrade 4.1.2 was replaced by 4.4.6 and 4.3.5 was replaced by 4.6.2 and 4.7.0.<br \/>\nApril 2014 &#8211; Version 4.8.2 installed. June 2015 &#8211; 4.9.0 installed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview The GNU Compiler Collection supports a number of programming languages. Several versions are available on the CSF &#8211; please see the table below. Programming in Fortran or C is currently beyond the scope of this webpage. IT Services for Research run training courses which may be of interest. Restrictions on use Code may be compiled on the login node, but aside from &#8216;very&#8217; short test runs (e.g., one minute on fewer than 4 cores),.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/software\/applications\/compilersgnu\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":31,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-102","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/pages\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":11,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/pages\/102\/revisions"}],"predecessor-version":[{"id":4662,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/pages\/102\/revisions\/4662"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/pages\/31"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/media?parent=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}