@@ -15,6 +15,7 @@ mxnet_option(USE_NCCL "Use NVidia NCCL with CUDA" OFF)
15
15
mxnet_option(USE_OPENCV "Build with OpenCV support" ON )
16
16
mxnet_option(USE_OPENMP "Build with Openmp support" ON )
17
17
mxnet_option(USE_CUDNN "Build with cudnn support" ON ) # one could set CUDNN_ROOT for search path
18
+ mxnet_option(USE_SSE "Build with x86 SSE instruction support" AUTO)
18
19
mxnet_option(USE_LAPACK "Build with lapack support" ON IF NOT MSVC )
19
20
mxnet_option(USE_MKL_IF_AVAILABLE "Use MKL if found" ON )
20
21
mxnet_option(USE_MKLML_MKL "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND UNIX AND (NOT APPLE ))
@@ -90,11 +91,17 @@ if(MSVC)
90
91
else (MSVC )
91
92
include (CheckCXXCompilerFlag)
92
93
if (USE_CXX14_IF_AVAILABLE)
93
- check_cxx_compiler_flag("-std=c++14" SUPPORT_CXX14)
94
+ check_cxx_compiler_flag("-std=c++14" SUPPORT_CXX14)
94
95
endif ()
95
96
check_cxx_compiler_flag("-std=c++11" SUPPORT_CXX11)
96
97
check_cxx_compiler_flag("-std=c++0x" SUPPORT_CXX0X)
97
- check_cxx_compiler_flag("-msse2" SUPPORT_MSSE2)
98
+ # For cross compilation, we can't rely on the compiler which accepts the flag, but mshadow will
99
+ # add platform specific includes not available in other arches
100
+ if (USE_SSE STREQUAL "AUTO" )
101
+ check_cxx_compiler_flag("-msse2" SUPPORT_MSSE2)
102
+ else ()
103
+ set (SUPPORT_MSSE2 FALSE )
104
+ endif ()
98
105
set (CMAKE_C_FLAGS "-Wall -Wno-unknown-pragmas -fPIC -Wno-sign-compare" )
99
106
if ("${CMAKE_CXX_COMPILER_ID} " MATCHES ".*Clang$" )
100
107
set (CMAKE_C_FLAGS "-Wno-braced-scalar-init" )
0 commit comments