Skip to content

CMake: Introduce CMake dependent options and print build summary#7626

Draft
Growl1234 wants to merge 4 commits into
deepmodeling:developfrom
Growl1234:cmake
Draft

CMake: Introduce CMake dependent options and print build summary#7626
Growl1234 wants to merge 4 commits into
deepmodeling:developfrom
Growl1234:cmake

Conversation

@Growl1234

Copy link
Copy Markdown

This PR introduces cmake_dependent_option with intention to make the dependency handling logic clearer from the beginning of CMake logic.

Example:

cmake_dependent_option(EXX_DEV "Enable LibRI developing features" OFF "ENABLE_LIBRI" OFF)

This means EXX_DEV is available only when ENABLE_LIBRI is set to ON, and defaults to OFF; if ENABLE_LIBRI=OFF, the EXX_DEV option will be forced to be off. So if one passes -DENABLE_LIBRI=OFF -DEXX_DEV=ON to CMake (by mistake?), the actual resulting logic will be -DENABLE_LIBRI=OFF -DEXX_DEV=OFF.

cmake_dependent_option(ENABLE_ELPA "Enable ELPA for LCAO" ON "ENABLE_LCAO;ENABLE_MPI" OFF)

This means ENABLE_ELPA is available only when both ENABLE_LCAO and ENABLE_MPI are set to ON.

@Growl1234

Growl1234 commented Jul 13, 2026

Copy link
Copy Markdown
Author

There is one RFC about how we should detect and show the version of MPI, as existing version detection logic seems invalid.

I currently choose to show the real MPI-standard what an MPI implementation follows, as this is generally available for any MPI implementations through a single ${MPI_CXX_VERSION}. For example:

  • MPICH 5.0.1 follows MPI-5.0 standard (therefore MPICH (MPI standard: 5.0))
  • OpenMPI 5.0.10 follows MPI-3.1 standard (therefore OpenMPI (MPI standard: 3.1))
  • Intel MPI 2021.18 follows MPI-4.1 standard (therefore Intel MPI (MPI standard: 4.1))

However, one concern is that users might not be used to it, so might there be other easier way?

@Growl1234 Growl1234 changed the title CMake: Introduce CMake dependent options CMake: Introduce CMake dependent options and print build summary Jul 13, 2026
- Output crucial information as a build summary
- Make MPI implementation detection valid (at least for non-cross build)
- Use version of MPI standard one MPI implementation follows [RFC]
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.

1 participant