Giter VIP home page Giter VIP logo

Comments (7)

everythingfunctional avatar everythingfunctional commented on July 25, 2024 1

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.

certik avatar certik commented on July 25, 2024

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.

everythingfunctional avatar everythingfunctional commented on July 25, 2024

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.

certik avatar certik commented on July 25, 2024

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.

everythingfunctional avatar everythingfunctional commented on July 25, 2024

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.

certik avatar certik commented on July 25, 2024

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.

ivan-pi avatar ivan-pi commented on July 25, 2024

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
  • Run-time checks
    • gfortran -fcheck=[all,array-temps,bits,bounds,do,mem,pointer,recursion]
    • ifort -check=[arg_temp_created,assume,bounds,contiguous,format,output_conversion,pointers,shape,stack,udio_iostat,uninit,all]
    • NAG -C, -C=[alias,all,array,bits,calls,dangling,do,intovf,none,present,pointer,recursion,undefined]

Additionally, we could set flags related to handling floating-point exceptions as provided here (Intel) and here (gfortran).

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.