Cambridge-ICCS / FTorch

A library for directly calling PyTorch ML models from Fortran.
https://cambridge-iccs.github.io/FTorch/
MIT License
48 stars 11 forks source link

Require ftorch when coupling #134

Open jatkinson1000 opened 3 weeks ago

jatkinson1000 commented 3 weeks ago

Closes #133

It came up in #124 that some linking could pass undetected for the examples as CMake does not currently 'REQUIRE' FTorch.

This PR changes that for the examples (which are then pulled into the tests) and in the online coupling guidance.

jwallwork23 commented 1 week ago

Hm so this implies we need to build the tests separately from FTorch? Doable but means we have two build steps.

Either that or perhaps we can use POST_BUILD. I wonder if this is relevant? https://stackoverflow.com/questions/50913377/cmake-add-custom-command-post-build-depends-option-is-ignored

jatkinson1000 commented 1 week ago

My feelings are that this is not a priority, so can perhaps be put on a backburner for now - I had hoped it would be a 1-line change, but that does not seem the case. 😅

That said, don't let it stop you looking if you are interested!

I'm softening on it being a necessity to build tests as a one-shot with CMake - maybe having a separate "build tests" step wouldn't be an issue as one still has to follow a separate "run tests" step? I still think separating tests from examples (even if they use the same code) is sensible, however.