Disable DART_ENABLE_SIMD by default #790
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
When
DART_ENABLE_SIMD
is on, DART enables SIMD instructions by adding compiler option-march=native
. This compiler option enables all the available SIMD instruction subsets of the local machine. This way has two caveats:(1) We don't convey the compiler option to the DART dependent projects (e.g., Aikido). So the DART dependent project don't know whether DART is built with SIMD enabled, and it could end up building them with different SIMD options, which may cause segfaults in runtime. I guess #780 is the case.
(2) Even though we pass
-march=native
to DART and DART dependent projects, still they could be built with different SIMD options if they are built on different machines as @j-rivero mentioned in this comment. This could happen, for example, when Aikido links to DART installed usingapt-get
(the debian package atppa:dartsim
) and your machine's architecture is not the same withppa:dartsim
's one.Changes
This PR first pass
-march=native
as the target compiler option todart
target so that it is automatically added to the consumer project by CMake whenDART_ENABLE_SIMD
is ON. Secondly,DART_ENABLE_SIMD
is now OFF by default. We regard this option is an advanced one and should be used when you know what's happening exactly.Note
-sse2
option, and this is enabled by default for the modern CPUs. However,-march=native
enables more options such as-avx
.Please let me know if I missed anything.
This change is