Require CMake 3.8 to build VTK-m.

This commit is contained in:
Robert Maynard 2019-01-09 10:04:34 -05:00
parent 9bfe670e1c
commit f1e1a524e9
33 changed files with 81 additions and 96 deletions

@ -78,9 +78,9 @@ if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(TARGETS vtkm_vectorization_flags EXPORT ${VTKm_EXPORT_NAME})
endif()
# If we are using MSVC stop after the interface so that the interface is
# consistently defined even for compilers such as MSVC that we don't
# have vectorization flag support for yet.
# We currently don't know the vectorization flags for MSVC. But we want
# the vtkm_vectorization_flags target to exist so we have a consistent
# interface.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
return()
endif()

@ -25,8 +25,6 @@
## cmake -DVTKm_SOURCE_DIR=<VTKm_SOURCE_DIR> -P <VTKm_SOURCE_DIR>/CMake/VTKMCheckCopyright.cmake
##
cmake_minimum_required(VERSION 2.8)
set(FILES_TO_CHECK
*.txt
*.cmake

@ -27,8 +27,6 @@
## cmake -DVTKm_SOURCE_DIR=<VTKm_SOURCE_DIR> -P <VTKm_SOURCE_DIR>/CMake/VTKMCheckSourceInBuild.cmake
##
cmake_minimum_required(VERSION 2.8)
set(FILES_TO_CHECK
*.h
*.h.in

@ -58,11 +58,7 @@ target_link_libraries(vtkm_compiler_flags
INTERFACE $<BUILD_INTERFACE:vtkm_vectorization_flags>)
# setup that we need C++11 support
if(CMAKE_VERSION VERSION_LESS 3.8)
target_compile_features(vtkm_compiler_flags INTERFACE cxx_nullptr)
else()
target_compile_features(vtkm_compiler_flags INTERFACE cxx_std_11)
endif()
target_compile_features(vtkm_compiler_flags INTERFACE cxx_std_11)
# Enable large object support so we can have 2^32 addressable sections
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
@ -123,8 +119,9 @@ elseif(VTKM_COMPILER_IS_ICC)
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-wd1478 -wd13379>)
elseif(VTKM_COMPILER_IS_GNU OR VTKM_COMPILER_IS_CLANG)
set(cxx_flags -Wall -Wno-long-long -Wcast-align -Wconversion -Wchar-subscripts -Wextra -Wpointer-arith -Wformat -Wformat-security -Wshadow -Wunused-parameter -fno-common)
set(cuda_flags -Xcompiler=-Wall,-Wno-unknown-pragmas,-Wno-unused-local-typedefs,-Wno-unused-local-typedefs,-Wno-unused-function,-Wno-long-long,-Wcast-align,-Wconversion,-Wchar-subscripts,-Wpointer-arith,-Wformat,-Wformat-security,-Wshadow,-Wunused-parameter,-fno-common)
set(cxx_flags -Wall -Wcast-align -Wconversion -Wchar-subscripts -Wextra -Wpointer-arith -Wformat -Wformat-security -Wshadow -Wunused-parameter -fno-common)
set(cuda_flags -Xcompiler=-Wall,-Wno-unknown-pragmas,-Wno-unused-local-typedefs,-Wno-unused-local-typedefs,-Wno-unused-function,-Wcast-align,-Wconversion,-Wchar-subscripts,-Wpointer-arith,-Wformat,-Wformat-security,-Wshadow,-Wunused-parameter,-fno-common)
#GCC 5, 6 don't properly handle strict-overflow suppression through pragma's.
#Instead of suppressing around the location of the strict-overflow you
@ -152,7 +149,7 @@ if(TARGET vtkm::cuda)
endif()
set(display_error_nums -Xcudafe=--display_error_number)
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:${suppress_nvlink_stack_size_warnings} ${display_error_nums}>)
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:${display_error_nums}>)
endif()
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)

@ -53,8 +53,8 @@
#
#
if (CMAKE_VERSION VERSION_LESS "3.3")
message(FATAL_ERROR "VTK-m requires CMake 3.3+")
if (CMAKE_VERSION VERSION_LESS "3.8")
message(FATAL_ERROR "VTK-m requires CMake 3.8+")
endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio" AND
CMAKE_VERSION VERSION_LESS "3.11")

@ -96,7 +96,7 @@ endif()
if(VTKm_ENABLE_OPENMP AND NOT TARGET vtkm::openmp)
cmake_minimum_required(VERSION 3.9...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9...3.13 FATAL_ERROR)
find_package(OpenMP 4.0 REQUIRED COMPONENTS CXX QUIET)
add_library(vtkm::openmp INTERFACE IMPORTED GLOBAL)
@ -117,7 +117,7 @@ if(VTKm_ENABLE_OPENMP AND NOT TARGET vtkm::openmp)
endif()
if(VTKm_ENABLE_CUDA AND NOT TARGET vtkm::cuda)
cmake_minimum_required(VERSION 3.9...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9...3.13 FATAL_ERROR)
enable_language(CUDA)
#To work around https://gitlab.kitware.com/cmake/cmake/issues/17512

@ -94,10 +94,7 @@ if(VTKm_ENABLE_GL_CONTEXT OR
endif()
#-----------------------------------------------------------------------------
if(VTKm_ENABLE_RENDERING)
if(TARGET vtkm_rendering_gl_context)
return()
endif()
if(VTKm_ENABLE_RENDERING AND NOT TARGET vtkm_rendering_gl_context)
add_library(vtkm_rendering_gl_context INTERFACE)
endif()

@ -60,6 +60,11 @@ function(vtkm_pyexpander_generated_file generated_file_name)
endfunction(vtkm_pyexpander_generated_file)
#-----------------------------------------------------------------------------
# This function is not needed by the core infrastructure of VTK-m
# as we now require CMake 3.11 on windows, and for tests we compile a single
# executable for all backends, instead of compiling for each backend.
# It is currently kept around so that examples which haven't been updated
# continue to work
function(vtkm_compile_as_cuda output)
# We can't use set_source_files_properties(<> PROPERTIES LANGUAGE "CUDA")
# for the following reasons:
@ -302,12 +307,9 @@ function(vtkm_library)
if(TARGET vtkm::cuda)
vtkm_compile_as_cuda(cu_srcs ${VTKm_LIB_WRAP_FOR_CUDA})
set(VTKm_LIB_WRAP_FOR_CUDA ${cu_srcs})
set_source_files_properties(${VTKm_LIB_WRAP_FOR_CUDA} PROPERTIES LANGUAGE "CUDA")
endif()
add_library(${lib_name}
${VTKm_LIB_type}
${VTKm_LIB_SOURCES}
@ -468,9 +470,8 @@ function(vtkm_unit_tests)
#cuda. This is so that we get the correctly named entry points generated
create_test_sourcelist(test_sources ${test_prog}.cxx ${VTKm_UT_SOURCES} ${extraArgs})
#if all backends are enabled, we can use cuda compiler to handle all possible backends.
if(backend STREQUAL "Cuda" OR (enable_all_backends AND VTKm_ENABLE_CUDA))
vtkm_compile_as_cuda(cu_srcs ${VTKm_UT_SOURCES})
set(VTKm_UT_SOURCES ${cu_srcs})
if(TARGET vtkm::cuda AND (backend STREQUAL "Cuda" OR enable_all_backends))
set_source_files_properties(${VTKm_UT_SOURCES} PROPERTIES LANGUAGE "CUDA")
endif()
add_executable(${test_prog} ${test_prog}.cxx ${VTKm_UT_SOURCES})

@ -18,18 +18,14 @@
## this software.
##============================================================================
# We require CMake 3.3 for Modern CMake which as features such as:
# - Support for target_sources
# - Support for usage requirements
#
# If you want CUDA support, you will need to have CMake 3.9 on Linux/OSX.
# We require CMake 3.11 with the MSVC generator as the $<COMPILE_LANGUAGE:>
# generator expression is not supported on older versions.
cmake_minimum_required(VERSION 3.3...3.12)
cmake_minimum_required(VERSION 3.8...3.13)
project (VTKm)
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
cmake_minimum_required(VERSION 3.11...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.11...3.13 FATAL_ERROR)
endif()
# Update module path
@ -84,6 +80,7 @@ set(VTKm_BINARY_INCLUDE_DIR "${VTKm_BINARY_DIR}/include")
#-----------------------------------------------------------------------------
# vtkm_option(variable doc [initial])
# Provides an option if it is not already defined.
# This can be replaced when CMake 3.13 is our cmake_minimum_required
macro (vtkm_option variable)
if (NOT DEFINED "${variable}")
option("${variable}" ${ARGN})

@ -63,7 +63,7 @@ VTK-m Requires:
+ XCode 5.0+
+ MSVC 2015+
+ [CMake](http://www.cmake.org/download/)
+ CMake 3.3+ (for any build)
+ CMake 3.8+ (for any build)
+ CMake 3.9+ (for CUDA build or OpenMP build)
+ CMake 3.11+ (for Visual Studio generator)
@ -103,7 +103,7 @@ VTK-m has been tested on the following configurations:
+ TBB 4.4 U2, 2017 U7
+ On Windows
+ Visual Studio 2015, 2017
+ CMake 3.3, 3.11.1
+ CMake 3.8, 3.12.4
+ CUDA 10.0.130
+ TBB 2017 U3, 2018 U2
+ On MacOS

@ -1209,7 +1209,7 @@ So a project that wants to build an executable that uses vtk-m would look like:
```cmake
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(HellowWorld CXX)
#Find the VTK-m package.

@ -0,0 +1,10 @@
# CMake 3.8 Required to build VTK-m
While VTK-m has always required a fairly recent version
of CMake when building for Visual Studio, or if OpenMP or
CUDA are enabled, it has supported building with the TBB
device with CMake 3.3.
Given the fact that our primary consumer (VTK) has moved
to require CMake 3.8, it doesn't make sense to require
CMake 3.3 and we have moved to a minimum of 3.8.

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(Clipping CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(ContourTree CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(CosmoTools CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(VTKmDemo CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(GameOfLife CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(HelloWorld CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(Histogram CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(IsoSurface CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(MultiBackend CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(Oscillator CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(ParticleAdvection CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(RedistributePoints CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(RenderingExample CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(Streamline CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(TauTiming CXX)
#Find the VTK-m package

@ -21,7 +21,7 @@
##=============================================================================
#Find the VTK-m package
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(TemporalAdvection CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(Tetrahedra CXX)
#Find the VTK-m package

@ -19,7 +19,7 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.13 FATAL_ERROR)
project(UnifiedMemory CXX)
#Find the VTK-m package

@ -36,20 +36,18 @@ set(headers
vtkm_declare_headers(CUDA ${headers} TESTABLE ${VTKm_ENABLE_CUDA})
if (NOT VTKm_ENABLE_CUDA)
#build the file with cpp compiler if cuda is disabled
if (TARGET vtkm::cuda)
target_sources(vtkm_cont PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/ArrayManagerExecutionCuda.cu
${CMAKE_CURRENT_SOURCE_DIR}/CudaAllocator.cu
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterAlgorithmCuda.cu
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterRuntimeDetectorCuda.cu
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterTimerImplementationCuda.cu
${CMAKE_CURRENT_SOURCE_DIR}/ExecutionArrayInterfaceBasicCuda.cu
)
else()
#build the file with cpp compiler if cuda is disabled
target_sources(vtkm_cont PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterRuntimeDetectorCuda.cxx
)
return()
endif()
target_sources(vtkm_cont PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/ArrayManagerExecutionCuda.cu
${CMAKE_CURRENT_SOURCE_DIR}/CudaAllocator.cu
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterAlgorithmCuda.cu
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterRuntimeDetectorCuda.cu
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterTimerImplementationCuda.cu
${CMAKE_CURRENT_SOURCE_DIR}/ExecutionArrayInterfaceBasicCuda.cu
)

@ -34,18 +34,17 @@ set(headers
vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_OPENMP})
#These sources need to always be built
target_sources(vtkm_cont PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterRuntimeDetectorOpenMP.cxx
)
#-----------------------------------------------------------------------------
if (NOT VTKm_ENABLE_OPENMP)
return()
if (TARGET vtkm::openmp)
target_sources(vtkm_cont PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/ArrayManagerExecutionOpenMP.cxx
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterAlgorithmOpenMP.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ExecutionArrayInterfaceBasicOpenMP.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ParallelRadixSortOpenMP.cxx
)
endif()
target_sources(vtkm_cont PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/ArrayManagerExecutionOpenMP.cxx
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterAlgorithmOpenMP.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ExecutionArrayInterfaceBasicOpenMP.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ParallelRadixSortOpenMP.cxx
)

@ -29,14 +29,6 @@ set(headers
VirtualObjectTransferTBB.h
)
if (VTKm_ENABLE_TBB)
if("${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}" VERSION_LESS 4.3)
if("${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}" VERSION_LESS 4.0)
# MESSAGE(FATAL_ERROR "VTK-m not tested with TBB before version 4.0. Please upgrade your TBB library.")
endif()
endif()
endif()
vtkm_declare_headers(ParallelSortTBB.hxx
parallel_sort.h
TESTABLE OFF)
@ -49,13 +41,11 @@ target_sources(vtkm_cont PRIVATE
)
#-----------------------------------------------------------------------------
if (NOT VTKm_ENABLE_TBB)
return()
if (TARGET vtkm::tbb)
target_sources(vtkm_cont PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/ArrayManagerExecutionTBB.cxx
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterAlgorithmTBB.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ExecutionArrayInterfaceBasicTBB.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ParallelSortTBB.cxx
)
endif()
target_sources(vtkm_cont PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/ArrayManagerExecutionTBB.cxx
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterAlgorithmTBB.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ExecutionArrayInterfaceBasicTBB.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ParallelSortTBB.cxx
)