Comments (10)
Right now, if you want multiple executables you have to specify them manually. I'm open to enabling some auto-detection of multiple executables. I'll put together an outline of what that would look like.
from fpm.
from fpm.
I actually much prefer app
to src/bin
. In my mind a bin
directory is for binary files only, not source code.
from fpm.
from fpm.
The app
, src
separation makes it much easier to determine what should be packaged up into the library, and what is just for use in executable(s). I also makes finding the executable(s) a bit simpler for the automatically detected case. If we switch to the src/bin
approach I'll need to special case out of searching that directory when building the library.
from fpm.
I see, good point. Are we still doing src/main.f90
to mean an executable? If so, then you have to special case this anyway.
from fpm.
I think we should aim to minimize special cases in the UI, and implement accordingly. A good test for this is asking what design leads to the simplest user guide.
For example, if everything in src
is considered a library component except src/main.f90
and src/bin/*.f90
, then these are special cases that require additional clauses in the documentation.
On the other hand, app
for programs and src
for library is simplest to explain to a user, and is currently my favorite solution.
An even simpler UI than this (to explain to a user) is to have program files be programs, and module files be modules, regardless of where they are in the tree. However this complicates implementation because now fpm needs to parse the sources. A downside is that now there may not be clear separation between programs and module files if the user is just looking at the source tree. However if you have app
and src
, it's clear.
We should study Rust+Cargo model in detail, but we shouldn't assume that it's the optimal solution for us. This could be because of Rust's own history of the project, or because Rust and Fortran are different languages and have different cultures.
I agree with @LKedward about app
vs bin
.
from fpm.
Good points. Note that fpm
has to parse the sources anyway to determine module dependencies and to enforce that each module name is named appropriately.
So looks like the most natural solution so far is:
src
contains module files (or loose procedures / function --- we should not encourage it, but some existing projects do that and I think we can incorporate this without harm). Everything insrc
gets built into a library.app
, contains programs. Perhapsapp/main.f90
could be the main program (by default executed byfpm run
).tests
contains testsbench
contains benchmarks (we can do this one later perhaps --- although most of my projects contain some kind of benchmarks which are distinct from apps and distinct from tests)
from fpm.
I see, good point. Are we still doing
src/main.f90
to mean an executable? If so, then you have to special case this anyway.
No, I didn't implement src/main.f90
to be an executable. If it sees that it will expect it to be a module named main
.
from fpm.
Closing as this is now implemented.
from fpm.
Related Issues (20)
- `-ffree-line-length-none` should be used by default in tests HOT 1
- Dependency level macro definitions continuously trigger dependency state changes
- Issue with running multiple examples in fpm version 0.10.1 HOT 2
- Issue with running multiple examples in fpm version 0.10.1 HOT 2
- Memory profiling reveals multiple "Conditional jump or move depends on uninitialised value(s)" errors HOT 2
- Release candidate fpm.F90 uses gfortran-specific backslash line continuations HOT 1
- CI for Metapackages broken for Macos openmpi and mpich
- build issue with ambiguous generic `OPERATOR(==)` interface HOT 1
- [build] Nonportable usage in fpm-0.10.1.F90 HOT 2
- App is not installed if source is not main.f90 HOT 1
- MPI-code can not be built with Intel compiler when using standard flags HOT 6
- target option being ignored
- Preprocess macros not work when building via `fpm build` or `fpm run` HOT 1
- fpm test with --runner HOT 8
- bug(ci): uploaded artefacts not pinned to specific GCC version HOT 2
- Implicit interface not working with lfortran HOT 2
- Linker flags are not parsed correctly by the command-line interface HOT 4
- Does fpm support lfrotran HOT 3
- Retain dynamically generated reponse file for ar command during build
- Install script always picks the latest release HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fpm.