Skip to content
Snippets Groups Projects
Commit 19557065 authored by Jö Fahlke's avatar Jö Fahlke
Browse files

[!677] Don't pass the cpu flags detected by Vc to the compiler

Merge branch 'avoid-vc-cpu-detection' into 'master'

ref:core/dune-common Vc detects CPU flags based on the name of the CPU. This
can be a problem in virtualization environment, when the name of the CPU is
visible, but not all features are enabled in the guest.

Also, enabling all detected features in the the compiler makes it difficult to
impossible for the user to force his own feature flags, e.g. to cross-build
generic executables on hosts with many features to be run later on hosts with
fewer features.

Closes: [docker/ci#9]

WIP:

-   [x] properly test, in particular in the light of [docker/ci!46] being
    applied to the ci images
-   [x] ansgar [proposed] getting rid of all the Vc_COMPILE_FLAGS, too. Try
    that: [!679] (redifined [!679] as an add-on to this one, so it does not
    stop me from merging this one)
-   [x] changelog entry (deferred to [#163])

See merge request [core/dune-common!677]

  [docker/ci#9]: gitlab.dune-project.org/docker/ci/issues/9
  [docker/ci!46]: gitlab.dune-project.org/docker/ci/merge_requests/46
  [proposed]: docker/ci#9 (comment 56350)
  [!679]: gitlab.dune-project.org/NoneNone/merge_requests/679
  [#163]: gitlab.dune-project.org/NoneNone/issues/163
  [core/dune-common!677]: gitlab.dune-project.org/core/dune-common/merge_requests/677


Closes docker/ci#9
parents 7933d8fc c0bbf1a5
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ function(add_dune_vc_flags _targets)
if(Vc_FOUND)
foreach(_target ${_targets})
target_link_libraries(${_target} ${Vc_LIBRARIES})
target_compile_options(${_target} PUBLIC ${Vc_ALL_FLAGS})
target_compile_options(${_target} PUBLIC ${Vc_COMPILE_FLAGS})
target_compile_definitions(${_target} PUBLIC ENABLE_VC=1)
target_include_directories(${_target} SYSTEM PUBLIC ${Vc_INCLUDE_DIR})
endforeach(_target ${_targets})
......@@ -25,7 +25,7 @@ function(add_dune_vc_flags _targets)
endfunction(add_dune_vc_flags)
if(Vc_FOUND)
dune_register_package_flags(COMPILE_OPTIONS "${Vc_ALL_FLAGS};-DENABLE_VC=1"
dune_register_package_flags(COMPILE_OPTIONS "${Vc_COMPILE_FLAGS};-DENABLE_VC=1"
LIBRARIES "${Vc_LIBRARIES}"
INCLUDE_DIRS "${Vc_INCLUDE_DIR}")
endif(Vc_FOUND)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment