Skip to content

Add FindKML.cmake and resolve FFTW3 issue#7576

Open
Growl1234 wants to merge 1 commit into
deepmodeling:developfrom
Growl1234:cmake
Open

Add FindKML.cmake and resolve FFTW3 issue#7576
Growl1234 wants to merge 1 commit into
deepmodeling:developfrom
Growl1234:cmake

Conversation

@Growl1234

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings July 1, 2026 08:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR adds first-class CMake support for Huawei Kunpeng Math Library (KML) via a custom FindKML.cmake, and refactors dependency linking to address FFTW3-related configuration issues.

Changes:

  • Introduce cmake/FindKML.cmake providing imported targets for KML BLAS/LAPACK/ScaLAPACK and FFTW3-compatible interfaces.
  • Update CMakeLists.txt to use find_package(KML ...) when USE_KML is enabled and to restructure FFTW3 linking.
  • Adjust FFTW toolchain environment exports in install_fftw.sh (removing CPATH and CP_* flag exports).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
toolchain/scripts/stage3/install_fftw.sh Removes CPATH/CP_* environment exports for FFTW, affecting how downstream builds pick up FFTW headers/flags.
cmake/FindKML.cmake Adds a new find-module that detects KML variants/components and defines imported targets.
CMakeLists.txt Switches KML integration to find_package(KML ...) and refactors dependency linking (MPI/MKL/FFTW3).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmake/FindKML.cmake
Comment thread cmake/FindKML.cmake
Comment thread cmake/FindKML.cmake
Comment thread cmake/FindKML.cmake
Comment thread cmake/FindKML.cmake
Comment thread cmake/FindKML.cmake
Comment thread toolchain/scripts/stage3/install_fftw.sh
Comment thread toolchain/scripts/stage3/install_fftw.sh
@Growl1234

Copy link
Copy Markdown
Author

@QuantumMisaka Please have a look if a bare build with FFTW support passes your test.

Comment thread cmake/FindKML.cmake
find_library(KML_BLAS_LIBRARY
NAMES kblas
HINTS "${_kml_prefix}"
PATH_SUFFIXES "lib/${KML_ARCH}/kblas/${_kml_blas_threading}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kblas of sve512 is actually in sme/

Comment thread cmake/FindKML.cmake

include(FindPackageHandleStandardArgs)

set(KML_ROOT "" CACHE PATH "KML installation prefix")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two sets of kml-tools: bisheng-based and gcc-based, which can be automatically chosen by compiler (CLANG or GCC)?

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

Successfully merging this pull request may close these issues.

3 participants