Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[DOC] cmake default without -O3 and order of args/options in cmake call #2017
Comments
Thank you for pointing this out. It is a known fact / best practice in the CMake community that The best-practice in CMake for header-only libraries, like SeqAn2 or SeqAn3, is to specify only the minimal required flags that are needed to compile any given source that uses SeqAn. Additional flags, like hardening options or performance options is up to the application developer and/or package maintainer. The rational is simple, if we would add the
Thank you for this, too :) |
Stefan Kurtz reported the following issue over our seqan-dev list:
I followed the description for the Cmake-setup and noticed in the example CMakeList.txt shown at the end of https://docs.seqan.de/seqan/3-master-user/setup.html that compiler optimization options such as -O3 is missing, which will lead to poor performance for users who do not recognize it.
I now use
add_compile_options(-DNDEBUG -Wall -Wextra -Wunused-parameter -Wunused-variable -pedantic -Werror -O3)in CmakeLists.txt.
The cmake-setup specifies that one has to call
cmake ../source -DCMAKE_CXX_COMPILER=/path/to/executable/g++-7
The help pages of cmake version 3.16.3 on macOS and cmake version 3.10.2 on Linux state that options come before arguments, but only the macOS version enforces this. So on my macOS system only
works. To simplify the use for macOS, it is probably better use this order in the cmake-setup section (and elsewhere) which works on both platforms.
Platform
/path/to/compiler --versionhere -->Description
How to repeat the problem
Expected behaviour
Actual behaviour