{"id":891,"date":"2018-11-20T16:25:24","date_gmt":"2018-11-20T16:25:24","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=891"},"modified":"2018-11-20T16:53:21","modified_gmt":"2018-11-20T16:53:21","slug":"__trashed","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/libraries\/naglibraries\/__trashed\/","title":{"rendered":"Mark 23 C and FORTRAN Libraries"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>This is mark 23 of the NAG Library. The following versions are available (see modulefiles below):<\/p>\n<ul>\n<li>CLL6I23DCL &#8211; C library for Intel compiler &#8211; serial version<\/li>\n<li>FLL6I23DCL &#8211; FORTRAN library for Intel compiler &#8211; serial version<\/li>\n<li>FSL6I23DCL &#8211; FORTRAN library for Intel compiler &#8211; parallel SMP version<\/li>\n<\/ul>\n<p>Note that only the static versions of the NAG libraries may be used in this version. The compilation method that links against the NAG <em>shared<\/em> libraries is not compatible with CSF3. See the example build scripts below.<\/p>\n<h2>Set up procedure<\/h2>\n<p>We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example jobscript below for how to do this. Alternatively, you may load modulefiles on the login node and let the job <abbr title=\"add '#$ -V' to your jobscript\">inherit these settings<\/abbr>.<\/p>\n<p>You should load the Intel compiler modulefile:<\/p>\n<pre>\r\nmodule load compilers\/intel\/17.0.7\r\n<\/pre>\n<p>Then load <em>one<\/em> of the following modulefiles:<\/p>\n<pre>\r\nmodule load libs\/intel\/nag\/c_mark23_intel                 # Version CLL6I23DCL\r\nmodule load libs\/intel\/nag\/fortran_mark23_intel           # Version FLL6I23DCL\r\nmodule load libs\/intel\/nag\/fortran_smp_mark23_intel       # Version FSL6I23DCL\r\n<\/pre>\n<p>This will set the following environment variables for easy access to the libraries, header files and example scripts:<\/p>\n<pre>\r\nNAG_HOME       = \/opt\/apps\/libs\/intel\/nag\/<em>version<\/em>\r\n\r\n# The following environment variables have the value added to any existing setting\r\nLIBRARY_PATH   = $NAG_HOME\/lib\r\nC_INCLUDE_PATH = $NAG_HOME\/include\r\nPATH           = $NAG_HOME\/scripts\r\n<\/pre>\n<p>The <code><em>version<\/em><\/code> directory will be the lowercase version code, for example <code>cll6i23dcl<\/code><\/p>\n<h2>Compiling the example programmes<\/h2>\n<p>The NAG library ships with example programs for every routine available. The easiest way to compile the examples is to use the supplied scripts as details below. These also show you the full compilation commands which may help with compiling your own software.<\/p>\n<p>We list the scripts available in each version of the NAG library and then show an example usage below.<\/p>\n<h3>C Library &#8211; CLL6I23DCL<\/h3>\n<p>The following scripts are available, which can be run directly from a jobscript:<\/p>\n<pre>\r\n# Only the static compilation method can be used, as shown by:\r\nnagc_example\r\nnagc_example_mkl\r\n\r\n# The following scripts CANNOT be used on CSF3 \r\n# nagc_example_shar\r\n# nagc_example_shar_mkl\r\n<\/pre>\n<p>which provide easy to use interfaces to compile, link and run each of these examples. This <em>scripts<\/em> directory is added to your PATH environment variable for convenience. The differences between these scripts are shown below:<\/p>\n<ul>\n<li><strong>nagc_example<\/strong>, to link with the NAG self-contained static library libnagc_nag.a<\/li>\n<li><strong>nagc_examle_mkl<\/strong>, to link with the NAG static library libnag_mkl.a and the supplied MKL libraries<\/li>\n<\/ul>\n<h3>FORTRAN Libraries &#8211; FSL6I23DCL and FLL6I23DCL<\/h3>\n<p>The following scripts are available, which can be run directly from a jobscript:<\/p>\n<pre>\r\n# All of the build methods can be used with the FORTRAN libraries\r\nnag_example         nag_example_mkl\r\nnag_example_shar    nag_example_shar_mkl\r\nnag_recompile_mods\r\n<\/pre>\n<p>which provide easy to use interfaces to compile, link and run each of these examples. This <em>scripts<\/em> directory is added to your PATH environment variable for convenience. The differences between these scripts are shown below:<\/p>\n<ul>\n<li><strong>nag_example_mkl<\/strong>, to link with the NAG static library libnag_mkl.a and the supplied MKL libraries<\/li>\n<li><strong>nag_example_shar_mkl<\/strong>, to link with the NAG shareable library libnag_mkl.so and the supplied MKL libraries<\/li>\n<li><strong>nag_example<\/strong>, to link with the NAG self-contained static library libnag_nag.a<\/li>\n<li><strong>nag_example_shar<\/strong>, to link with the NAG self-contained shareable library libnag_nag.so<\/li>\n<\/ul>\n<p>The extra <code>nag_recompile_mods<\/code> script will recompile the FORTRAN <code>.mod<\/code> supplied with the library in to a local directory.<\/p>\n<h3>Running the scripts<\/h3>\n<p>These can be used to inform you how to compile the NAG library according to your needs. The scripts will copy the source code to your <em>current working directory<\/em>, compile the source code and then run it.<\/p>\n<p>For example, to compile, link and run the example for the routine <strong>a00aac<\/strong> using the NAG static library libnagc_mkl.a and the NAG-supplied MKL libraries you would submit a jobscript containing:<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#$ -cwd\r\n#### Optionally request more 2 or more cores if using the NAG SMP library\r\n#### #$ -pe smp.pe 4\r\n\r\nmodule load compilers\/intel\/17.0.7\r\nmodule load libs\/nag\/c_mark23_intel\r\n\r\n# Even though we are using the NAG serial library, the Intel MKL libraries\r\n# may use OpenMP multithreading. So we must always inform OpenMP of how many\r\n# cores our job is permitted to use.\r\nexport OMP_NUM_THREADS=$NSLOTS\r\n\r\nnagc_example_mkl a00aac\r\n<\/pre>\n<p>Submit your job using<\/p>\n<pre>\r\nqsub <em>jobscript<\/em>\r\n<\/pre>\n<p>where <code><em>jobscript<\/em><\/code> is the name of your jobscript.<\/p>\n<p>The output from the <code>nagc_example_mkl<\/code> script is<\/p>\n<pre>\r\nCopying a00aace.c to current directory\r\ncp \/opt\/apps\/libs\/intel\/nag\/cll6i23dcl\/examples\/source\/a00aace.c .\r\n\r\nCompiling and linking a00aace.c to produce executable a00aace.exe\r\nicc a00aace.c -I\/opt\/apps\/libs\/intel\/nag\/cll6i23dcl\/include -m64 \\\r\n    \/opt\/apps\/libs\/intel\/nag\/cll6i23dcl\/lib\/libnagc_mkl.a -Wl,--start-group \\\r\n    \/opt\/apps\/libs\/intel\/nag\/cll6i23dcl\/mkl_intel64\/libmkl_intel_ilp64.a \\\r\n    \/opt\/apps\/libs\/intel\/nag\/cll6i23dcl\/mkl_intel64\/libmkl_intel_thread.a \\\r\n    \/opt\/apps\/libs\/intel\/nag\/cll6i23dcl\/mkl_intel64\/libmkl_core.a -Wl,--end-group\r\n    -openmp -lpthread -lm -o  a00aace.exe\r\n\r\nRunning a00aace.exe\r\n.\/a00aace.exe > a00aace.r\r\n<\/pre>\n<p>Among other things, the above shows you the form of the icc command that NAG recommend for this usage case. The output from running the example will be contained in the file <code>a00aace.r<\/code>.<\/p>\n<h2>Further Information<\/h2>\n<ul>\n<li><a href=\"http:\/\/www.nag.co.uk\/numeric\/FL\/nagdoc_fl23\/html\/FRONTMATTER\/manconts.html\">Mark 23 FORTRAN Library Manual<\/a> &#8211; includes details of all routines<\/li>\n<li><a href=\"https:\/\/www.nag.co.uk\/doc\/inun\/cl23\/l6idcl\/un.html\">Mark 23 C library User Notes<\/a> &#8211; includes compilation commands<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Overview This is mark 23 of the NAG Library. The following versions are available (see modulefiles below): CLL6I23DCL &#8211; C library for Intel compiler &#8211; serial version FLL6I23DCL &#8211; FORTRAN library for Intel compiler &#8211; serial version FSL6I23DCL &#8211; FORTRAN library for Intel compiler &#8211; parallel SMP version Note that only the static versions of the NAG libraries may be used in this version. The compilation method that links against the NAG shared libraries is.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/libraries\/naglibraries\/__trashed\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":854,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-891","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=891"}],"version-history":[{"count":6,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/891\/revisions"}],"predecessor-version":[{"id":899,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/891\/revisions\/899"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/854"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}