This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

Building and installing hipFFT

Building and installing hipFFT#

This topic explains how to install hipFFT from the prebuilt packages or build it from the source code. hipFTT requires a ROCm-enabled platform. For more information, see the Linux system requirements.

Installing prebuilt packages#

For information on downloading and installing ROCm, see the ROCm installation guide.

To install hipFFT, use the package manager for the Linux distribution, which handles all dependencies. This lets you run programs that use hipFFT, but not compile them.

On the Ubuntu distribution, run the following command:

sudo apt update && sudo apt install hipfft

Note

To compile programs, you must install the development package, which contains the header files and CMake infrastructure. This package is named hipfft-dev on Ubuntu/Debian systems and hipfft-devel on RHEL and related variants.

Building hipFFT from source#

To build hipFFT from source, follow these steps:

  1. Install the library build dependencies:

    • On AMD platforms, install rocFFT. To build from source, rocFFT must be installed with the development headers. These headers can be added by installing the rocfft-dev or rocfft-devel package. If rocFFT was built from source, then these headers are already included.

    • On NVIDIA platforms, install CUDA cuFFT. cuFFT must be installed with the development headers. For more information, see CUDA cuFFT.

  2. Install the client build dependencies for the clients:

    The clients that are included with the hipFFT source code, including samples and tests, depend on hipRAND, FFTW, and GoogleTest.

  3. Build hipFFT:

    To show all build options, run these commands:

    mkdir build && cd build
    cmake -LH ..
    

    Here are some CMake build examples:

    • For AMD GPUs

      • Building a project using HIP language APIs and hipFFT with the standard host compiler:

        cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -L ..
        
      • Building a project using HIP language APIs, hipFFT, and device kernels with HIP-Clang:

        cmake -DCMAKE_CXX_COMPILER=amdclang++ -DCMAKE_BUILD_TYPE=Release -DBUILD_CLIENTS=ON -L ..
        
    • For NVIDIA GPUs

      • Building a project using HIP language APIs and hipFFT with the standard host compiler:

        cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_LIB=CUDA -L ..
        
      • Building a project using HIP language APIs, hipFFT, and device kernels with HIP-NVCC:

        HIP_PLATFORM=nvidia cmake -DCMAKE_CXX_COMPILER=hipcc -DCMAKE_BUILD_TYPE=Release -DBUILD_CLIENTS=ON -L ..
        

    Note

    The -DBUILD_CLIENTS=ON option is only allowed with the amdclang++ or HIPCC compilers.