You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For integration in packaging systems like conda-build or spack or to seamlessly work with environment modules fpm could allow an option to use non-prefixed environment variables.
--compiler, FPM_FC, FC to set Fortran compiler
--c-compiler, FPM_CC, CC to set C compiler
--archiver, FPM_AR, AR to set archiver
--flag, FPM_FFLAGS, FFLAGS to set Fortran compiler flags
--c-flag, FPM_CFLAGS, CFLAGS to set C compiler flags
--link-flag, FPM_LDFLAGS, LDFLAGS to set linker flags
The non-prefixed environment variables will not be used by default to avoid picking up environment variables by accident, i.e. using the non-prefixed variables is always opt-in.
Possible Solution
Use command line flag --env or similar to activate usage of compiler variables. Always provide an option to show to show where a particular default originated from.
One other change that I was hoping would come out of the discussions was an option to set the variable prefix so that it could be a user-defined value, even a blank character, so you could set compiler-specific values or even not have a prefix (and so use FC, AR, ...). So I could set INTEL_FFLAGS and GFORTRAN_FFLAGS and ... and switch to different sets of them just by setting FPM_PRE. No one liked that? It would give you a back door to use the default names and if you are using environment variables would let you have compiler-specific sets of them.
This use case of different compiler flags is a compelling reason to do this IMO.
I think the proposed PR #608 satisfied the original post without introducing some of the perils associated with using environment variables as an opt-in is required, and easily allows setting groups of variables for specific compilers. It also allows for user-defined names for groups of variables for the case where you want multiple choices for the same compiler. All new variable names are required to begin with FPM_ so they are easier to identify and list as well.
Description
For integration in packaging systems like conda-build or spack or to seamlessly work with environment modules fpm could allow an option to use non-prefixed environment variables.
--compiler
,FPM_FC
,FC
to set Fortran compiler--c-compiler
,FPM_CC
,CC
to set C compiler--archiver
,FPM_AR
,AR
to set archiver--flag
,FPM_FFLAGS
,FFLAGS
to set Fortran compiler flags--c-flag
,FPM_CFLAGS
,CFLAGS
to set C compiler flags--link-flag
,FPM_LDFLAGS
,LDFLAGS
to set linker flagsThe non-prefixed environment variables will not be used by default to avoid picking up environment variables by accident, i.e. using the non-prefixed variables is always opt-in.
Possible Solution
Use command line flag
--env
or similar to activate usage of compiler variables. Always provide an option to show to show where a particular default originated from.Additional Information
Follow-up from #549
The text was updated successfully, but these errors were encountered: