Closed mikebentley15 closed 4 years ago
I say we should break backwards compatibility in this case. It should be safe to assume that users wanting to mix compilers should know how, and if they don't we have documentation.
Thanks for the input. I agree. Besides, if we have any users besides us, I don't know about them...
I've removed the insertion of the --gcc-toolchain
flag from the generated Makefile
and updated documentation accordingly. I also updated tests for this change.
Fixes #125
Description: We wanted a way to specify compiler flags specific to only one of the compilers and not all of them. In this pull request, I added two settings for each compiler in the
flit-config.toml
file.fixed_compile_flags
: compile flags for only this compiler when compiling object files and will also be used during the link stage.fixed_link_flags
: link-time flags for only this compiler when linkingCurrently, these are tied to the compiler type instead of the compiler name, and therefore we still only support one of each supported compiler types. We hope to change that with issue #40.
The flags placed into these two settings get put into the generated
Makefile
. For agcc
type compiler, these variables areGCC_CXXFLAGS
andGCC_LDFLAGS
respectively.Question Do we want to remove the automatic insertion of the
--gcc-toolchain
flag for Clang compilers? Now that it is documented, we could expect users to specify that flag. Currently, if the user wants to specify a differentlibstdc++
version to use than the GCC compiler specified inflit-config.toml
, then there is no clear way to do that.However, if we were to do such a change, we could potentially break backward functionality compatibility and cause successful uses of flit to no longer work without fixing
flit-config.toml
. Also, it may make FLiT harder to use since you now have to worry about which standard library your Clang and Intel compilers are using. Granted, I think it's helpful to understand what's going on, I also understand many people don't have the time for that.@IanBriggs what do you think? Should we remove it and expect the user to be more explicit and hope s/he reads the manual? Or should we keep it for ease of use and for backward compatibility? I really don't like that there is no way to change the automatically inserted
--gcc-toolchain
flag.Documentation:
Tests: I added two test cases
flit_cli/flit_update/tst_compilerspecificflags.py
: tests that the settings inflit-config.toml
make it into the appropriate variables within the generatedMakefile
flit_makefile/tst_build_with_compiler_specific_flags.py
: tests that the generated Makefile actually uses the flags during commpilations of source files