Skip to content

reorganize CMakeLists.txt to explicitly specify optimization levels …#204

Open
crazyzlj wants to merge 2 commits into
swat-model:mainfrom
crazyzlj:cmake-improvement
Open

reorganize CMakeLists.txt to explicitly specify optimization levels …#204
crazyzlj wants to merge 2 commits into
swat-model:mainfrom
crazyzlj:cmake-improvement

Conversation

@crazyzlj
Copy link
Copy Markdown
Contributor

This PR includes:

  • Since -o defaultly means -o2 for ifort/ifx and -o0 for gfortran, I think it's better to use exact -o0, -o1, or -o2 in the CMakeLists.txt, to keep consistent among different compilers. Then, I tried to reorganize the CMakeLists.txt to accept the argument OPT_LEVEL to specify the optimization level for non-Debug configs, like O0, O1, O2, O3. Actually, I did account for an inconsistent behavior between /O2 and /O1 when working with MSVC 2015+ifort 17.0. The /O2 got wrong, and the O1 and Debug mode got the correct and same results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant