Skip to content
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

fpm #26

Open
Tracked by #8
tkoskela opened this issue Jan 23, 2025 · 2 comments · May be fixed by #25
Open
Tracked by #8

fpm #26

tkoskela opened this issue Jan 23, 2025 · 2 comments · May be fixed by #25

Comments

@tkoskela
Copy link
Contributor

tkoskela commented Jan 23, 2025

  • We created a fpm.toml file in the root of the repository and succesffully built the applications and tests with fpm build
    • gfortran on ubuntu systems requires the -ffree-line-length-none flag, MacOS doesn't
  • We investigated how to pass compiler flags through the toml file.
    • the [project.<compiler>.<os>].flag field does not seem to work
    • @connoraird implemented a work-around in fpm and opened an issue and a PR
    • you can pass compiler flags through and environment variable or on the command line
  • Adding other fpm packages as dependencies is trivial. Adding non-fpm packages as dependencies is difficult
    • You can use metapackages.
    • Metapackages are hard-coded in fpm source code. There are about 5 of them.
  • We wrote a test suite with garden https://github.com/UCL-ARC/fortran-tooling/tree/4-add-garden-tests
@tkoskela tkoskela linked a pull request Jan 23, 2025 that will close this issue
@connoraird
Copy link
Collaborator

connoraird commented Jan 23, 2025

I have created an issue to allow passing flags directly to the compiler.

I have raised a PR to fix the issue here.

@ilectra
Copy link
Contributor

ilectra commented Jan 23, 2025

I tried to write an fpm.toml for pFUnit, in order to pass it as a dependency. It's not clear how/where fpm tells the code how to be built, so I've experimented to see if it would "just" pick up the existing CMakeLists.txt in pFUnit. With a minimal fpm.toml, it's trying to build something and fails miserably, because it needs to pick specific sources to compile - done in cmake but not obvious how to do it in fpm yet. Tried to make it build with cmake using

[library]
source-dir = "src/funit"
build-script = "cd build && cmake .. && make"

but it looks like it fails before even getting to the point of calling the build-script. There's value in pursuing this a bit more, there might be a way...

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.

3 participants