Skip to content

Some -D options of cmake seem to take little (if not no) effects on the building process of ABACUS #6618

@ZhouXY-PKU

Description

@ZhouXY-PKU

Describe the Code Quality Issue

(This ISSUE is related to PR #6615)

cereal

-D CEREAL_INCLUDE_DIR in build_abacus_intel.sh is wrong, (should be "include", but not "include/cereal"), but it can still work, and shows "Found cereal in include/cereal", but failed later in the building process with "<cereal/cereal.h> not found" if CPATH is set improperly. So it seems that the option did not take effect.

libxc

when there are more than one libxc in the system and ONLY module load one, toolchain can found the right one, but cmake CANNOT, and -D Libxc_DIR did not take effect.

==========================================

CMP0144

When building with cmake-3.31.7, sometimes there are warnings like below:

CMake Warning (dev) at CMakeLists.txt:634 (find_package):
  Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
  variables.  Run "cmake --help-policy CMP0144" for policy details.  Use the cmake_policy command to set the policy and suppress this warning.

  Environment variable LIBXC_ROOT is set to:

    right\path\to/libxc/libxc-7.0.0

  For compatibility, find_package is ignoring the variable, but code in a .cmake module might still use it.
This warning is for project developers.  Use -Wno-dev to suppress it.

And then, the right path set by -D is ABORTED by cmake.

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Identify the specific code file or section with the code quality issue.
  • Investigate the issue and determine the root cause.
  • Research best practices and potential solutions for the identified issue.
  • Refactor the code to improve code quality, following the suggested solution.
  • Ensure the refactored code adheres to the project's coding standards.
  • Test the refactored code to ensure it functions as expected.
  • Update any relevant documentation, if necessary.
  • Submit a pull request with the refactored code and a description of the changes made.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions