Skip to content

Commit

Permalink
Making sure Vc V2 builds without additional HPX configuration flags
Browse files Browse the repository at this point in the history
- this fixes #2701
  • Loading branch information
hkaiser committed Jul 6, 2017
1 parent 46d6021 commit a7929b3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions cmake/HPX_SetupVc.cmake
Expand Up @@ -34,16 +34,26 @@
# Vc_AVX_INTRINSICS_BROKEN

find_package(Vc ${Vc_FIND_VERSION} QUIET NO_MODULE PATHS ${Vc_ROOT})
if(NOT Vc_FOUND AND NOT HPX_WITH_DATAPAR_VC_NO_LIBRARY)
hpx_error("Vc was not found while datapar support was requested. Set Vc_ROOT to the installation path of Vc")

if(NOT Vc_FOUND)
if(NOT Vc_VERSION_STRING OR (${Vc_VERSION_STRING} VERSION_LESS "1.70.0"))
# didn't find any version of Vc
hpx_error("Vc was not found while datapar support was requested. Set Vc_ROOT to the installation path of Vc")
endif()
endif()

if(Vc_VERSION_STRING AND (NOT ${Vc_VERSION_STRING} VERSION_LESS "1.70.0"))
# found Vc V2
if(NOT Vc_INCLUDE_DIR)
hpx_error("Vc was not found while datapar support was requested. Set Vc_ROOT to the installation path of Vc")
endif()
set(HPX_WITH_DATAPAR_VC_NO_LIBRARY On)
endif()

include_directories(SYSTEM ${Vc_INCLUDE_DIR})
if(NOT HPX_WITH_DATAPAR_VC_NO_LIBRARY)
link_directories(${Vc_LIB_DIR})
endif()

if(NOT HPX_WITH_DATAPAR_VC_NO_LIBRARY)
hpx_library_dir(${Vc_LIB_DIR})
hpx_libraries(${Vc_LIBRARIES})
endif()
Expand Down Expand Up @@ -73,5 +83,5 @@ endif()
hpx_add_config_define(HPX_HAVE_DATAPAR)
hpx_add_config_define(HPX_HAVE_DATAPAR_VC)

hpx_info("Found Vc (vectorization): " ${Vc_INCLUDE_DIR})
hpx_info("Found Vc (vectorization):" ${Vc_INCLUDE_DIR} "- version:" ${Vc_VERSION_STRING})

0 comments on commit a7929b3

Please sign in to comment.