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

Fix AMReX::FFTW Once #4293

Merged
merged 1 commit into from
Jan 12, 2025
Merged

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Jan 12, 2025

Summary

In situations like superbuilds or other downstream usage, the AMReX::FFTW should only be created once.

Additional background

First seen in conda-forge/impactx-feedstock#42

...
-- Downloading ABLASTR ...
-- ABLASTR repository: https://github.com/ECP-WarpX/WarpX.git (25.01)
-- Searching for pre-installed AMReX ...
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5") found components: CXX
-- Found AMReXFFTW: $PREFIX/lib/libfftw3.so;$PREFIX/lib/libfftw3f.so
-- AMReX: Found version '25.01'
-- HDF5 C compiler wrapper is unable to compile a minimal HDF5 program.
-- Found HDF5: $PREFIX/lib/libhdf5.so
-- Found ADIOS2: $PREFIX/lib/cmake/adios2/adios2-config.cmake (found version "2.10.1") found components: C CXX
-- openPMD-api: Found version '0.16.0'
-- Checking for module 'fftw3'
--   Found fftw3, version 3.3.10
-- Found FFTW: $PREFIX
-- FFTW: Found OpenMP support
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success

WarpX build configuration:
...
-- ABLASTR: Using version '' ()
-- HDF5 C compiler wrapper is unable to compile a minimal HDF5 program.
-- openPMD-api: Found version '0.16.0'
-- Found Python: $PREFIX/bin/python (found suitable version "3.10.16", minimum required is "3.8") found components: Interpreter Development.Module
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Found pybind11: $PREFIX/include (found version "2.13.6")
-- pybind11: Found version '2.13.6'
CMake Error at /home/conda/feedstock_root/build_artifacts/impactx_1736481863454/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/cmake/AMReX/AMReXCMakeModules/FindAMReXFFTW.cmake:48 (add_library):
  add_library cannot create imported target "AMReX::FFTW" because another
  target with the same name already exists.

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

In situations like superbuilds or other downstream usage,
the `AMReX::FFTW` should only be created once.
@ax3l ax3l requested a review from WeiqunZhang January 12, 2025 01:24
ax3l added a commit to ax3l/amrex-feedstock that referenced this pull request Jan 12, 2025
@ax3l ax3l merged commit e761abf into AMReX-Codes:development Jan 12, 2025
75 checks passed
@ax3l ax3l deleted the fix-amrex-fftw-target branch January 12, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants