|
@@ -39,6 +39,17 @@ option(MGE_WITH_TRT "Build MegEngine with TensorRT." ON) |
|
|
option(MGE_USE_SYSTEM_LIB "Build MegEngine with system libraries." OFF) |
|
|
option(MGE_USE_SYSTEM_LIB "Build MegEngine with system libraries." OFF) |
|
|
option(MGB_WITH_FLATBUFFERS "Build MegBrain with FlatBuffers serialization support." ON) |
|
|
option(MGB_WITH_FLATBUFFERS "Build MegBrain with FlatBuffers serialization support." ON) |
|
|
option(BUILD_SHARED_LIBS "Build shared libraries" ON) |
|
|
option(BUILD_SHARED_LIBS "Build shared libraries" ON) |
|
|
|
|
|
option(MGE_ENABLE_RTTI "Build with RTTI" ON) |
|
|
|
|
|
option(MGE_ENABLE_LOGGING "Build with logging" ON) |
|
|
|
|
|
option(MGE_DEBUG_UTIL "Enable debug utility" ON) |
|
|
|
|
|
option(MGE_ENABLE_EXCEPTIONS "Build with exceptions" ON) |
|
|
|
|
|
option(MGE_WITH_TEST "Enable test for MegEngine." OFF) |
|
|
|
|
|
option(MGE_WITH_DISTRIBUTED "Build with distributed support" ON) |
|
|
|
|
|
option(MGE_BUILD_IMPERATIVE_RT "Build _imperative_rt.so instead of _mgb.so " OFF) |
|
|
|
|
|
option(MGE_BUILD_SDK "Build load_and_run" ON) |
|
|
|
|
|
option(MGE_INFERENCE_ONLY "Build inference only library." OFF) |
|
|
|
|
|
option(MGE_WITH_PYTHON_MODULE "Build MegEngine Python Module." ON) |
|
|
|
|
|
option(MGE_WITH_MKLDNN "Enable Intel MKL_DNN support," ON) |
|
|
|
|
|
|
|
|
if (APPLE) |
|
|
if (APPLE) |
|
|
set (BUILD_SHARED_LIBS OFF) |
|
|
set (BUILD_SHARED_LIBS OFF) |
|
@@ -167,15 +178,6 @@ if(CXX_SUPPORT_GOLD AND NOT ANDROID AND NOT APPLE AND NOT MSVC AND NOT WIN32) |
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MGE_COMMON_LINKER_FLAGS}") |
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MGE_COMMON_LINKER_FLAGS}") |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
option(MGE_WITH_JIT "Build MegEngine with JIT." ON) |
|
|
|
|
|
option(MGE_WITH_HALIDE "Build MegEngine with Halide JIT" ON) |
|
|
|
|
|
option(MGE_DISABLE_FLOAT16 "Disable MegEngine float16 support." OFF) |
|
|
|
|
|
option(MGE_WITH_CUDA "Enable MegEngine CUDA support." ON) |
|
|
|
|
|
option(MGE_CUDA_USE_STATIC "Enable MegEngine CUDA static linking." ON) |
|
|
|
|
|
option(MGE_WITH_TRT "Build MegEngine with TensorRT." ON) |
|
|
|
|
|
option(MGE_USE_SYSTEM_LIB "Build MegEngine with system libraries." OFF) |
|
|
|
|
|
option(MGB_WITH_FLATBUFFERS "Build MegBrain with FlatBuffers serialization support." ON) |
|
|
|
|
|
|
|
|
|
|
|
if(NOT MGE_WITH_JIT) |
|
|
if(NOT MGE_WITH_JIT) |
|
|
if(MGE_WITH_HALIDE) |
|
|
if(MGE_WITH_HALIDE) |
|
|
message(WARNING "MGE_WITH_HALIDE is set to OFF with MGE_WITH_JIT disabled") |
|
|
message(WARNING "MGE_WITH_HALIDE is set to OFF with MGE_WITH_JIT disabled") |
|
@@ -221,10 +223,6 @@ if(NOT CMAKE_CUDA_HOST_COMPILER) |
|
|
set(CMAKE_CUDA_HOST_COMPILER $(CMAKE_CXX_COMPILER)) |
|
|
set(CMAKE_CUDA_HOST_COMPILER $(CMAKE_CXX_COMPILER)) |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
option(MGE_ENABLE_RTTI "Build with RTTI" ON) |
|
|
|
|
|
option(MGE_ENABLE_LOGGING "Build with logging" ON) |
|
|
|
|
|
option(MGE_DEBUG_UTIL "Enable debug utility" ON) |
|
|
|
|
|
|
|
|
|
|
|
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) |
|
|
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) |
|
|
message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") |
|
|
message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") |
|
|
set(CMAKE_BUILD_TYPE RelWithDebInfo) |
|
|
set(CMAKE_BUILD_TYPE RelWithDebInfo) |
|
@@ -234,25 +232,19 @@ if(NOT MGE_ENABLE_RTTI) |
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
option(MGE_ENABLE_EXCEPTIONS "Build with exceptions" ON) |
|
|
|
|
|
if(NOT MGE_ENABLE_EXCEPTIONS) |
|
|
if(NOT MGE_ENABLE_EXCEPTIONS) |
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exception") |
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exception") |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
option(MGE_WITH_TEST "Enable test for MegEngine." OFF) |
|
|
|
|
|
if(MGE_WITH_TEST) |
|
|
if(MGE_WITH_TEST) |
|
|
include(cmake/gtest.cmake) |
|
|
include(cmake/gtest.cmake) |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
option(MGE_WITH_DISTRIBUTED "Build with distributed support" ON) |
|
|
|
|
|
option(MGE_BUILD_IMPERATIVE_RT "Build _imperative_rt.so instead of _mgb.so " OFF) |
|
|
|
|
|
if(MGE_BUILD_IMPERATIVE_RT) |
|
|
if(MGE_BUILD_IMPERATIVE_RT) |
|
|
add_compile_definitions(MGB_ENABLE_IMPERATIVE_RUNTIME) |
|
|
add_compile_definitions(MGB_ENABLE_IMPERATIVE_RUNTIME) |
|
|
set(CMAKE_CXX_STANDARD 17) |
|
|
set(CMAKE_CXX_STANDARD 17) |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
option(MGE_BUILD_SDK "Build load_and_run" ON) |
|
|
|
|
|
if(MGE_BUILD_IMPERATIVE_RT) |
|
|
if(MGE_BUILD_IMPERATIVE_RT) |
|
|
set(MGE_BUILD_SDK OFF) |
|
|
set(MGE_BUILD_SDK OFF) |
|
|
endif() |
|
|
endif() |
|
@@ -262,8 +254,6 @@ if(NOT MGE_WITH_CUDA) |
|
|
set(MGE_WITH_DISTRIBUTED OFF) |
|
|
set(MGE_WITH_DISTRIBUTED OFF) |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
option(MGE_INFERENCE_ONLY "Build inference only library." OFF) |
|
|
|
|
|
option(MGE_WITH_PYTHON_MODULE "Build MegEngine Python Module." ON) |
|
|
|
|
|
if(MGE_INFERENCE_ONLY) |
|
|
if(MGE_INFERENCE_ONLY) |
|
|
message("-- Disable distributed support for inference only build.") |
|
|
message("-- Disable distributed support for inference only build.") |
|
|
set(MGE_WITH_DISTRIBUTED OFF) |
|
|
set(MGE_WITH_DISTRIBUTED OFF) |
|
@@ -438,8 +428,6 @@ if(${MGE_ARCH} STREQUAL "x86_64" OR ${MGE_ARCH} STREQUAL "i386") |
|
|
endif() |
|
|
endif() |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
option(MGE_WITH_MKLDNN "Enable Intel MKL_DNN support," ON) |
|
|
|
|
|
|
|
|
|
|
|
# MKLDNN build |
|
|
# MKLDNN build |
|
|
if(MGE_WITH_MKLDNN AND ${MGE_ARCH} STREQUAL "x86_64") |
|
|
if(MGE_WITH_MKLDNN AND ${MGE_ARCH} STREQUAL "x86_64") |
|
|
include(cmake/MKL_DNN.cmake) |
|
|
include(cmake/MKL_DNN.cmake) |
|
|