Developer Guide

  • 2021.1
  • 12/04/2020
  • Public Content
Contents

Examples for Linking a Fortran Application

These examples illustrate linking of an application under the following conditions:
  • Main module is in Fortran.
  • You are using the Intel® Fortran Compiler.
  • You are using the
    Intel MPI
    library.
  • Intel® oneAPI Math Kernel Library
    functions use LP64 interfaces.
  • The
    PATH
    environment variable contains a directory with the MPI linker scripts.
  • $MKLPATH
    is a user-defined variable containing
    <mkl_directory>
    /lib
    /intel64
    _lin
    .
To link dynamically with ScaLAPACK for a cluster of systems based on the Intel® 64 architecture, use the following link line:
mpiifort
<user files to link>
                         \
   -L$MKLPATH                                         \
   -lmkl_scalapack_lp64                               \
   -lmkl_blacs_
intelmpi
_lp64                          \
   -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core     \
   -liomp5 -lpthread
To link statically with Cluster FFT for a cluster of systems based on the Intel® 64 architecture, use the following link line:
mpiifort
<user files to link>
                        
\
   -Wl,--start-group                                 
\
   $MKLPATH/libmkl_cdft_core.a                        \
   $MKLPATH/libmkl_blacs_
intelmpi
_lp64.a              \
   $MKLPATH/libmkl_intel_lp64.a                       \
   $MKLPATH/libmkl_intel_thread.a                     \
   $MKLPATH/libmkl_core.a                            
\
   -Wl,--end-group                                   
\
   -liomp5 -lpthread
To link statically with Cluster Sparse Solver for a cluster of systems based on the Intel® 64 architecture, use the following link line:
mpiifort
<user files to link>
                        
\
   -Wl,--start-group                                 
\
   $MKLPATH/libmkl_blacs_
intelmpi
_lp64.a              \
   $MKLPATH/libmkl_intel_lp64.a                       \
   $MKLPATH/libmkl_intel_thread.a                     \
   $MKLPATH/libmkl_core.a                            
\
   -Wl,--end-group                                   
\
   -liomp5 -lpthread

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.