Skip to content

Addition of FPM Support#176

Open
robin-dahl wants to merge 6 commits into
ddsolvation:mainfrom
robin-dahl:fpm
Open

Addition of FPM Support#176
robin-dahl wants to merge 6 commits into
ddsolvation:mainfrom
robin-dahl:fpm

Conversation

@robin-dahl
Copy link
Copy Markdown
Contributor

Summary
This PR adds support for building ddX with the Fortran Package Manager. It includes changes required to build & compile the project with FPM, run the standalone executable, and use the test suite. The documentation has also been updated with instructions for using FPM with ddX.

Key Changes
Adding FPM support typically requires only limited changes, provided that the repository structure is broadly compatible with FPM's conventions.

  • This PR adds the standard fpm.toml manifest file, which enables compilation of the source code via fpm build. To avoid compilation issues, #ifdef BUILD_PYBIND11 and #endif guards were added to non-Fortran source files in the src directory. Without these guards, FPM attempts to compile the C++ and Python-related files as part of the build, which leads to errors. These preprocessor guards, however, should not affect the behavior of these files in any other build configuration.
  • The standalone executable can be run with fpm run [path/to/input].txt (for instance, fpm run tests/Input-example.txt). As usual for FPM, this command also compiles the project prior to execution, so an explicit fpm build step is optional.
  • Normally, the test suite would be run with fpm test. For ddX, however, this is currently not possible because several tests require individual command-line arguments. While FPM allows arguments to be passed to specific target tests, for example fpm test --target ddlpb_esolv -- tests/data/ddlpb_force.txt, a general fpm test command would only work for test suites with a uniform execution structure. To address this, this PR adds a Python wrapper in the tests directory. The wrapper runs all unit and standalone tests, analyzes the output, and provides a summary. The full test suite can therefore be run in one go with python tests/fpm_tester.py.

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