From 1aa410c63fd5965e68b8da92f74815ba5071a4b4 Mon Sep 17 00:00:00 2001 From: Manu Seth <22492939+mseth10@users.noreply.github.com> Date: Fri, 18 Jan 2019 18:53:16 -0800 Subject: [PATCH] disable default MKLDNN for cross compilation (#13893) * disable default MKLDNN for cross compilation * adding temporary debug logs --- CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23609e5ec243..f61c241398b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,17 @@ cmake_minimum_required(VERSION 3.0.2) +# workaround to store CMAKE_CROSSCOMPILING because is getting reset by the project command +if(CMAKE_CROSSCOMPILING) + set(__CMAKE_CROSSCOMPILING ${CMAKE_CROSSCOMPILING}) + set(__CMAKE_CROSSCOMPILING_OVERRIDE ON) +endif() + project(mxnet C CXX) +if(__CMAKE_CROSSCOMPILING_OVERRIDE) + set(CMAKE_CROSSCOMPILING ${__CMAKE_CROSSCOMPILING}) +endif() + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build/private/local_config.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/build/private/local_config.cmake) endif() @@ -20,7 +30,7 @@ mxnet_option(USE_F16C "Build with x86 F16C instruction support" ON) mxnet_option(USE_LAPACK "Build with lapack support" ON) mxnet_option(USE_MKL_IF_AVAILABLE "Use MKL if found" ON) mxnet_option(USE_MKLML_MKL "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND (NOT APPLE)) -mxnet_option(USE_MKLDNN "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND (NOT APPLE) AND (NOT MSVC) AND (CMAKE_SYSTEM_PROCESSOR MATCHES x86_64)) +mxnet_option(USE_MKLDNN "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND (NOT APPLE) AND (NOT MSVC) AND (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") AND (NOT CMAKE_CROSSCOMPILING)) mxnet_option(USE_OPERATOR_TUNING "Enable auto-tuning of operators" ON IF NOT MSVC) mxnet_option(USE_GPERFTOOLS "Build with GPerfTools support (if found)" ON) mxnet_option(USE_JEMALLOC "Build with Jemalloc support" ON) @@ -41,6 +51,10 @@ mxnet_option(USE_TENSORRT "Enable infeference optimization with TensorRT mxnet_option(USE_ASAN "Enable Clang/GCC ASAN sanitizers." OFF) mxnet_option(ENABLE_TESTCOVERAGE "Enable compilation with test coverage metric output" OFF) +message(STATUS "CMAKE_CROSSCOMPILING ${CMAKE_CROSSCOMPILING}") +message(STATUS "CMAKE_HOST_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR}") +message(STATUS "CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}") + message(STATUS "CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") if(USE_CUDA AND NOT USE_OLDCMAKECUDA) message(STATUS "CMake version '${CMAKE_VERSION}' using generator '${CMAKE_GENERATOR}'")