Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
abstract:caviness:app_dev:prog_env [2018-10-18 11:00] – [Compiling code] anita | abstract:caviness:app_dev:prog_env [2020-03-18 17:48] – [Compiling code] anita | ||
---|---|---|---|
Line 20: | Line 20: | ||
===== Compiling code ===== | ===== Compiling code ===== | ||
<note important> | <note important> | ||
- | Fortran, C, C++, Java and Matlab programs should be compiled on the login node. **//All resulting executables should only be run on the compute nodes.//** | + | Fortran, C, C++, Java and Matlab programs should be compiled on the login node, however if lengthy compiles are required or you want to schedule a job for compilation, |
</ | </ | ||
Line 128: | Line 128: | ||
<code bash> | <code bash> | ||
- | vpkg_reguire | + | vpkg_require |
mpif90 -fpic fdriver.f90 -o driver | mpif90 -fpic fdriver.f90 -o driver | ||
</ | </ | ||
Line 134: | Line 134: | ||
== C example: == | == C example: == | ||
<code bash> | <code bash> | ||
- | vpkg_reguire | + | vpkg_require |
mpicc -fpic cdriver.c -o driver | mpicc -fpic cdriver.c -o driver | ||
</ | </ | ||
Line 181: | Line 181: | ||
Joint use of VALET and these environment variables will also prepare your UNIX environment to support your use of **make** for program development. VALET will accommodate using one or several libraries, and you can extend its functionality for software you develop or install. | Joint use of VALET and these environment variables will also prepare your UNIX environment to support your use of **make** for program development. VALET will accommodate using one or several libraries, and you can extend its functionality for software you develop or install. | ||
+ | |||
+ | ==== Intel compiler suite ==== | ||
+ | |||
+ | You should use Intel MKL — it's a highly-optimized BLAS/LAPACK library. | ||
+ | |||
+ | If you use the Intel compilers, you can add '' | ||
+ | |||
+ | <code bash> | ||
+ | ifort -o program -mkl=sequential [...] | ||
+ | |||
+ | ifort -o program -qopenmp -mkl=parallel [...] | ||
+ | </ | ||
+ | |||
+ | The former uses the serial library, the latter uses the threaded library that respects the OpenMP runtime environment of the job for multithreaded BLAS/LAPACK execution. | ||
+ | |||
+ | If you're not using the Intel compilers, you'll need to generate the appropriate compiler directives using [[https:// | ||
+ | |||
+ | Please use " | ||
+ | |||
+ | You'll need to load a version of Intel into the environment before compiling/ | ||
+ | |||
+ | <code bash> | ||
+ | vpkg_require intel/2019 | ||
+ | </ | ||
+ | |||
+ | Among other things, this will set '' | ||
+ | |||
+ | To determine the available versions of Intel installed use | ||
+ | |||
+ | < | ||
+ | $ vpkg_versions intel | ||
+ | </ | ||
+ | |||
+ | ==== PGI compiler suite ==== | ||
=== Fortran examples illustrated with the PGI compiler suite === | === Fortran examples illustrated with the PGI compiler suite === |