Skip to content

fpm-compatibility and testing with testdrive#18

Draft
jaosch wants to merge 2 commits intofpenunuri:mainfrom
jaosch:enhancement/fpm
Draft

fpm-compatibility and testing with testdrive#18
jaosch wants to merge 2 commits intofpenunuri:mainfrom
jaosch:enhancement/fpm

Conversation

@jaosch
Copy link
Contributor

@jaosch jaosch commented Sep 8, 2025

Hi,

since there has been a recent issue regarding compatibility of DNAOAD with fpm, see #1, I created this pull request as a proposal.

Using fpm vastly simplifies the layout of the project, which can now be build by simply calling fpm build. Likewise, the examples can be run using fpm run --example ex1.

NOTE: So far I have only tested fpm with the gfortran version of DNAOAD. To also be compatible with ifx, one might want to explore the use of CPP preprocessor commands in the relevant source files. However, I don't have personal experience with that yet and didn't have access to a system with the ifx compiler at the time of writing this.

To make the integration of future updates easier and less error-prone, I also implemented a simple unittest using testdrive for the + operator as a example.

Feel free to take a look at the proposed changes. I don't recommend merging it yet, due to ifx not being tested. Nonetheless, I think that a new project structure similar to this one could facilitate the integration of DNAOAD in user projects.

The project was restuctured to enable the use of fpm as a build system
and dependency manager for DNAOD.

NOTE: The current version has only been tested with gfortran. To enable
parallel compatibility with ifx, the used of cpp for preprocessing could
be explored in the future. CPP support may be enabled within fpm by
adding the following lines to the `fpm.toml` file:

```toml
[preprocess]
[preprocess.cpp]
```
@bhourahine
Copy link
Contributor

There is also another DNAOAD repackaging with real as well as complex data types for all models supported by a given compiler, plus unit testing and github actions for these, based around fypp enhanced code, which unfortunately fpm does not yet cope with directly due to it's lack of preprocessor support. The work around for fpm, as listed here, is to statically generate fpm compliant code.

@jaosch
Copy link
Contributor Author

jaosch commented Sep 8, 2025

Hi, thanks for pointing that out. I will take a look to see if your version already works for me. Regarding the proprecessing, I simply assumed it was possible for fpm given the docs. But, admittedly I have not tried any of that myself.

@fpenunuri
Copy link
Owner

@jaosch
Thanks for your effort in making the repo FPM compatible.
This repository underpins a paper currently under review, so I would prefer not to introduce major modifications here.

As @bhourahine mentioned, a more complete and robust version is being developed. In addition, I already have an almost finished FPM-compatible version that I will publish in a separate repository to avoid affecting the review process of the paper.

I will add you as a collaborator on this FPM-compatible version so we can freely make improvements there.

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