Commit 074cd488 authored by Burlen Loring's avatar Burlen Loring
Browse files

SciberQuestToolKit -- intel includes

gcc intinsics are erroneously found by the intel compiler, try to
prevent this by finding and including intel's directory explicitly.
if we can't locate the header then a warning is issued, the user
may have to set the path if there are problems. There may not be
problems if the intel compiler searches its directories bofore
gcc's or gcc's copy of the intriniscs don't conflict with intels.
parent 5f490998
......@@ -18,23 +18,42 @@ endif ()
include_directories(${Eigen_DIR})
# On Nautilus gcc intrinsics are found if
# we don't add an include for the intel intrinsics.
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
message(STATUS "SQTK Intel compiler detected.")
set(EXTRA_INTEL_INCLUDES
/path/to/intel/include/intel64
CACHE FILEPATH
"Path to intel intrinsics.")
mark_as_advanced(EXTRA_INTEL_INCLUDES)
if (NOT EXISTS ${EXTRA_INTEL_INCLUDES})
message(FATAL_ERROR
"SQTK Set EXTRA_INTEL_INCLUDES to the path to the intel compiler.")
# prevent intel compilers from errouniously using intrinsics packaged
# with gcc
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(INTEL_COMP_ROOT "" CACHE PATH "Intel compiler root")
get_filename_component(INTEL_COMP_ROOT ${CMAKE_CXX_COMPILER} PATH)
mark_as_advanced(INTEL_COMP_ROOT)
exec_program(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE INTEL_COMP_VERSION)
string(REGEX
REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
INTEL_COMP_VERSION ${INTEL_COMP_VERSION})
set(INTEL_XMMINTRIN)
#if (INTEL_COMP_VERSION LESS 120)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
find_file(INTEL_XMMINTRIN
NAMES xmmintrin.h
PATHS "${INTEL_COMP_ROOT}/../../include/intel64"
NO_DEFAULT_PATH)
else()
find_file(INTEL_XMMINTRIN
NAMES xmmintrin.h
PATHS "${INTEL_COMP_ROOT}/../../include/ia32"
NO_DEFAULT_PATH)
endif()
mark_as_advanced(INTEL_XMMINTRIN)
if (NOT INTEL_XMMINTRIN)
message(WARNING "The Intel compiler may need EXTRA_INTEL_INCLUDES set to the directory containing xmmintrin.h")
endif ()
#endif ()
get_filename_component(INTEL_XMMINTRIN_PATH ${INTEL_XMMINTRIN} PATH)
mark_as_advanced(INTEL_XMMINTRIN_PATH)
set(EXTRA_INTEL_INCLUDES ${INTEL_XMMINTRIN_PATH} CACHE PATH
"Set this to the path to intel xmm intrinsics header if there are conflicts with gcc's xmm intrinsics.")
mark_as_advanced(EXTRA_INTEL_INCLUDES)
if (EXISTS ${EXTRA_INTEL_INCLUDES})
include_directories(${EXTRA_INTEL_INCLUDES})
endif ()
include_directories(${EXTRA_INTEL_INCLUDES})
endif ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment