Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
/
Linking the MKL version of fftw3

Linking the MKL version of fftw3

Juli 26, 2020

Links and further reading

  • INTELs developers and linking guide
  • Interface specification
  • INTEL link advisor

Environment variables

To link a library, the compiler and linker need at minimum

name of and path to the include files

For fftw3, the include files have standard names, but are in a different place than the other MKL-related include files.

name of and path to the library:

The fftw3 library is merged the other MKL libraries. Hence, searching for the typical fftw3 - filenames gives a negative result. This may be of importance for cmake - or configure -scripts trying to explore the system to generate the appropriate compiler- und linker options.

The intel modules define an environment variable MKLROOT that can be used to simplify the handling of path names.

module load intel

MKLPATH=$MKLROOT/lib/intel64_lin

MKLINCLUDE=$MKLROOT/include

MKLFFTWINCLUDE=$MKLROOT/include/fftw

Compiling and dynamic linking

The following should link a FORTRAN program myprog.f calling fftw3 - routines:

ifort myprog.f -I$MKLINCLUDE -I$MKLFFTWINCLUDE -L$MKLPATH -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm

For a configure script one has to explore its environment variables to fetch compiler and linker flags to the configuration process. This may be for example:

module load intel

export CFLAGS=" -fPIC -O3 -I$MKLINCLUDE -I$MKLFFTWINCLUDE -Wl,-rpath=$LD_RUN_PATH"

export LIBS="-L$MKLROOT/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm"

Note,

-Wl,-rpath=$LD_RUN_PATH

ensures that the path to the MKL is stored in the binary. This ensures that no compiler module is needed during runtime and the originally specified library version is used.

Compiling and static linking

To be described ...

Known issues

The linking with OpenMP* threadedIntel® oneAPI Math Kernel Library failed for the nfft - tools.



, multiple selections available, Use left or right arrow keys to navigate selected items
mkl
fftw§
kb-how-to-article
User Manual

User Manual
Results will update as you type.
  • Application Guide
  • Status of System
  • Usage Guide
  • Compute partitions
    • CPU CLX partition
      • Workflow CPU CLX
      • Slurm partition CPU CLX
      • Examples and Recipes
        • Compilation on CPU CLX
        • OpenMPI on CPU CLX
        • Intel MPI on CPU CLX
        • OpenMP on CPU CLX
        • Hybrid Jobs
        • Linking the MKL version of fftw3
        • Multiple programs multiple data
      • Fat Tree OPA network of CLX partition
      • Operating system migration from CentOS to Rocky Linux
    • CPU Genoa partition
    • GPU A100 partition
    • GPU PVC partition
    • Next-Gen Technology Pool
  • Software
  • FAQ
  • NHR Community
  • Contact

    You‘re viewing this with anonymous access, so some content might be blocked.
    {"serverDuration": 10, "requestCorrelationId": "178e0061722445089a3739fb46be58b4"}