Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling error with FFTW installed via Homebrew #1025

Open
mtrocadomoreira opened this issue Oct 11, 2023 · 0 comments
Open

Compiling error with FFTW installed via Homebrew #1025

mtrocadomoreira opened this issue Oct 11, 2023 · 0 comments

Comments

@mtrocadomoreira
Copy link

Hello!

I'm building HiPACE++ on a Mac desktop, and I got an error from cmake saying it couldn't find the fftw3 package. I found a solution, which is described below. I initially installed all the packages with Homebrew, and my interpretation is that fftw is not installed/linked properly using Homebrew, so I compiled the package manually for different precisions (not sure if that's necessary, but it worked anyway).

Not sure whether this counts as an issue, but I just wanted to share the solution I found in case someone has the same problem. Maybe a note about this could be included in the Homebrew section of the installation guide?

Details

  • default build options

  • Intel processor with integrated GPU unit

  • FFTW version on Homebrew: 3.3.10

  • Homebrew version: 4.1.15

  • MacOS version: Ventura 13.5.2

  • error after running cmake -S . -B build:

    ...
    -- Checking for module 'fftw3'
    --   No package 'fftw3' found
    CMake Error at /usr/local/Cellar/cmake/3.27.7/share/cmake/Modules/FindPkgConfig.cmake:607 (message):
      A required package was not found
    Call Stack (most recent call first):
      /usr/local/Cellar/cmake/3.27.7/share/cmake/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)
      cmake/dependencies/FFT.cmake:92 (pkg_check_modules)
      CMakeLists.txt:114 (include)
    ...
    

Solution

Adapted from this solution to a similar issue.

  1. In Terminal, go to directory where FFTW package should be installed.
  2. Run the following commands:
    (note that I had to use sudo for the make and rm commands, but this might be unnecessary in your case)
    FFTW_VERSION=3.3.10
    curl -L http://www.fftw.org/fftw-$FFTW_VERSION.tar.gz | tar xz
    mkdir fftw-$FFTW_VERSION/build && cd $_
    cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_OPENMP=ON -DENABLE_THREADS=ON -DENABLE_LONG_DOUBLE=ON ../../fftw-${FFTW_VERSION}
    sudo make -j $(nproc) install
    sudo rm -r *
    cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_OPENMP=ON -DENABLE_THREADS=ON -DENABLE_FLOAT=ON -DENABLE_SSE=ON -DENABLE_SSE2=ON -DENABLE_AVX=ON -DENABLE_AVX2=ON ../../fftw-${FFTW_VERSION}
    sudo make -j $(nproc) install
    sudo rm -r *
    cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_OPENMP=ON -DENABLE_THREADS=ON -DENABLE_SSE=ON -DENABLE_SSE2=ON -DENABLE_AVX=ON -DENABLE_AVX2=ON ../../fftw-${FFTW_VERSION}
    sudo make -j $(nproc) install
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant