Skip to content

Automatically check linking of the interface #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MakisH opened this issue Feb 6, 2024 · 2 comments · May be fixed by #25
Open

Automatically check linking of the interface #15

MakisH opened this issue Feb 6, 2024 · 2 comments · May be fixed by #25

Comments

@MakisH
Copy link
Member

MakisH commented Feb 6, 2024

Originally discussed in #14 (comment)

I guess we need kind of an "extended solver dummy" that only calls all functions to make sure that they are all correct and link to preCICE.

Or somehow check the linking during compilation of the module.

@uekerman also raised the point that:

The mocked interface (workpackage of preECO) should ultimately be a solution for this problem. Then, such a extended solverdummy can run alone and also test the API, i.e. it becomes a normal test "main".

Note that the problem here is not that we cannot call preCICE. It is that the building procedure of the interface does not try to link to preCICE. In that sense, just building a Fortran code that includes calls to everything (but never runs) would already help.

@MakisH MakisH mentioned this issue Feb 6, 2024
4 tasks
@MakisH
Copy link
Member Author

MakisH commented Feb 8, 2024

I am currently discussing with @ivan-pi, and some idea seems to be to use gfortran with -fc-prototypes and -fsyntax-only. This would generate the corresponding C declaration. This file should be able to replace preciceFortran.hpp and when building the preciceFortran.cpp, it should complain if we have any inconsistencies.

Having this in the CI would be quite useful.

@ivan-pi
Copy link
Collaborator

ivan-pi commented Feb 8, 2024

You can find more information here: https://fortran-lang.discourse.group/t/compilers-supporting-generation-of-c-function-prototypes/2688

Note this could also work with external functions if you want to test those too.

@MakisH MakisH linked a pull request Mar 19, 2024 that will close this issue
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 a pull request may close this issue.

2 participants