diff --git a/CMakeLists.txt b/CMakeLists.txt index a321f64b3acd..4bc4d1823fa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,7 +202,7 @@ else(MSVC) set(TVM_VISIBILITY_FLAG "-fvisibility=hidden") endif(HIDE_PRIVATE_SYMBOLS) endif () - if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) set(CMAKE_CXX_FLAGS "-faligned-new ${CMAKE_CXX_FLAGS}") endif() @@ -505,13 +505,13 @@ include(cmake/modules/RustExt.cmake) include(CheckCXXCompilerFlag) if(NOT MSVC) - check_cxx_compiler_flag("-std=c++14" SUPPORT_CXX14) - set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}") - set(CMAKE_CUDA_STANDARD 14) + check_cxx_compiler_flag("-std=c++17" SUPPORT_CXX17) + set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}") + set(CMAKE_CUDA_STANDARD 17) else() - check_cxx_compiler_flag("/std:c++14" SUPPORT_CXX14) - set(CMAKE_CXX_FLAGS "/std:c++14 ${CMAKE_CXX_FLAGS}") - set(CMAKE_CUDA_STANDARD 14) + check_cxx_compiler_flag("/std:c++17" SUPPORT_CXX17) + set(CMAKE_CXX_FLAGS "/std:c++17 ${CMAKE_CXX_FLAGS}") + set(CMAKE_CUDA_STANDARD 17) endif() set(LIBINFO_FILE ${CMAKE_CURRENT_LIST_DIR}/src/support/libinfo.cc) diff --git a/apps/android_camera/app/src/main/jni/Application.mk b/apps/android_camera/app/src/main/jni/Application.mk index 6ac3271f49ac..83b7b4417b9e 100644 --- a/apps/android_camera/app/src/main/jni/Application.mk +++ b/apps/android_camera/app/src/main/jni/Application.mk @@ -31,7 +31,7 @@ include $(config) APP_ABI ?= all APP_STL := c++_shared -APP_CPPFLAGS += -DTVM_LOG_STACK_TRACE=0 -DTVM4J_ANDROID=1 -std=c++14 -Oz -frtti +APP_CPPFLAGS += -DTVM_LOG_STACK_TRACE=0 -DTVM4J_ANDROID=1 -std=c++17 -Oz -frtti ifeq ($(USE_OPENCL), 1) APP_CPPFLAGS += -DTVM_OPENCL_RUNTIME=1 endif diff --git a/apps/android_deploy/app/src/main/jni/Application.mk b/apps/android_deploy/app/src/main/jni/Application.mk index 220c6af3bc7e..4a83907ff329 100644 --- a/apps/android_deploy/app/src/main/jni/Application.mk +++ b/apps/android_deploy/app/src/main/jni/Application.mk @@ -27,7 +27,7 @@ include $(config) APP_STL := c++_static -APP_CPPFLAGS += -DTVM_LOG_STACK_TRACE=0 -DTVM4J_ANDROID=1 -std=c++14 -Oz -frtti +APP_CPPFLAGS += -DTVM_LOG_STACK_TRACE=0 -DTVM4J_ANDROID=1 -std=c++17 -Oz -frtti ifeq ($(USE_OPENCL), 1) APP_CPPFLAGS += -DTVM_OPENCL_RUNTIME=1 endif diff --git a/apps/android_rpc/app/src/main/jni/Application.mk b/apps/android_rpc/app/src/main/jni/Application.mk index e3078906ff55..df560863f091 100644 --- a/apps/android_rpc/app/src/main/jni/Application.mk +++ b/apps/android_rpc/app/src/main/jni/Application.mk @@ -31,7 +31,7 @@ include $(config) APP_ABI ?= armeabi-v7a arm64-v8a x86 x86_64 mips APP_STL := c++_shared -APP_CPPFLAGS += -DTVM_LOG_STACK_TRACE=0 -DTVM4J_ANDROID=1 -std=c++14 -Oz -frtti +APP_CPPFLAGS += -DTVM_LOG_STACK_TRACE=0 -DTVM4J_ANDROID=1 -std=c++17 -Oz -frtti ifeq ($(USE_OPENCL), 1) APP_CPPFLAGS += -DTVM_OPENCL_RUNTIME=1 endif diff --git a/apps/bundle_deploy/Makefile b/apps/bundle_deploy/Makefile index b533030c4b82..2d4d7c42feea 100644 --- a/apps/bundle_deploy/Makefile +++ b/apps/bundle_deploy/Makefile @@ -28,7 +28,7 @@ ENABLE_TVM_PLATFORM_ABORT_BACKTRACE ?= 1 DMLC_CORE=${TVM_ROOT}/3rdparty/dmlc-core PKG_COMPILE_OPTS = -g -Wall -O2 -fPIC -PKG_CXXFLAGS = ${PKG_COMPILE_OPTS} -std=c++14 \ +PKG_CXXFLAGS = ${PKG_COMPILE_OPTS} -std=c++17 \ -I${TVM_ROOT}/include \ -I${DMLC_CORE}/include \ -I${TVM_ROOT}/3rdparty/dlpack/include \ diff --git a/apps/dso_plugin_module/Makefile b/apps/dso_plugin_module/Makefile index 438d9db223a8..6b4575032d7d 100644 --- a/apps/dso_plugin_module/Makefile +++ b/apps/dso_plugin_module/Makefile @@ -16,7 +16,7 @@ # under the License. TVM_ROOT=$(shell cd ../..; pwd) -PKG_CFLAGS = -std=c++14 -O2 -fPIC\ +PKG_CFLAGS = -std=c++17 -O2 -fPIC\ -I${TVM_ROOT}/include\ -I${TVM_ROOT}/3rdparty/dmlc-core/include\ -I${TVM_ROOT}/3rdparty/dlpack/include\ diff --git a/apps/extension/Makefile b/apps/extension/Makefile index 6eba941f7c98..c8eca4a93e06 100644 --- a/apps/extension/Makefile +++ b/apps/extension/Makefile @@ -17,7 +17,7 @@ # Minimum Makefile for the extension package TVM_ROOT=$(shell cd ../..; pwd) -PKG_CFLAGS = -std=c++14 -O2 -fPIC\ +PKG_CFLAGS = -std=c++17 -O2 -fPIC\ -I${TVM_ROOT}/include\ -I${TVM_ROOT}/3rdparty/dmlc-core/include\ -I${TVM_ROOT}/3rdparty/dlpack/include\ diff --git a/apps/howto_deploy/Makefile b/apps/howto_deploy/Makefile index 9741d58af434..a2f33314e1ea 100644 --- a/apps/howto_deploy/Makefile +++ b/apps/howto_deploy/Makefile @@ -19,7 +19,7 @@ TVM_ROOT=$(shell cd ../..; pwd) DMLC_CORE=${TVM_ROOT}/3rdparty/dmlc-core -PKG_CFLAGS = -std=c++14 -O2 -fPIC\ +PKG_CFLAGS = -std=c++17 -O2 -fPIC\ -I${TVM_ROOT}/include\ -I${DMLC_CORE}/include\ -I${TVM_ROOT}/3rdparty/dlpack/include\ diff --git a/apps/howto_deploy/tvm_runtime_pack.cc b/apps/howto_deploy/tvm_runtime_pack.cc index a2e30c6b0933..0ee61a7e50e4 100644 --- a/apps/howto_deploy/tvm_runtime_pack.cc +++ b/apps/howto_deploy/tvm_runtime_pack.cc @@ -24,7 +24,7 @@ * include in your project. * * - Copy this file into your project which depends on tvm runtime. - * - Compile with -std=c++14 + * - Compile with -std=c++17 * - Add the following include path * - /path/to/tvm/include/ * - /path/to/tvm/3rdparty/dmlc-core/include/ diff --git a/apps/rocm_rpc/Makefile b/apps/rocm_rpc/Makefile index 971ca4603314..00de002eb4ee 100644 --- a/apps/rocm_rpc/Makefile +++ b/apps/rocm_rpc/Makefile @@ -21,7 +21,7 @@ ROCM_PATH=/opt/rocm TVM_ROOT=$(shell cd ../..; pwd) DMLC_CORE=${TVM_ROOT}/3rdparty/dmlc-core -PKG_CFLAGS = -std=c++14 -O2 -fPIC\ +PKG_CFLAGS = -std=c++17 -O2 -fPIC\ -I${TVM_ROOT}/include\ -I${DMLC_CORE}/include\ -I${TVM_ROOT}/3rdparty/dlpack/include\ diff --git a/apps/tf_tvmdsoop/CMakeLists.txt b/apps/tf_tvmdsoop/CMakeLists.txt index 9be5da9d26de..9f123153839e 100644 --- a/apps/tf_tvmdsoop/CMakeLists.txt +++ b/apps/tf_tvmdsoop/CMakeLists.txt @@ -17,7 +17,7 @@ cmake_minimum_required(VERSION 3.2) project(tf_tvmdsoop C CXX) -set(TFTVM_COMPILE_FLAGS -std=c++14) +set(TFTVM_COMPILE_FLAGS -std=c++17) set(BUILD_TVMDSOOP_ONLY ON) set(CMAKE_CURRENT_SOURCE_DIR ${TVM_ROOT}) set(CMAKE_CURRENT_BINARY_DIR ${TVM_ROOT}/build) diff --git a/conda/build-environment.yaml b/conda/build-environment.yaml index 7c7831e25b1b..9581ddf1ea6b 100644 --- a/conda/build-environment.yaml +++ b/conda/build-environment.yaml @@ -27,7 +27,7 @@ channels: dependencies: - conda-build - git - - llvmdev ==10.0.0 + - llvmdev >=11 - numpy - pytest - cython diff --git a/conda/recipe/build.sh b/conda/recipe/build.sh index 242d6a28b3d3..bfae99f77944 100755 --- a/conda/recipe/build.sh +++ b/conda/recipe/build.sh @@ -21,10 +21,12 @@ set -u GPU_OPT="" TOOLCHAIN_OPT="" +MACOS_OPT="" if [ "$target_platform" == "osx-64" ]; then # macOS 64 bits GPU_OPT="-DUSE_METAL=ON" + MACOS_OPT="-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12" elif [ "$target_platform" == "linux-64" ]; then TOOLCHAIN_OPT="-DCMAKE_TOOLCHAIN_FILE=${RECIPE_DIR}/cross-linux.cmake" fi @@ -53,8 +55,8 @@ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DUSE_LLVM=ON \ -DINSTALL_DEV=ON \ -DUSE_LIBBACKTRACE=AUTO \ - ${GPU_OPT} ${TOOLCHAIN_OPT} \ + ${GPU_OPT} ${TOOLCHAIN_OPT} ${MACOS_OPT} \ ${SRC_DIR} -make -j${CPU_COUNT} +make -j${CPU_COUNT} VERBOSE=1 cd .. diff --git a/conda/recipe/meta.yaml b/conda/recipe/meta.yaml index ccdacdcc45d9..22a512493478 100644 --- a/conda/recipe/meta.yaml +++ b/conda/recipe/meta.yaml @@ -44,7 +44,7 @@ requirements: - make # [not win] host: - zlib - - llvmdev ==10.0.0 + - llvmdev >=11 outputs: - name: {{ pkg_name }}-libs @@ -59,11 +59,11 @@ outputs: - make # [not win] host: - zlib - - llvmdev ==10.0.0 + - llvmdev >=11 - {{ pin_compatible('cudatoolkit', lower_bound=cuda_version, max_pin='x.x') }} # [cuda] - cudnn >=7.6.0 # [cuda] run: - - llvmdev ==10.0.0 + - llvmdev >=11 - {{ pin_compatible('cudatoolkit', lower_bound=cuda_version, max_pin='x.x') }} # [cuda] - cudnn >=7.6.0 # [cuda] diff --git a/golang/Makefile b/golang/Makefile index 181ecdf368b8..76ac371b628d 100644 --- a/golang/Makefile +++ b/golang/Makefile @@ -25,7 +25,7 @@ NATIVE_SRC = tvm_runtime_pack.cc GOPATH=$(CURDIR)/gopath GOPATHDIR=${GOPATH}/src/${TARGET}/ CGO_CPPFLAGS="-I. -I${TVM_BASE}/ -I${TVM_BASE}/3rdparty/dmlc-core/include -I${TVM_BASE}/include -I${TVM_BASE}/3rdparty/dlpack/include/" -CGO_CXXFLAGS="-std=c++14 -DDMLC_USE_LOGGING_LIBRARY= -DTVM_USE_LIBBACKTRACE=0" +CGO_CXXFLAGS="-std=c++17 -DDMLC_USE_LOGGING_LIBRARY= -DTVM_USE_LIBBACKTRACE=0" CGO_CFLAGS="-I${TVM_BASE}" CGO_LDFLAGS="-ldl -lm" diff --git a/python/setup.py b/python/setup.py index a7ba115e0a76..a75888c83614 100644 --- a/python/setup.py +++ b/python/setup.py @@ -118,7 +118,7 @@ def config_cython(): subdir = "_cy2" ret = [] path = "tvm/_ffi/_cython" - extra_compile_args = ["-std=c++14", "-DDMLC_USE_LOGGING_LIBRARY="] + extra_compile_args = ["-std=c++17", "-DDMLC_USE_LOGGING_LIBRARY="] if os.name == "nt": library_dirs = ["tvm", "../build/Release", "../build"] libraries = ["tvm"]