Code Monkey home page Code Monkey logo

Comments (14)

ivan-pi avatar ivan-pi commented on May 8, 2024 1

Thanks @LKedward for pointing me to the previous discussion. It seems that this issue is then a duplicate. @everythingfunctional and @certik, should I close this issue and comment in #91 instead?

This is a good point and should probably be added to the README.

I will create a pull request in the next day or two.

from fpm.

ivan-pi avatar ivan-pi commented on May 8, 2024

Here is the project I am trying to convert to be fpm-usable: https://github.com/ivan-pi/fortran_lsp/tree/fpm

from fpm.

LKedward avatar LKedward commented on May 8, 2024

Hi @ivan-pi, regarding multiple drivers I believe the current fpm behaviour allows only one executable source file per folder, where any other Fortran files in that same folder are assumed to be modules; this is undocumented I think because the behaviour is still under discussion, see #91 - the suggestion there by @certik seems promising.

A remaining point might be that after doing stack install in the fpm folder, the ${HOME}/.local/bin/ folder might not be on the path already, requiring an extra command export PATH="$PATH:$HOME/.local/bin/".

This is a good point and should probably be added to the README.

from fpm.

everythingfunctional avatar everythingfunctional commented on May 8, 2024

Hi @ivan-pi , thanks for trying out fpm with your project. You can have more than one executable per project, but as @LKedward pointed out you must have them in separate folders. Not that the entry in the toml file starts as [[executable]] instead of [[driver]], or it seemed like you considered these to be test programs, so you may want to specify them with [[test]].

As for the compiler flags, we haven't really gotten a good handle on how to deal with those. The problem mostly comes from what to do with them in terms of dependencies. Does a project's dependencies get compiled with the flags it specified? What about projects that depend on it? What about if you switch compilers? It's on our radar, it's just a really hard problem that we haven't tackled yet.

You can close this issue if you feel the other adequately covers it. Also, feel free to open up other issues if you want make sure we keep track of anything else you asked here.

from fpm.

certik avatar certik commented on May 8, 2024

I believe Cargo supports to have multiple main programs in the bin directory. I think we agreed to use an app directory instead of bin. Is there a reason why fpm cannot compile those automatically?

It is intuitive and natural. I would expect it to work also.

from fpm.

everythingfunctional avatar everythingfunctional commented on May 8, 2024

It's not that we can't support it, it just makes things more complicated than "everything else in this folder is a module that should be compiled and linked in".

We (sort of) support having multiple programs in the app directory, they just have to be in separate sub-folders and have explicit entries in fpm.toml.

from fpm.

certik avatar certik commented on May 8, 2024

Yes, it's a little more complicated, but it makes life so much easier for the end user. That is the whole point of fpm. :)

from fpm.

everythingfunctional avatar everythingfunctional commented on May 8, 2024

Yeah, that's probably true.

from fpm.

milancurcic avatar milancurcic commented on May 8, 2024

fpm init could generate the appropriate [[executable]] sections for the user. Just throwing an idea out there, not something that I think is a priority.

from fpm.

certik avatar certik commented on May 8, 2024

Cargo does not require any modifications to Cargo.toml to have executables. We should not either. So fpm init just produces the default initial fpm.toml, and users don't need to touch it, they just create the app dir and put programs in it.

from fpm.

milancurcic avatar milancurcic commented on May 8, 2024

Yes, the sane default of multiple programs in app/ is what we should aim for.

My comment about fpm init was specific to the scenario of multiple programs in custom (non-default) location, which needs to be specified in the toml file, just like Cargo does.

I actually didn't know (or forgot) that we supported multiple executables by specifying them in fpm.toml, so I was happy to read about it in this thread.

from fpm.

lauvergn avatar lauvergn commented on May 8, 2024

Yes, it's a little more complicated, but it makes life so much easier for the end user. That is the whole point of fpm. :)

Yes, that will great !!

alias gardhor

from fpm.

ivan-pi avatar ivan-pi commented on May 8, 2024

Is this issue still relevant?

I recall @LKedward mentioning somewhere that my fortran_lsp repo could be built fpm, meaning that this has been resolved.

from fpm.

LKedward avatar LKedward commented on May 8, 2024

Hi @ivan-pi, yes I believe this issue is now solved.

from fpm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.