{"id":713,"date":"2021-09-02T15:27:51","date_gmt":"2021-09-02T14:27:51","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf4\/?page_id=713"},"modified":"2021-09-02T15:35:43","modified_gmt":"2021-09-02T14:35:43","slug":"pgi","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/software\/compilers\/pgi\/","title":{"rendered":"PGI Compiler"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>The Portland Compiler Suite (now owned by Nvidia) contains Fortran 95, Fortran 90, Fortran 77, C, C++, HPF and CUDA Accelerator compilers for machines running 64bit Linux.<\/p>\n<p>Version 18.10 is installed on CSF4.<\/p>\n<p>Note: the PGI CUDA Accelerator supports OpenACC compiler directives.<\/p>\n<h2>Restrictions on use<\/h2>\n<p>There are only two network licenses available site wide for each of Fortran and C\/C++.  If you get a license related error, it is almost certainly because all of our licenses are in use and you should try again at a later time.  For further licensing information see the following webpage:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.applications.itservices.manchester.ac.uk\/show_product.php?id=321\">http:\/\/www.applications.itservices.manchester.ac.uk\/show_product.php?id=321&#038;tab=licensing<\/a><\/li>\n<\/ul>\n<h2>Set up procedure<\/h2>\n<p>To gain access to these compilers, run <strong>one<\/strong> of the following command after logging into the login node.<\/p>\n<pre>\r\nmodule load pgi\/18.10          # Will use some GCC 6.4.0 functionality\r\n<\/pre>\n<h2>Basic compilation commands<\/h2>\n<p>Basic compilation commands are as follows:<\/p>\n<pre>\r\n# C\r\npgcc hello.c -o hello\r\n\r\n# C++ (note: use pgc++ if link compatibility with the GNU C++ compiler is required)\r\npgCC hello.cpp -o hello\r\npgcpp hello.cpp -o hello\r\n\r\n# Fortran\r\npgf90 hello.f90 -o hello\r\npgf95 hello.f90 -o hello\r\npgfortran hello.f90 -o hello\r\n\r\n# High performance fortran\r\npghpf hello.hpf -o hello\r\n<\/pre>\n<h3>Target Architectures<\/h3>\n<p>To compile specifically for architectures such as Intel Skylake use the <code>-tp=<\/code><em>architecture<\/em> flag. For example:<\/p>\n<pre>\r\npgcc -tp=skylake hello.c -o hello_skylake\r\n<\/pre>\n<p>Note that the installed version of the PGI compiler does not support Intel Cascade Lake found in CSF4. This is newer than Skylake. You may still compiler specifically for Skylake and your code will be optimized for the features found in that CPU. This will give you some optimization but not the maximum that the Cascade Lake could actually do.<\/p>\n<h2>Sample code<\/h2>\n<p>Sample code can be found in the subfolders of the <code>$PGIEXAMPLES<\/code> directory<\/p>\n<pre>\r\nAutoPar  CUDA-Fortran  CUDA-Libraries  CUDA-x86-SDK  F2003  MPI  OpenACC  OpenMP\r\n<\/pre>\n<p>Each subfolder contains makefiles to compile the sample code. If you copy these folders and see an errors like <code>\/usr\/bin\/ld: cannot open output file c1.exe: Permission denied<\/code> when compiling ensure you have the necessary permissions to write files to your folders.<\/p>\n<h2>Further information<\/h2>\n<p>Once you have loaded the PGI module (see <strong>set up procedure<\/strong>), basic documentation is available as a manpage:<\/p>\n<pre>\r\nman pgcc\r\nman pgf90\r\nman pgc++\r\n<\/pre>\n<h2>Further Info<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.pgroup.com\/\">PGI Compiler website<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Overview The Portland Compiler Suite (now owned by Nvidia) contains Fortran 95, Fortran 90, Fortran 77, C, C++, HPF and CUDA Accelerator compilers for machines running 64bit Linux. Version 18.10 is installed on CSF4. Note: the PGI CUDA Accelerator supports OpenACC compiler directives. Restrictions on use There are only two network licenses available site wide for each of Fortran and C\/C++. If you get a license related error, it is almost certainly because all of.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/software\/compilers\/pgi\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"parent":57,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-713","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/comments?post=713"}],"version-history":[{"count":6,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/713\/revisions"}],"predecessor-version":[{"id":720,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/713\/revisions\/720"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/57"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/media?parent=713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}