From 61c5c9cf742709f8be722a72995dfaa8d9f17d5b Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Tue, 20 Oct 2020 11:48:30 +0800 Subject: [PATCH] chore(cmake): normlize some cmake message level GitOrigin-RevId: 4550cbfaa6b4e6e4a22daa8217ab12a1482c1e88 --- CMakeLists.txt | 52 +++++++++++++------------- cmake/FetchMegBrainVersion.cmake | 2 +- cmake/MKL_DNN.cmake | 2 +- cmake/OpenBLAS.cmake | 2 +- cmake/aclrt.cmake | 2 +- cmake/cndev.cmake | 2 +- cmake/cnml.cmake | 2 +- cmake/cnrt.cmake | 2 +- cmake/cpuinfo.cmake | 2 +- cmake/cudnn.cmake | 2 +- cmake/flatbuffers.cmake | 4 +- cmake/mkl.cmake | 2 +- cmake/tensorrt.cmake | 2 +- imperative/CMakeLists.txt | 6 +-- imperative/python/megengine/version.py | 2 +- src/CMakeLists.txt | 4 +- 16 files changed, 45 insertions(+), 45 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 155a10f90..7bf64ba35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,7 @@ option(MGE_WITH_ROCM "Enable ROCM support" OFF) if(NOT ${MGE_BIN_REDUCE} STREQUAL "") - message("build with BIN REDUCE") + message(STATUS "build with BIN REDUCE") if(MGE_WITH_MINIMUM_SIZE) set(MGE_ENABLE_RTTI OFF) set(MGE_ENABLE_LOGGING OFF) @@ -73,14 +73,14 @@ if(NOT ${MGE_BIN_REDUCE} STREQUAL "") endif() if(MGE_WITH_MIDOUT_PROFILE) - message("build with MIDOUT PROFILE") + message(STATUS "build with MIDOUT PROFILE") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMIDOUT_PROFILING") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMIDOUT_PROFILING") endif() if (APPLE) set (BUILD_SHARED_LIBS OFF) - message("build static for xcode framework require") + message(STATUS "build static for xcode framework require") endif() if (MGE_USE_SYSTEM_LIB) @@ -92,8 +92,8 @@ if (MGB_WITH_FLATBUFFERS) endif() if(CMAKE_TOOLCHAIN_FILE) - message("We are cross compiling.") - message("config FLATBUFFERS_FLATC_EXECUTABLE to: ${PROJECT_SOURCE_DIR}/build_dir/host_flatc/install/bin/flatc") + message(STATUS "We are cross compiling.") + message(STATUS "config FLATBUFFERS_FLATC_EXECUTABLE to: ${PROJECT_SOURCE_DIR}/build_dir/host_flatc/install/bin/flatc") set(FLATBUFFERS_FLATC_EXECUTABLE "${PROJECT_SOURCE_DIR}/build_dir/host_flatc/install/bin/flatc") if(ANDROID_TOOLCHAIN_ROOT) if(NOT "${ANDROID_ARCH_NAME}" STREQUAL "") @@ -127,7 +127,7 @@ if(CMAKE_TOOLCHAIN_FILE) else() message(FATAL_ERROR "Unknown cross-compiling settings.") endif() - message("CONFIG MGE_ARCH TO ${MGE_ARCH}") + message(STATUS "CONFIG MGE_ARCH TO ${MGE_ARCH}") endif() if(${MGE_ARCH} STREQUAL "AUTO") @@ -147,7 +147,7 @@ endif() if((${MGE_ARCH} STREQUAL "x86_64" OR ${MGE_ARCH} STREQUAL "i386" OR ${MGE_ARCH} STREQUAL "armv7" OR ${MGE_ARCH} STREQUAL "aarch64") AND NOT APPLE) option(MGE_ENABLE_CPUINFO "Build cpuinfo library for check runtime." ON) if(MGE_ENABLE_CPUINFO) - message("-- Enable cpuinfo runtime check and little kernel optimize.") + message(STATUS "Enable cpuinfo runtime check and little kernel optimize.") add_definitions(-DMGB_ENABLE_CPUINFO_CHECK) include(cmake/cpuinfo.cmake) endif() @@ -163,8 +163,8 @@ if(MSVC OR WIN32) endif() add_compile_definitions(NOMINMAX=1 _USE_MATH_DEFINES=1 WIN32=1) - message("-- into windows build...") - message("-- CMAKE_C_COMPILER_ID: ${CMAKE_C_COMPILER_ID}") + message(STATUS "into windows build...") + message(VERBOSE "CMAKE_C_COMPILER_ID: ${CMAKE_C_COMPILER_ID}") if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang-cl") message(FATAL_ERROR "only support clang-cl for windows build, pls check detail: scripts/cmake-build/BUILD_README.md") endif() @@ -187,12 +187,12 @@ if(MSVC OR WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WIN_FLAGS}") #FIXME: fix halide JIT on windows - message("-- disable jit, halide and mlir on windows host build...") + message(STATUS "disable jit, halide and mlir on windows host build...") set(MGE_WITH_HALIDE OFF) set(MGE_WITH_JIT OFF) set(MGE_WITH_JIT_MLIR OFF) #FIXME: fix MegRay on windows - message("-- Disable distributed build on windows host build...") + message(STATUS "Disable distributed build on windows host build...") set(MGE_WITH_DISTRIBUTED OFF) else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") @@ -209,7 +209,7 @@ endif() CHECK_CXX_COMPILER_FLAG(-fuse-ld=gold CXX_SUPPORT_GOLD) if(CXX_SUPPORT_GOLD AND NOT ANDROID AND NOT APPLE AND NOT MSVC AND NOT WIN32) - message("-- Using GNU gold linker.") + message(STATUS "Using GNU gold linker.") set(MGE_COMMON_LINKER_FLAGS "-fuse-ld=gold") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MGE_COMMON_LINKER_FLAGS}") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${MGE_COMMON_LINKER_FLAGS}") @@ -249,12 +249,12 @@ endif() if(NOT MGE_WITH_CUDA) if(NOT MGE_ARCH STREQUAL "x86_64" AND NOT MGE_ARCH STREQUAL "i386") - message("-- Disable JIT support, as the MGE_ARCH is not X86 and CUDA is not enabled.") + message(STATUS "Disable JIT support, as the MGE_ARCH is not X86 and CUDA is not enabled.") set(MGE_WITH_JIT OFF) set(MGE_WITH_JIT_MLIR OFF) endif() set(MGE_WITH_HALIDE OFF) - message("-- Disable TensorRT support, as CUDA is not enabled.") + message(STATUS "Disable TensorRT support, as CUDA is not enabled.") set(MGE_WITH_TRT OFF) endif() @@ -299,14 +299,14 @@ if(MGE_BUILD_IMPERATIVE_RT) endif() if(NOT MGE_WITH_CUDA) - message("-- Disable distributed support, as CUDA is not enabled.") + message(STATUS "Disable distributed support, as CUDA is not enabled.") set(MGE_WITH_DISTRIBUTED OFF) endif() if(MGE_INFERENCE_ONLY) - message("-- Disable distributed support for inference only build.") + message(STATUS "Disable distributed support for inference only build.") set(MGE_WITH_DISTRIBUTED OFF) - message("-- Disable imperative_rt python module for inference only build.") + message(STATUS "Disable imperative_rt python module for inference only build.") set(MGE_BUILD_IMPERATIVE_RT OFF) endif() @@ -394,8 +394,8 @@ if(MGE_WITH_CUDA) if(MGE_WITH_TRT) if(MSVC OR WIN32) list(APPEND MGE_CUDA_LIBS ${TRT_LIBRARY} ${CUDNN_LIBRARY}) - message("-- windows TRT_LIBRARY: ${TRT_LIBRARY}") - message("-- windows CUDNN_LIBRARY: ${CUDNN_LIBRARY}") + message(STATUS "windows TRT_LIBRARY: ${TRT_LIBRARY}") + message(STATUS "windows CUDNN_LIBRARY: ${CUDNN_LIBRARY}") else() list(APPEND MGE_CUDA_LIBS -Wl,--whole-archive libnvinfer libcudnn -Wl,--no-whole-archive) endif() @@ -513,7 +513,7 @@ find_program(CCACHE_BIN ccache) if(CCACHE_BIN) set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_BIN}) if(MGE_WITH_CUDA AND NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") - message("-- Using ccache as CMAKE_CUDA_COMPILER_LAUNCHER") + message(STATUS "Using ccache as CMAKE_CUDA_COMPILER_LAUNCHER") set(CMAKE_CUDA_COMPILER_LAUNCHER ${CCACHE_BIN}) endif() endif() @@ -571,7 +571,7 @@ IF(APPLE) set(CMAKE_USE_WIN32_THREADS_INIT 0) set(CMAKE_USE_PTHREADS_INIT 1) set(THREADS_PREFER_PTHREAD_FLAG ON) - message("-- disable jit, halide and mlir on macos host build...") + message(STATUS "disable jit, halide and mlir on macos host build...") set(MGE_WITH_HALIDE OFF) set(MGE_WITH_JIT OFF) set(MGE_WITH_JIT_MLIR OFF) @@ -648,7 +648,7 @@ endif() # Enable Naive if(MGE_ARCH STREQUAL "naive") set(MEGDNN_NAIVE 1) - message(WARNING "MEGDNN_NAIVE is enabled; MegDNN performance is degraded.") + message(STATUS "MEGDNN_NAIVE is enabled; MegDNN performance is degraded.") endif() if(MGE_ARCH STREQUAL "x86_64" OR MGE_ARCH STREQUAL "i386") @@ -685,7 +685,7 @@ if(MGE_ARCH STREQUAL "aarch64") set(MEGDNN_64_BIT 1) set(MARCH "-march=armv8-a") if(MGE_ARMV8_2_FEATURE_FP16) - message("Enable fp16 feature support in armv8.2") + message(STATUS "Enable fp16 feature support in armv8.2") if(NOT ${MGE_DISABLE_FLOAT16}) set(MEGDNN_ENABLE_FP16_NEON 1) endif() @@ -693,7 +693,7 @@ if(MGE_ARCH STREQUAL "aarch64") endif() if(MGE_ARMV8_2_FEATURE_DOTPROD) - message("Enable dotprod feature support in armv8.2") + message(STATUS "Enable dotprod feature support in armv8.2") if(MGE_ARMV8_2_FEATURE_FP16) set(MARCH "-march=armv8.2-a+fp16+dotprod") else() @@ -786,7 +786,7 @@ endif() if(MGE_BUILD_IMPERATIVE_RT) add_subdirectory(imperative) - message("-- Enable imperative python wrapper runtime") + message(STATUS "Enable imperative python wrapper runtime") endif() if(MGE_WITH_TEST AND MGE_ENABLE_RTTI) @@ -860,7 +860,7 @@ if(MSVC OR WIN32) if(${CompilerFlag} MATCHES "/MD") string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") set(${CompilerFlag} "${${CompilerFlag}}" CACHE STRING "msvc compiler flags" FORCE) - message("MSVC flags: ${CompilerFlag}:${${CompilerFlag}}") + message(VERBOSE "MSVC flags: ${CompilerFlag}:${${CompilerFlag}}") endif() endforeach() endif() diff --git a/cmake/FetchMegBrainVersion.cmake b/cmake/FetchMegBrainVersion.cmake index 2a3f8d41b..b6f0992bc 100644 --- a/cmake/FetchMegBrainVersion.cmake +++ b/cmake/FetchMegBrainVersion.cmake @@ -30,4 +30,4 @@ if (MGB_IS_DEV) set (MGB_VER_STRING "${MGB_VER_STRING}-dev") endif() -message("-- Building MegBrain ${MGB_VER_STRING}") +message(STATUS "Building MegBrain ${MGB_VER_STRING}") diff --git a/cmake/MKL_DNN.cmake b/cmake/MKL_DNN.cmake index a302a62f1..bb85dc3a0 100644 --- a/cmake/MKL_DNN.cmake +++ b/cmake/MKL_DNN.cmake @@ -1,7 +1,7 @@ if (MGE_USE_SYSTEM_LIB) find_package(dnnl) if (dnnl_FOUND) - message("Using system provided MKL-DNN.") + message(STATUS "Using system provided MKL-DNN.") set (MGE_USE_SYSTEM_MKLDNN ON) return() endif() diff --git a/cmake/OpenBLAS.cmake b/cmake/OpenBLAS.cmake index 66c11b9ad..3216522fc 100644 --- a/cmake/OpenBLAS.cmake +++ b/cmake/OpenBLAS.cmake @@ -2,7 +2,7 @@ if (MGE_USE_SYSTEM_LIB) find_package(OpenBLAS) set (MGE_USE_SYSTEM_OPENBLAS ON) - message("Using system provided OpenBLAS ${OpenBLAS_VERSION}") + message(STATUS "Using system provided OpenBLAS ${OpenBLAS_VERSION}") add_library(libopenblas IMPORTED GLOBAL) set_target_properties( libopenblas PROPERTIES diff --git a/cmake/aclrt.cmake b/cmake/aclrt.cmake index 4d5d3fcaf..c25d3e18c 100644 --- a/cmake/aclrt.cmake +++ b/cmake/aclrt.cmake @@ -31,5 +31,5 @@ set_target_properties(libascendcl PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${ACLRT_INCLUDE_DIR} ) -message("-- Found ACLRT: ${__found_aclrt_root}") +message(STATUS "Found ACLRT: ${__found_aclrt_root}") diff --git a/cmake/cndev.cmake b/cmake/cndev.cmake index 7f9a0373b..422912b05 100644 --- a/cmake/cndev.cmake +++ b/cmake/cndev.cmake @@ -44,5 +44,5 @@ set_target_properties(libcndev PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CNDEV_INCLUDE_DIR} ) -message("-- Found CNDEV: ${__found_cndev_root} (found version: ${CNDEV_VERSION_STRING})") +message(STATUS "Found CNDEV: ${__found_cndev_root} (found version: ${CNDEV_VERSION_STRING})") diff --git a/cmake/cnml.cmake b/cmake/cnml.cmake index 60649ceb6..388f1b762 100644 --- a/cmake/cnml.cmake +++ b/cmake/cnml.cmake @@ -40,5 +40,5 @@ set_target_properties(libcnml PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CNML_INCLUDE_DIR} ) -message("-- Found CNML: ${__found_cnml_root} (found version: ${CNML_VERSION_STRING})") +message(STATUS "Found CNML: ${__found_cnml_root} (found version: ${CNML_VERSION_STRING})") diff --git a/cmake/cnrt.cmake b/cmake/cnrt.cmake index 363c07029..4319ef3d2 100644 --- a/cmake/cnrt.cmake +++ b/cmake/cnrt.cmake @@ -40,5 +40,5 @@ set_target_properties(libcnrt PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CNRT_INCLUDE_DIR} ) -message("-- Found CNRT: ${__found_cnrt_root} (found version: ${CNRT_VERSION_STRING})") +message(STATUS "Found CNRT: ${__found_cnrt_root} (found version: ${CNRT_VERSION_STRING})") diff --git a/cmake/cpuinfo.cmake b/cmake/cpuinfo.cmake index a6d9630b7..97647e383 100644 --- a/cmake/cpuinfo.cmake +++ b/cmake/cpuinfo.cmake @@ -1,6 +1,6 @@ if (MGE_USE_SYSTEM_LIB) find_package(Cpuinfo) - message("Using system provided cpuinfo ${cpuinfo_VERSION}") + message(STATUS "Using system provided cpuinfo ${cpuinfo_VERSION}") add_library(libcpuinfo IMPORTED GLOBAL) set_target_properties( libcpuinfo PROPERTIES diff --git a/cmake/cudnn.cmake b/cmake/cudnn.cmake index 6310c95d8..6011e3e92 100644 --- a/cmake/cudnn.cmake +++ b/cmake/cudnn.cmake @@ -63,4 +63,4 @@ set_target_properties(libcudnn PROPERTIES IMPORTED_LOCATION ${CUDNN_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES ${CUDNN_INCLUDE_DIR}) -message("-- Found CuDNN: ${__found_cudnn_root} (found version: ${CUDNN_VERSION})") +message(STATUS "Found CuDNN: ${__found_cudnn_root} (found version: ${CUDNN_VERSION})") diff --git a/cmake/flatbuffers.cmake b/cmake/flatbuffers.cmake index 5005c1ea3..3345c0d50 100644 --- a/cmake/flatbuffers.cmake +++ b/cmake/flatbuffers.cmake @@ -1,11 +1,11 @@ if (MGE_USE_SYSTEM_LIB) find_package(Flatbuffers REQUIRED) - message("Using system provided Flatbuffers ${Flatbuffers_VERSION}") + message(STATUS "Using system provided Flatbuffers ${Flatbuffers_VERSION}") include(cmake/BuildFlatBuffers.cmake) return() endif() if(MSVC OR WIN32) - message("-- add flags flatc for clang-cl build") + message(DEBUG "add flags flatc for clang-cl build") set(FLATC_FLAGS "") set(FLATC_FLAGS "${FLATC_FLAGS} -Wno-error=unknown-argument -Wno-error=c++98-compat -Wno-error=reserved-id-macro") set(FLATC_FLAGS "${FLATC_FLAGS} -Wno-error=sign-conversion -Wno-error=exceptions -Wno-error=argument-outside-range") diff --git a/cmake/mkl.cmake b/cmake/mkl.cmake index 68f1686e5..8a5da79f2 100644 --- a/cmake/mkl.cmake +++ b/cmake/mkl.cmake @@ -13,7 +13,7 @@ find_path(MKL_ROOT_DIR if(${MKL_ROOT_DIR} STREQUAL "MKL_ROOT_DIR-NOTFOUND") message(FATAL_ERROR "Can not find MKL") endif() -message("-- Build with MKL in ${MKL_ROOT_DIR}") +message(STATUS "Build with MKL in ${MKL_ROOT_DIR}") find_path(MKL_INCLUDE_DIR mkl_cblas.h diff --git a/cmake/tensorrt.cmake b/cmake/tensorrt.cmake index 49062cf84..25d21aeab 100644 --- a/cmake/tensorrt.cmake +++ b/cmake/tensorrt.cmake @@ -59,5 +59,5 @@ set_target_properties(libnvinfer PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${TRT_INCLUDE_DIR} ) -message("-- Found TensorRT: ${__found_trt_root} (found version: ${TRT_VERSION_STRING})") +message(STATUS "Found TensorRT: ${__found_trt_root} (found version: ${TRT_VERSION_STRING})") diff --git a/imperative/CMakeLists.txt b/imperative/CMakeLists.txt index 24d788ba4..2a53067a0 100644 --- a/imperative/CMakeLists.txt +++ b/imperative/CMakeLists.txt @@ -56,7 +56,7 @@ if (APPLE) elseif (MSVC OR WIN32) # Windows does not support implicitly importing data members from DLL. target_link_libraries(${MODULE_NAME} PRIVATE megbrain megdnn) - message("-- CMAKE_MSVC_RUNTIME_LIBRARY: ${CMAKE_MSVC_RUNTIME_LIBRARY}") + message(STATUS, "CMAKE_MSVC_RUNTIME_LIBRARY: ${CMAKE_MSVC_RUNTIME_LIBRARY}") set_target_properties(${MODULE_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "${CMAKE_MSVC_RUNTIME_LIBRARY}") else() if (MGE_WITH_PYTHON_MODULE) @@ -67,7 +67,7 @@ else() # elf section on both megengine_export and target which depend on megengine_export target_link_libraries(${MODULE_NAME} PRIVATE megbrain megdnn -Wl,--version-script=${MGE_VERSION_SCRIPT}) if (MGE_WITH_DISTRIBUTED) - message("-- Imperative configured to link megray") + message(VERBOSE "Imperative configured to link megray") target_link_libraries(${MODULE_NAME} PRIVATE megray) endif() endif() @@ -84,7 +84,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${MEGENGINE_DIR}/${PACKAGE_NAME}/core ) if (APPLE OR MSVC OR WIN32) - message("-- overwriting SUFFIX at macos and windows before config by set_target_properties") + message(VERBOSE "overwriting SUFFIX at macos and windows before config by set_target_properties") pybind11_extension(${MODULE_NAME}) endif() add_dependencies(${MODULE_NAME} gen_opr_py _version_ld) diff --git a/imperative/python/megengine/version.py b/imperative/python/megengine/version.py index 83389417c..e4ce488fb 100644 --- a/imperative/python/megengine/version.py +++ b/imperative/python/megengine/version.py @@ -6,5 +6,5 @@ # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -__version__ = "1.0.0" +__version__ = "0.8.0" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a6000392f..a804f99a7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -186,11 +186,11 @@ set (_VER_FILE ${PROJECT_SOURCE_DIR}/src/version.ld) if(MGE_BUILD_IMPERATIVE_RT ) - message("-- create a export SHARED lib for python use") + message(VERBOSE "create a export SHARED lib for python use") add_library(megengine_export SHARED) target_link_libraries(megengine_export PUBLIC megbrain megdnn) if (MGE_WITH_DISTRIBUTED) - message("-- megengine_export configured to link megray") + message(VERBOSE "megengine_export configured to link megray") target_link_libraries(megengine_export PUBLIC megray) endif() endif() -- GitLab