Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ set(CMAKE_CXX_EXTENSIONS ON) # GNU extensions used by src/operator/random/shuff
# some compilers claim they support c++17 without actually implementing crucial
# parts of the standard leading to hard to understand compilation errors.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
message(FATAL_ERROR "MXNet 2 requires a C++17 compatible compiler. Please update to GCC version 7 or newer.")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
message(FATAL_ERROR "MXNet 2 requires a C++17 compatible compiler. Please update to Clang version 6 or newer.")
endif()
endif()
Expand Down Expand Up @@ -116,7 +116,7 @@ if(USE_CUDA)
cmake_minimum_required(VERSION 3.13.2) # CUDA 10 (Turing) detection available starting 3.13.2
include(CheckLanguage)
check_language(CUDA)
if (NOT CMAKE_CUDA_COMPILER AND UNIX AND EXISTS "/usr/local/cuda/bin/nvcc")
if(NOT CMAKE_CUDA_COMPILER AND UNIX AND EXISTS "/usr/local/cuda/bin/nvcc")
set(ENV{CUDACXX} "/usr/local/cuda/bin/nvcc")
message(WARNING "CMAKE_CUDA_COMPILER guessed: " $ENV{CUDACXX} "\n"
"Please fix your cuda installation: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#mandatory-post")
Expand Down Expand Up @@ -562,7 +562,7 @@ if(USE_OPERATOR_TUNING AND USE_OPENMP)
add_definitions(-DMXNET_USE_OPERATOR_TUNING=1)
endif()

if (NOT (EXTRA_OPERATORS STREQUAL ""))
if(NOT (EXTRA_OPERATORS STREQUAL ""))
mxnet_source_group("Extra" GLOB_RECURSE "${EXTRA_OPERATORS}/*.cc")
mxnet_source_group("Extra\\Cuda" GLOB_RECURSE "${EXTRA_OPERATORS}/*.cu")
FILE(GLOB_RECURSE EXTRA_SRC "${EXTRA_OPERATORS}/*.cc")
Expand Down Expand Up @@ -818,7 +818,7 @@ if(USE_CUDA)
target_include_directories(customop_gpu_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet ${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_custom_op)
endif()
if(UNIX)
if (USE_CUDA)
if(USE_CUDA)
target_compile_options(customop_gpu_lib PUBLIC -shared)
endif()
elseif(MSVC)
Expand Down Expand Up @@ -948,11 +948,11 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/dmlc-core/include/ DESTIN
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/mshadow/mshadow/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mshadow)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mxnet)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/tvm/nnvm/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
if (INSTALL_EXAMPLES)
if(INSTALL_EXAMPLES)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/example DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
endif()

if (USE_SIGNAL_HANDLER)
if(USE_SIGNAL_HANDLER)
add_definitions(-DMXNET_USE_SIGNAL_HANDLER=1)
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ endfunction()

function(assign_source_group group)
foreach(_source IN ITEMS ${ARGN})
if (IS_ABSOLUTE "${_source}")
if(IS_ABSOLUTE "${_source}")
file(RELATIVE_PATH _source_rel "${CMAKE_CURRENT_SOURCE_DIR}" "${_source}")
else()
set(_source_rel "${_source}")
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if(GTEST_FOUND AND NOT MSVC)
include_directories(${GTEST_INCLUDE_DIR})
include_directories(cpp/include)

if (NOT PRIVATE_RUNTIME_DIR)
if(NOT PRIVATE_RUNTIME_DIR)
set(PRIVATE_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()

Expand Down