Comments (7)
You're right. I'm just going to leave out the options to specify compiler flags for now. Until we have time to design it properly.
from fpm.
We will have to iterate on this, I don't know all the details either yet. Here are some guiding principles:
- We should have Debug and Release builds. (I would call it Debug, not Devel.)
- Perhaps also ReleaseCheck (that would enable all optimizations, but keep all runtime checks; it could be named differently, perhaps ReleaseSafe, or something).
The Debug build should enable all runtime and compile time checks / warnings that a given compiler allows. The Release build should make the fastest build for the given architecture. For ifort
I think that's the default (i.e. no options). For gfortran
that's -O3 -march=native -ffast-math -funroll-loops
(the later gfortran
versions also have -Ofast
which does a lot of these and a few more --- so we should look into it and probably use it).
So as a start, I would start with Debug and Release. Then as we go, we can keep refining it.
We can take the initial options for gfortran / Intel from here:
https://www.fortran90.org/src/faq.html#what-compiler-options-should-i-use-for-development
https://www.fortran90.org/src/faq.html#what-compiler-options-should-i-use-for-production-run
from fpm.
Those are good suggestions for defaults. But I'm more talking about what we want to allow users to specify.
Should we only allow users to specify a single set of compiler flags for each of debug and release modes? Or should there be some more granularity available? Different flags for executables vs libraries?
Also, when a user specifies compiler flags manually, should they specify the flags directly (i.e. "-funroll-loops") or with a more generic option that looks up the specific flag for the given compiler?
from fpm.
Ah I see. I would definitely allow to specify any compiler flag to any file and any executable / library. That way it should be possible to build any project out there. It's just that we want to discourage users doing that obviously, but we should allow that.
Regarding "generic options" like "unroll loops" for "-funroll-loops`, I would not do that, because I think it will be very hard to find such options for every compiler. Initially the only generic options that I would allow are Debug / Release / ReleaseSafe. Later on, we can perhaps add more, if users request them.
So for example, the user can select Debug mode that would be applied to every file, except those that the user specifically sets manually.
from fpm.
Ok, that's definitely going to have to take some thinking about how to design on both the fpm.toml
side, and the actual build process side.
from fpm.
We should not over design this. Right now we are just writing a prototype, to help us figure out the requirements, because what you are asking for are the requirements which we do not know yet, until we gain more experience using fpm
with actual Fortran codebases.
from fpm.
What I personally understand as a debug build is enabling (some of) the following options:
- Generate debugging information (should be used with a lower optimization level)
- Enable backtrace of runtime errors
- gfortran
-fbacktrace
- ifort
-traceback
- NAG
-gline
- gfortran
- Run-time checks
Additionally, we could set flags related to handling floating-point exceptions as provided here (Intel) and here (gfortran).
from fpm.
Related Issues (20)
- do not leave empty dependencies
- /subversion:windows is ignored option using intel compiler in windows using --link-flag
- `fpm test` runs test/main.F90 twice on a case-preserving macOS file system HOT 1
- How to support 3rd party dependencies in Conda
- Non-portable usage in fpm-0.10.1.F90 (as of 3-25-24) HOT 2
- fails with non-standard Fortran usage using ifx(1) compiler
- ordering of link flags before archive, thus flag ignored by linker
- Compilation fails with BOZ literal constant
- `-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
- --flag doesn't override the default flags even without --profile HOT 6
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.