Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler Flags #15

Closed
ranocha opened this issue Feb 14, 2019 · 4 comments
Closed

Compiler Flags #15

ranocha opened this issue Feb 14, 2019 · 4 comments

Comments

@ranocha
Copy link
Member

ranocha commented Feb 14, 2019

Do we really want to set all the compiler flags of

SET(CMAKE_CXX_FLAGS " -std=c++11 -O2 -funroll-loops -fstrict-aliasing -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -fPIC -Wall -mfpmath=sse -Wcast-align -Wl,-E")

In particular, options such as -mavx2 are problematic if the target CPU does not support them. This caused some errors while enabling Mac OS X in #14.

Some reasons for the current choice are probably connected with clusters, where build machines have not the same architecture as the compute nodes. But this could be caught by some other variables passed to cmake. What is your opinion, @philipheinisch?

@philipheinisch
Copy link
Member

Good question, one solution would be to automatically detect CPU features and enable appropriate flags automatically – but this could cause problems on compute clusters. Interestingly GCC just ignored unsupported flags for example on ARM. Maybe an internal lookup table for different CPU architectures?

@ranocha
Copy link
Member Author

ranocha commented Feb 17, 2019

That might be possible but sounds rather complicated.

@ranocha
Copy link
Member Author

ranocha commented Feb 18, 2019

We will check whether the host code is performance critical (probably it is not) and adapt the compiler flags accordingly, e.g. by setting only -march=native.

This was referenced Mar 10, 2019
@ranocha
Copy link
Member Author

ranocha commented Mar 14, 2019

Closed in #30.

@ranocha ranocha closed this as completed Mar 14, 2019
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

No branches or pull requests

2 participants