If your application is already integrated with FFTW or AMD-FFTW, AOCL-FFTZ library can be loaded directly at runtime. You must build and link FFTW-WRAPPERS along with AOCL-FFTZ for this scenario.
Follow these steps to integrate AOCL-FFTZ into your application at Runtime:
On Linux: LD_PRELOAD is an environment variable in Unix-based operating
systems, which allows you to specify one or more shared libraries to be
loaded before any other library. Use LD_PRELOAD as follows when launching
the application:
# Since fftw3xc_wrapper_fftz depends on aocl_fftz, ensure that the dynamic linker can find it
export LD_LIBRARY_PATH="<path to aocl-fftz lib>":$LD_LIBRARY_PATH
# LD_PRELOAD the application with the path to fftw3xc_wrapper_fftz library
LD_PRELOAD="<path to fftw-wrapper lib>" your_application_executable
Example: Integration with VASP
The Vienna Ab initio Simulation Package (VASP) is a computer program for atomic scale materials modelling, e.g. electronic structure calculations and quantum-mechanical molecular dynamics, from first principles. If VASP has been configured to use FFTW or AMD-FFTW, it can be re-directed to load AOCL-FFTZ library at runtime as follows:
# Export aocl_fftz library so that the dynamic linker can find it
export LD_LIBRARY_PATH="<path to aocl-fftz lib>":$LD_LIBRARY_PATH
# Run VASP while pre-loading the path to fftw3xc_wrapper_fftz library
LD_PRELOAD="<path to fftw-wrapper lib>" vasp_std