Skip to content

Re-structuring and upgrades to CMake infrastructure

Re-structuring and upgrades to CMake infrastructure

  • Bumped minimal version to 3.20 which allows one to DEFER calls (post-pone a call until the end of the add_subdirectory step). (3.19 for DEFER, 3.20 for fixing #318 (closed))

  • Added:

    SIESTA_TESTS SIESTA_SHARED_LIBS SIESTA_INSTALL

    mainly for future-proofing the codebase when being inherited in a project.

  • Added some more print-build-options at the end of the configure step. The shown options are mainly those that affect only siesta. I.e. units-convention, suffix names etc. It gives a better overview.

  • Added the CMAKE_MESSAGE_CONTEXT which can be quite handy.

  • Changed lots of explicit function names in debug messages to use CMAKE_CURRENT_FUNCTION (does not work in macro's for obvious reasons).

  • Enabled the flags:

    SIESTA_LINKER_FLAGS_PRE SIESTA_LINKER_FLAGS_POST SIESTA_LINKER_FLAGS

    initially for the siesta and libsiesta targets (more will be added in a later commit).

    The scheme works by creating a wrapper for add_executable|library, which defines the target with all its arguments, and then immediately calls

    target_link_libraries( ${SIESTA_LINKER_FLAGS_PRE})

    It then installs a deferred call when the directory is done parsing which calls:

    target_link_libraries( ${SIESTA_LINKER_FLAGS_POST|})

    (We might also consider doing the deferred call only when the PROJECT_SOURCE_DIR is done.)

    Basically this wraps all of this:

    add_executable(target ...) target_link_libraries(target SIESTA_LINKER_FLAG_PRE) < add more link libraries > target_link_libraries(target SIESTA_LINKER_FLAG_POST)

    into:

    siesta_add_executable(target ...) < add more link libraries >

    It is not completely clear that this is the best way to do things. An alternative could be to create other functions which install the PRE and POST flags, but that would require two more function calls at determined positions.

  • Beautified the printbuildinfo scripts.

    When using different modes in the MESSAGE one needs to worry about the -- prefix for STATUS and above (i.e. NOTICE won't have these). For better formatting now everything is STATUS. (Once 3.25 is in, one can bypass the mode flag and use a custom msg function which prints with NOTICE mode but only for DEBUG.) Also reduced the spacing a bit, and just generally made it look prettier.

  • The test-suite now used input flags with new names:

    SIESTA_TESTS_MPI_MIN|MAX_NUMPROCS (follows MPI naming convention) SIESTA_TESTS_MPI_NUMPROCS (actual used number of MPI ranks, defaults to 4) SIESTA_TESTS_VERIFY

  • A function siesta_test_get_mpi has been added, but it is currently not used, pending some feedback.

  • The test functions have been shortened to a great extent.

  • The IS_SIMPLE option has been removed since it got superseeded by the LABELS (see internal #344).

  • Changed the test names to be a bit shorter, and also changed the amount of printed information. Much of it can be regarded as debug information.

  • The SUFFIX handling in Siesta has now a reduced output scope, with reduced verbosity.

(cherry-picked (+fix conflicts) (+updated commit message) from commit f9158b2e)

Details

Please detail what this MR introduces

  • Describe in details what this MR does? (link to the issue by writing # here)
  • Does this MR change the behaviour of any fdf-flags? If so, ensure this is documented in the manual
  • If new fdf-flags are added, please add thorough descriptions to the manual
  • add a summary sentence in the ReleaseNotes.md file
  • if this breaks compatibility, add mentions to the Docs/compatibility.tex

Why is it needed

Authors

Co-authored-by: Nick R. Papior nickpapior@gmail.com

Merge request reports