Integration by Linking to the Library at Compile Time - 5.2 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2025-12-29
Version
5.2 English

You can link AOCL-FFTZ directly to your application at compile time by using AOCL-FFTZ pre-built or you can build and link FFTW-WRAPPERS along with AOCL-FFTZ for this scenario.

Follow these steps to integrate AOCL-FFTZ into your application:

  1. Modify the application’s build system to link against libfftw3xc_wrapper_fftz and libaocl_fftz instead of libfftw3 and libfftw3_omp.

  2. Build the application.

  3. If the library is linked via dynamic linking, before running the application, ensure that it is pointing to the correct FFTW-WRAPPER and AOCL-FFTZ library. If not, use these steps to ensure right dependency:

    1. On Linux:

      export LD_LIBRARY_PATH="<path to fftw-wrapper lib>":"<path to aocl-fftz lib>":$LD_LIBRARY_PATH
      
    2. On Windows:

      set PATH="<path to fftw-wrapper lib>";"<path to aocl-fftz lib>";%PATH%
      
  4. Run the application.

Example: Integration with VASP

VASP links FFTW by default. It can be configured and built to use FFTW-WRAPPER and AOCL-FFTZ as well. Steps to integrate AOCL-FFTZ with VASP at compile time and launch it on Linux:

Modify Makefile.include from:

AMDFFTW_ROOT  ?= /path/to/your/amdfftw/installation
LLIBS      += -L$(AMDFFTW_ROOT)/lib -lfftw3
INCS       += -I$(AMDFFTW_ROOT)/include

To:

AOCL_FFTZ_ROOT  ?= /path/to/your/aocl_fftz/installation
LLIBS      += -L$(AOCL_FFTZ_ROOT)/lib -lfftw3xc_wrapper_fftz -laocl_fftz
INCS       += -I$(AOCL_FFTZ_ROOT)/include

Then, build and run VASP by:

# Configure and build VASP
cd vasp.6.4.3 # Include the modified Makefile.include
make DEPS=1 -jN <target>

# Load FFTW-WRAPPER and AOCL-FFTZ library and run VASP
export LD_LIBRARY_PATH="<path to fftw-wrapper lib>":"<path to aocl-fftz lib>":$LD_LIBRARY_PATH