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

Cabana requires host backend for HeFFTe #794

Closed
dineshadepu opened this issue Oct 15, 2024 · 4 comments
Closed

Cabana requires host backend for HeFFTe #794

dineshadepu opened this issue Oct 15, 2024 · 4 comments
Labels
question Further information is requested

Comments

@dineshadepu
Copy link
Contributor

Hi all,

I am currently working with the CabanaPF (phase field) code for battery modeling, which requires the HeFFTe library. I successfully installed HeFFTe, but I am encountering issues when building Cabana with HeFFTe.

During the build process, I am facing the following error

softwares/Cabana/grid/src/Cabana_Grid_FastFourierTransform.hpp:384:1: error: expected unqualified-id before ‘throw’
  384 | throw std::runtime_error( "Must enable at least one heFFTe host backend." );

I am not sure how to fix this thing. Any idea on how to fix this.

Many thanks.

@streeve
Copy link
Member

streeve commented Oct 15, 2024

Can you add the details of how you've configured heffte? The error is pointing out that you may only have cufft enabled, but we require one of fftw or mkl as well

@streeve streeve added the question Further information is requested label Oct 15, 2024
@dalg24
Copy link
Collaborator

dalg24 commented Oct 15, 2024

Is that not something we could diagnose at configuration time?

@streeve
Copy link
Member

streeve commented Oct 15, 2024

Is that not something we could diagnose at configuration time?

You're right, that should be an easy update

@streeve streeve changed the title Error encountered during Cabana installation with HeFFTe integration Cabana requires host backend for HeFFTe Oct 15, 2024
@dineshadepu
Copy link
Contributor Author

Thanks for the inputs @streeve . To resolve the issue, I installed fftw to ensure compatibility with heffte. The key was to install fftw with shared libraries enabled and generate both single and double precision libraries. This required installing fftw twice with specific configuration flags.

Step 1: Install fftw (Double Precision)

First, install fftw with double precision:

cd fftw
./configure --enable-shared --enable-threads --enable-openmp --enable-mpi
make -j 6
sudo make install

Step 2: Install fftw (Single Precision)

Next, install fftw with single precision by adding the --enable-float flag:

cd fftw
./configure --enable-shared --enable-float --enable-threads --enable-openmp --enable-mpi
make -j 6
sudo make install

These steps will install the necessary shared libraries in /usr/local/lib, which heffte can use.

Step 3: Install heffte

Now, proceed with installing heffte:

cd heffte
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=$HEFFTE_INSTALL_DIR -D Heffte_ENABLE_FFTW=ON ../
make
make install

Step 4: Complete Setup for Cabana

Finally, follow the remaining instructions for Cabana, ensuring that heffte is enabled during the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants