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:
Modify the application’s build system to link against libfftw3xc_wrapper_fftz and libaocl_fftz instead of libfftw3 and libfftw3_omp.
Build the application.
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:
On Linux:
export LD_LIBRARY_PATH="<path to fftw-wrapper lib>":"<path to aocl-fftz lib>":$LD_LIBRARY_PATH
On Windows:
set PATH="<path to fftw-wrapper lib>";"<path to aocl-fftz lib>";%PATH%
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