From e5cde2cf95201a6fccf4f6cf046879fc10c7db46 Mon Sep 17 00:00:00 2001 From: Radu Serban Date: Wed, 10 Feb 2021 11:25:13 +0100 Subject: [PATCH 1/8] Fix issues related to building Chrono::Multicore when CUDA is not available --- src/CMakeLists.txt | 8 ++++++++ src/chrono/ChConfig.h.in | 9 +++++++++ src/chrono_multicore/ChConfigMulticore.h.in | 5 +++++ src/chrono_multicore/ChMulticoreDefines.h | 7 ++++--- src/chrono_multicore/physics/ChFluidContainer.cpp | 4 ++++ src/chrono_multicore/physics/ChParticleContainer.cpp | 4 ++++ .../solver/ChIterativeSolverMulticoreSMC.cpp | 3 ++- .../solver/ChSystemDescriptorMulticore.h | 2 -- 8 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a6f1785d11..5ca6844758 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -689,6 +689,14 @@ else() set(CHRONO_TBB_ENABLED "#undef CHRONO_TBB_ENABLED") endif() +if(CUDA_FOUND) + set(CHRONO_CUDA_FOUND "#define CHRONO_CUDA_FOUND") + set(CHRONO_CUDA_VERSION "#define CHRONO_CUDA_VERSION \"${CUDA_VERSION_STRING}\"") +else() + set(CHRONO_CUDA_FOUND "#undef CHRONO_CUDA_FOUND") + set(CHRONO_CUDA_VERSION "#undef CHRONO_CUDA_VERSION") +endif() + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/chrono/ChConfig.h.in" "${PROJECT_BINARY_DIR}/chrono/ChConfig.h" @ONLY) diff --git a/src/chrono/ChConfig.h.in b/src/chrono/ChConfig.h.in index d8fc92b15f..fe0f030a89 100644 --- a/src/chrono/ChConfig.h.in +++ b/src/chrono/ChConfig.h.in @@ -157,6 +157,15 @@ @CHRONO_HAS_HDF5@ +// ----------------------------------------------------------------------------- +// CUDA settings +// ----------------------------------------------------------------------------- + +// If CUDA is available, define CHRONO_CUDA_FOUND and CHRONO_CUDA_VERSION + +@CHRONO_CUDA_FOUND@ +@CHRONO_CUDA_VERSION@ + // ----------------------------------------------------------------------------- // If Google Test and Benchmark are enabled and available, then diff --git a/src/chrono_multicore/ChConfigMulticore.h.in b/src/chrono_multicore/ChConfigMulticore.h.in index 370cb71ed4..0f52310d3c 100644 --- a/src/chrono_multicore/ChConfigMulticore.h.in +++ b/src/chrono_multicore/ChConfigMulticore.h.in @@ -36,4 +36,9 @@ // #define CHRONO_MULTICORE_USE_CUDA @CHRONO_MULTICORE_USE_CUDA@ +// If CUDA is not available, force Thrust to always use the OMP backend +#ifndef CHRONO_CUDA_FOUND + #define THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_OMP +#endif + #endif diff --git a/src/chrono_multicore/ChMulticoreDefines.h b/src/chrono_multicore/ChMulticoreDefines.h index 6556c0b122..b593c81ea2 100644 --- a/src/chrono_multicore/ChMulticoreDefines.h +++ b/src/chrono_multicore/ChMulticoreDefines.h @@ -23,6 +23,10 @@ #include +// Include the ChConfigMulticore header *before* any Thrust headers! +#include "chrono_multicore/ChApiMulticore.h" +#include "chrono_multicore/ChConfigMulticore.h" + #include #include #include @@ -40,9 +44,6 @@ #include #endif -#include "chrono_multicore/ChApiMulticore.h" -#include "chrono_multicore/ChConfigMulticore.h" - typedef int shape_type; #ifdef __CDT_PARSER__ diff --git a/src/chrono_multicore/physics/ChFluidContainer.cpp b/src/chrono_multicore/physics/ChFluidContainer.cpp index 81865d63ee..882277bb01 100644 --- a/src/chrono_multicore/physics/ChFluidContainer.cpp +++ b/src/chrono_multicore/physics/ChFluidContainer.cpp @@ -31,6 +31,10 @@ #include "chrono_multicore/math/real4.h" // for quaternion, real4 #include "chrono_multicore/math/matrix.h" // for quaternion, real4 +#ifdef CHRONO_MULTICORE_USE_CUDA +#include "chrono_multicore/physics/ChMPM.cuh" +#endif + namespace chrono { using namespace collision; diff --git a/src/chrono_multicore/physics/ChParticleContainer.cpp b/src/chrono_multicore/physics/ChParticleContainer.cpp index 97d831bb0e..bdbc5f9c52 100644 --- a/src/chrono_multicore/physics/ChParticleContainer.cpp +++ b/src/chrono_multicore/physics/ChParticleContainer.cpp @@ -28,6 +28,10 @@ #include "chrono_multicore/math/real4.h" // for quaternion, real4 #include "chrono_multicore/math/matrix.h" // for quaternion, real4 +#ifdef CHRONO_MULTICORE_USE_CUDA +#include "chrono_multicore/physics/ChMPM.cuh" +#endif + namespace chrono { using namespace collision; diff --git a/src/chrono_multicore/solver/ChIterativeSolverMulticoreSMC.cpp b/src/chrono_multicore/solver/ChIterativeSolverMulticoreSMC.cpp index a221d9728c..72c3fcada4 100644 --- a/src/chrono_multicore/solver/ChIterativeSolverMulticoreSMC.cpp +++ b/src/chrono_multicore/solver/ChIterativeSolverMulticoreSMC.cpp @@ -30,12 +30,13 @@ #include #include -#include #include "chrono/physics/ChSystemSMC.h" #include "chrono/physics/ChMaterialSurfaceSMC.h" #include "chrono_multicore/solver/ChIterativeSolverMulticore.h" +#include + #if defined _WIN32 #include #endif diff --git a/src/chrono_multicore/solver/ChSystemDescriptorMulticore.h b/src/chrono_multicore/solver/ChSystemDescriptorMulticore.h index 5bb4421fc8..7b2e11e771 100644 --- a/src/chrono_multicore/solver/ChSystemDescriptorMulticore.h +++ b/src/chrono_multicore/solver/ChSystemDescriptorMulticore.h @@ -14,8 +14,6 @@ #pragma once -//#include - #include "chrono/solver/ChSystemDescriptor.h" #include "chrono_multicore/ChMulticoreDefines.h" From df1f1e6aee437c92045697ea4b228b655c065f24 Mon Sep 17 00:00:00 2001 From: Radu Serban Date: Thu, 11 Feb 2021 10:05:01 +0100 Subject: [PATCH 2/8] Disable HDF5 support in Chrono::Gpu - Code does not compile (at least with VS 2019 on Windows) - todo --- src/chrono_gpu/CMakeLists.txt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/chrono_gpu/CMakeLists.txt b/src/chrono_gpu/CMakeLists.txt index e611b6076e..cbd74faeed 100644 --- a/src/chrono_gpu/CMakeLists.txt +++ b/src/chrono_gpu/CMakeLists.txt @@ -74,13 +74,14 @@ endif() # Add optional HDF5 support # ------------------------------------------------------------------------------ -if(HDF5_FOUND) - include_directories(${HDF5_INCLUDE_DIRS}) - set(CH_GPU_INCLUDES ${CH_GPU_INCLUDES} ${HDF5_INCLUDE_DIRS}) - set(CH_CPU_COMPILE_DEFS "${CH_CPU_COMPILE_DEFS} ${H5_BUILT_AS_DYNAMIC_LIB}") - list(APPEND CH_GPU_LINKED_LIBRARIES ${HDF5_CXX_LIBRARIES}) - add_definitions(-DUSE_HDF5) -endif() +#if(HDF5_FOUND) +# include_directories(${HDF5_INCLUDE_DIRS}) +# set(CH_GPU_INCLUDES ${CH_GPU_INCLUDES} ${HDF5_INCLUDE_DIRS}) +## set(CH_CPU_COMPILE_DEFS "${CH_CPU_COMPILE_DEFS} ${HDF5_COMPILE_DEFS} ${H5_BUILT_AS_DYNAMIC_LIB}") +# set(CH_CPU_COMPILE_DEFS "${CH_CPU_COMPILE_DEFS} ${H5_BUILT_AS_DYNAMIC_LIB}") +# list(APPEND CH_GPU_LINKED_LIBRARIES ${HDF5_CXX_LIBRARIES}) +# add_definitions(-DUSE_HDF5) +#endif() # ------------------------------------------------------------------------------ # Make some variables visible from parent directory @@ -160,6 +161,10 @@ set_target_properties(ChronoEngine_gpu PROPERTIES LINK_FLAGS "${CH_GPU_LINKER_FLAGS}" COMPILE_DEFINITIONS "CH_API_COMPILE_GPU ${CH_CPU_COMPILE_DEFS}") +#if(HDF5_FOUND) +#target_compile_definitions(ChronoEngine_gpu PRIVATE ${HDF5_COMPILE_DEFS}) +#endif() + target_link_libraries(ChronoEngine_gpu ${CH_GPU_LINKED_LIBRARIES}) install(TARGETS ChronoEngine_gpu From 6988db0caa4db91ec5e932484fb19198f83a85ee Mon Sep 17 00:00:00 2001 From: Radu Serban Date: Thu, 11 Feb 2021 10:06:11 +0100 Subject: [PATCH 3/8] Modify CMakeLists so that each Chrono module installs third-party headers that it requires --- src/CMakeLists.txt | 46 +++++++++++++++++++++++++++-- src/chrono_gpu/CMakeLists.txt | 5 ++++ src/chrono_multicore/CMakeLists.txt | 11 +++++++ src/chrono_sensor/CMakeLists.txt | 13 +++++--- src/chrono_synchrono/CMakeLists.txt | 7 ++++- src/chrono_vehicle/CMakeLists.txt | 9 ++++++ 6 files changed, 83 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5ca6844758..f2f30961a7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -562,9 +562,49 @@ endif() # Install headers from chrono_thirdparty folder #------------------------------------------------------------ -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/chrono_thirdparty - DESTINATION include - FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/filesystem + DESTINATION include/chrono_thirdparty/filesystem + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/cxxopts + DESTINATION include/chrono_thirdparty/cxxopts + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/HACD + DESTINATION include/chrono_thirdparty/HACD + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/HACDv2 + DESTINATION include/chrono_thirdparty/HACDv2 + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/rapidjson + DESTINATION include/chrono_thirdparty/rapidjson + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/rapidxml + DESTINATION include/chrono_thirdparty/rapidxml + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/tinyobjloader + DESTINATION include/chrono_thirdparty/tinyobjloader + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/yafel + DESTINATION include/chrono_thirdparty/yafel + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + +if(BUILD_TESTING) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/googletest + DESTINATION include/chrono_thirdparty/googletest + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") +endif() + +if(BUILD_BENCHMARKING) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/googlebenchmark + DESTINATION include/chrono_thirdparty/googlebenchmark + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") +endif() #------------------------------------------------------------ # Generate and install the Chrono configuration header diff --git a/src/chrono_gpu/CMakeLists.txt b/src/chrono_gpu/CMakeLists.txt index cbd74faeed..ba20ba31a6 100644 --- a/src/chrono_gpu/CMakeLists.txt +++ b/src/chrono_gpu/CMakeLists.txt @@ -228,3 +228,8 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif() message(STATUS "NVCC Flags are " ${CUDA_NVCC_FLAGS}) + +# Install required chrono_thirdparty headers +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/cub + DESTINATION include/chrono_thirdparty/cub + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") diff --git a/src/chrono_multicore/CMakeLists.txt b/src/chrono_multicore/CMakeLists.txt index 844c9dc17b..b8aab0e73d 100644 --- a/src/chrono_multicore/CMakeLists.txt +++ b/src/chrono_multicore/CMakeLists.txt @@ -518,3 +518,14 @@ IF(USE_MULTICORE_CUDA) DESTINATION include/chrono_multicore FILES_MATCHING PATTERN "*.cuh") ENDIF() + +# Install required chrono_thirdparty headers +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/easylogging + DESTINATION include/chrono_thirdparty/easylogging + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + +if(USE_MULTICORE_CUDA) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/cub + DESTINATION include/chrono_thirdparty/cub + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") +endif() diff --git a/src/chrono_sensor/CMakeLists.txt b/src/chrono_sensor/CMakeLists.txt index fd896b0b08..f3c43d7a43 100644 --- a/src/chrono_sensor/CMakeLists.txt +++ b/src/chrono_sensor/CMakeLists.txt @@ -501,14 +501,19 @@ install(TARGETS ChronoEngine_sensor ARCHIVE DESTINATION lib) install(FILES ${ChronoEngine_sensor_HEADERS} - DESTINATION include/chrono_sensor) + DESTINATION include/chrono_sensor) install(FILES ${ChronoEngine_sensor_UTILS_HEADERS} - DESTINATION include/chrono_sensor/utils) + DESTINATION include/chrono_sensor/utils) install(FILES ${ChronoEngine_sensor_OPTIX_HEADERS} DESTINATION include/chrono_sensor/optixcpp) install(FILES ${ChronoEngine_sensor_FILTERS_HEADERS} DESTINATION include/chrono_sensor/filters) install(FILES ${ChronoEngine_sensor_CUDA_HEADERS} - DESTINATION include/chrono_sensor/cuda) + DESTINATION include/chrono_sensor/cuda) install(FILES ${ChronoEngine_sensor_SCENE_HEADERS} - DESTINATION include/chrono_sensor/scene) + DESTINATION include/chrono_sensor/scene) + +# Install required chrono_thirdparty headers +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/stb + DESTINATION include/chrono_thirdparty/stb + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") diff --git a/src/chrono_synchrono/CMakeLists.txt b/src/chrono_synchrono/CMakeLists.txt index 5c9504dd9d..53d46c5b74 100644 --- a/src/chrono_synchrono/CMakeLists.txt +++ b/src/chrono_synchrono/CMakeLists.txt @@ -211,4 +211,9 @@ install(TARGETS ChronoEngine_synchrono install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION include/chrono_synchrono - FILES_MATCHING PATTERN "*.h") \ No newline at end of file + FILES_MATCHING PATTERN "*.h") + +# Install required chrono_thirdparty headers +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/flatbuffers + DESTINATION include/chrono_thirdparty/flatbuffers + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") diff --git a/src/chrono_vehicle/CMakeLists.txt b/src/chrono_vehicle/CMakeLists.txt index d1ac66ffd6..31aeafff83 100644 --- a/src/chrono_vehicle/CMakeLists.txt +++ b/src/chrono_vehicle/CMakeLists.txt @@ -932,6 +932,15 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION include/chrono_vehicle FILES_MATCHING PATTERN "*.h") +# Install required chrono_thirdparty headers +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/Easy_BMP + DESTINATION include/chrono_thirdparty/Easy_BMP + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/stb + DESTINATION include/chrono_thirdparty/stb + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + #------------------------------------------------------------------------------- # On Windows, copy DLLs (if specified) #------------------------------------------------------------------------------- From 8d08b00b7667e8fdfb00eeb64bd5bd2bb2e1b75b Mon Sep 17 00:00:00 2001 From: Radu Serban Date: Thu, 11 Feb 2021 10:34:05 +0100 Subject: [PATCH 4/8] Fix bugs in CMakeLists for Cascade, OpenGL, and Vehicle modules --- src/chrono_cascade/CMakeLists.txt | 2 +- src/chrono_opengl/CMakeLists.txt | 4 ++-- src/chrono_vehicle/CMakeLists.txt | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/chrono_cascade/CMakeLists.txt b/src/chrono_cascade/CMakeLists.txt index 93a5dd119d..55c346ff76 100644 --- a/src/chrono_cascade/CMakeLists.txt +++ b/src/chrono_cascade/CMakeLists.txt @@ -89,7 +89,7 @@ ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") #add_definitions( -DHAVE_LIMITS_H -DHAVE_IOSTREAM ) ENDIF() -IF(NOT EXISTS ${CASCADE_INCLUDE_DIR} OR NOT EXISTS ${CASCADE_LIBDIR}) +IF(NOT EXISTS "${CASCADE_INCLUDE_DIR}" OR NOT EXISTS "${CASCADE_LIBDIR}") message("Cannot find OpenCASCADE directories.") ENDIF() diff --git a/src/chrono_opengl/CMakeLists.txt b/src/chrono_opengl/CMakeLists.txt index babfa97d51..26d45a9c3f 100644 --- a/src/chrono_opengl/CMakeLists.txt +++ b/src/chrono_opengl/CMakeLists.txt @@ -306,13 +306,13 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ #------------------------------------------------------------------------------- IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - IF(EXISTS ${GLEW_DLL}) + IF(EXISTS "${GLEW_DLL}") ADD_CUSTOM_COMMAND(TARGET ChronoEngine_opengl POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${GLEW_DLL}" "${CMAKE_BINARY_DIR}/bin/$") ENDIF() - IF(EXISTS ${GLFW_DLL}) + IF(EXISTS "${GLFW_DLL}") ADD_CUSTOM_COMMAND(TARGET ChronoEngine_opengl POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${GLFW_DLL}" diff --git a/src/chrono_vehicle/CMakeLists.txt b/src/chrono_vehicle/CMakeLists.txt index 31aeafff83..67a3a77014 100644 --- a/src/chrono_vehicle/CMakeLists.txt +++ b/src/chrono_vehicle/CMakeLists.txt @@ -54,7 +54,7 @@ if (ENABLE_OPENCRG) if(EXISTS "${OPENCRG_INCLUDE_DIR}/crgBaseLib.h" AND EXISTS "${OPENCRG_LIBRARY}") set(HAVE_OPENCRG ON) - else() + else() set(HAVE_OPENCRG OFF) endif() @@ -947,14 +947,14 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/stb if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - if(ENABLE_MODULE_IRRLICHT AND EXISTS ${CH_IRRKLANG_DLL}) + if(ENABLE_MODULE_IRRLICHT AND EXISTS "${CH_IRRKLANG_DLL}") add_custom_command(TARGET ChronoEngine_vehicle_irrlicht POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CH_IRRKLANG_DLL}" "${PROJECT_BINARY_DIR}/bin/$") endif() - if(EXISTS ${OPENCRG_DLL}) + if(EXISTS "${OPENCRG_DLL}") add_custom_command(TARGET ChronoEngine_vehicle POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENCRG_DLL}" From e2276af3846230ffb76847d162fc86da77dd8022 Mon Sep 17 00:00:00 2001 From: Radu Serban Date: Thu, 11 Feb 2021 11:33:07 +0100 Subject: [PATCH 5/8] Also install benchmark tests --- src/tests/benchmark_tests/core/CMakeLists.txt | 1 + src/tests/benchmark_tests/fea/CMakeLists.txt | 1 + src/tests/benchmark_tests/multicore/CMakeLists.txt | 1 + src/tests/benchmark_tests/physics/CMakeLists.txt | 1 + src/tests/benchmark_tests/sensor/CMakeLists.txt | 3 +-- src/tests/benchmark_tests/vehicle/CMakeLists.txt | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tests/benchmark_tests/core/CMakeLists.txt b/src/tests/benchmark_tests/core/CMakeLists.txt index 9dbea66ac4..9b872883ce 100644 --- a/src/tests/benchmark_tests/core/CMakeLists.txt +++ b/src/tests/benchmark_tests/core/CMakeLists.txt @@ -25,4 +25,5 @@ foreach(PROGRAM ${TESTS}) LINK_FLAGS "${LINKER_FLAGS}") set_property(TARGET ${PROGRAM} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "$") target_link_libraries(${PROGRAM} ${LIBS} benchmark_main) + install(TARGETS ${PROGRAM} DESTINATION ${CH_INSTALL_DEMO}) endforeach(PROGRAM) diff --git a/src/tests/benchmark_tests/fea/CMakeLists.txt b/src/tests/benchmark_tests/fea/CMakeLists.txt index 088e1e8e12..bbd105e552 100644 --- a/src/tests/benchmark_tests/fea/CMakeLists.txt +++ b/src/tests/benchmark_tests/fea/CMakeLists.txt @@ -58,4 +58,5 @@ foreach(PROGRAM ${TESTS}) LINK_FLAGS "${LINKER_FLAGS}") set_property(TARGET ${PROGRAM} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "$") target_link_libraries(${PROGRAM} ${LIBS} benchmark_main) + install(TARGETS ${PROGRAM} DESTINATION ${CH_INSTALL_DEMO}) endforeach(PROGRAM) diff --git a/src/tests/benchmark_tests/multicore/CMakeLists.txt b/src/tests/benchmark_tests/multicore/CMakeLists.txt index c294faf026..d304898095 100644 --- a/src/tests/benchmark_tests/multicore/CMakeLists.txt +++ b/src/tests/benchmark_tests/multicore/CMakeLists.txt @@ -42,4 +42,5 @@ foreach(PROGRAM ${TESTS}) LINK_FLAGS "${LINKER_FLAGS}") set_property(TARGET ${PROGRAM} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "$") target_link_libraries(${PROGRAM} ${LIBRARIES} benchmark_main) + install(TARGETS ${PROGRAM} DESTINATION ${CH_INSTALL_DEMO}) endforeach(PROGRAM) diff --git a/src/tests/benchmark_tests/physics/CMakeLists.txt b/src/tests/benchmark_tests/physics/CMakeLists.txt index e0077cc831..f1dc685b66 100644 --- a/src/tests/benchmark_tests/physics/CMakeLists.txt +++ b/src/tests/benchmark_tests/physics/CMakeLists.txt @@ -34,4 +34,5 @@ foreach(PROGRAM ${TESTS}) LINK_FLAGS "${LINKER_FLAGS}") set_property(TARGET ${PROGRAM} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "$") target_link_libraries(${PROGRAM} ${LIBS} benchmark_main) + install(TARGETS ${PROGRAM} DESTINATION ${CH_INSTALL_DEMO}) endforeach(PROGRAM) diff --git a/src/tests/benchmark_tests/sensor/CMakeLists.txt b/src/tests/benchmark_tests/sensor/CMakeLists.txt index 05b78da933..a4ddbf121c 100644 --- a/src/tests/benchmark_tests/sensor/CMakeLists.txt +++ b/src/tests/benchmark_tests/sensor/CMakeLists.txt @@ -35,8 +35,7 @@ FOREACH(PROGRAM ${TESTS}) COMPILE_FLAGS "${CH_CXX_FLAGS}" LINK_FLAGS "${CH_LINKERFLAG_EXE}" ) - TARGET_LINK_LIBRARIES(${PROGRAM} ${LIBRARIES} gtest_main) - + set_property(TARGET ${PROGRAM} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "$") INSTALL(TARGETS ${PROGRAM} DESTINATION ${CH_INSTALL_DEMO}) ENDFOREACH(PROGRAM) diff --git a/src/tests/benchmark_tests/vehicle/CMakeLists.txt b/src/tests/benchmark_tests/vehicle/CMakeLists.txt index 8df27882ae..e3fa7f541f 100644 --- a/src/tests/benchmark_tests/vehicle/CMakeLists.txt +++ b/src/tests/benchmark_tests/vehicle/CMakeLists.txt @@ -41,4 +41,5 @@ foreach(PROGRAM ${TESTS}) LINK_FLAGS "${LINKER_FLAGS}") set_property(TARGET ${PROGRAM} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "$") target_link_libraries(${PROGRAM} ${LIBS} benchmark_main) + install(TARGETS ${PROGRAM} DESTINATION ${CH_INSTALL_DEMO}) endforeach(PROGRAM) From bbdf940e622c14737e2f7ea16f74d9dfc0e25e16 Mon Sep 17 00:00:00 2001 From: Radu Serban Date: Thu, 11 Feb 2021 11:33:55 +0100 Subject: [PATCH 6/8] Add Readme file for benchmark and unit tests --- doxygen/Doxyfile | 3 ++- src/tests/README.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/tests/README.md diff --git a/doxygen/Doxyfile b/doxygen/Doxyfile index ec212bfdee..0d6608104a 100644 --- a/doxygen/Doxyfile +++ b/doxygen/Doxyfile @@ -876,7 +876,8 @@ EXCLUDE = ../src/chrono/collision/bullet \ ../src/chrono_synchrono/README.md \ ../src/chrono_sensor/README.md \ ../src/chrono_fsi/README.md \ - ../src/chrono_python/sensor_readme.md + ../src/chrono_python/sensor_readme.md \ + ../stc/tests/README.md # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded diff --git a/src/tests/README.md b/src/tests/README.md new file mode 100644 index 0000000000..66a0c99c9e --- /dev/null +++ b/src/tests/README.md @@ -0,0 +1,36 @@ +Unit test and benchmark tests +============== + +Most Chrono unit tests rely on the [googletest](https://github.com/google/googletest) library. +The Chrono benchmark tests use the [googlebenchmark](https://github.com/google/benchmark) library (except the Chrono::Sensor benchmark tests). +These two supporting libraries are included in the Chrono repository as submodules. Upon cloning the Chrono repository, make sure to run the following two commands (in the Chrono *source tree*): +``` +> git submodule init +> git submodule update +``` + +You can run individual unit or benchmark tests from the `bin/` directory. For example (Linux): +``` +> cd +> cd bin +> ./utest_CH_ChVector +> ./btest_CH_pendulums +``` +In Windows, executables are located in a configuration-specific subfolder of `bin/` (e.g. `Release`). + +You can automate batch-running all unit tests using `ctest`. This command must be executed from the top-level directory of the *build tree*: +``` +> cd +> ctest +``` +On Windows, you may need to specify the build configuration. For example: +``` +> cd +> & 'C:\Program Files\CMake\bin\ctest.exe' -C Release +``` + +During installation, all existing unit and benchmark tests are copied to the *install tree*: +- `/share/chrono/bin` on Linux +- `/bin` on Windows + +These installed tests can be executed individually from the above locations, but no mechanism for batch-running all unit tests is provided. From b024e5f5ffe810e2c186d75d7118e54da8a5fd9b Mon Sep 17 00:00:00 2001 From: Radu Serban Date: Thu, 11 Feb 2021 13:22:33 +0100 Subject: [PATCH 7/8] Remove buggy ChBenchmark utility function --- src/chrono/utils/ChBenchmark.h | 8 -------- src/tests/benchmark_tests/fea/btest_FEA_ANCFshell.cpp | 1 - src/tests/benchmark_tests/fea/btest_FEA_contact.cpp | 1 - src/tests/benchmark_tests/fea/btest_FEA_sparse_solver.cpp | 1 - .../benchmark_tests/multicore/btest_MCORE_settling.cpp | 1 - src/tests/benchmark_tests/physics/btest_CH_mixerNSC.cpp | 1 - src/tests/benchmark_tests/physics/btest_CH_pendulums.cpp | 1 - src/tests/benchmark_tests/vehicle/btest_VEH_hmmwvDLC.cpp | 1 - src/tests/benchmark_tests/vehicle/btest_VEH_hmmwvSCM.cpp | 1 - src/tests/benchmark_tests/vehicle/btest_VEH_m113Acc.cpp | 1 - 10 files changed, 17 deletions(-) diff --git a/src/chrono/utils/ChBenchmark.h b/src/chrono/utils/ChBenchmark.h index f9b948858d..fd37039e73 100644 --- a/src/chrono/utils/ChBenchmark.h +++ b/src/chrono/utils/ChBenchmark.h @@ -180,14 +180,6 @@ class ChBenchmarkFixture : public ::benchmark::Fixture { TEST* m_test; }; -static void AddComandLineArgument(int* argc, char** argv[], const char* extra) { - std::vector new_argv(*argv, *argv + *argc); - new_argv.push_back((char*)extra); - new_argv.push_back(nullptr); - *argv = new_argv.data(); - *argc += 1; -} - } // end namespace utils } // end namespace chrono diff --git a/src/tests/benchmark_tests/fea/btest_FEA_ANCFshell.cpp b/src/tests/benchmark_tests/fea/btest_FEA_ANCFshell.cpp index 8774a55503..06c771f427 100644 --- a/src/tests/benchmark_tests/fea/btest_FEA_ANCFshell.cpp +++ b/src/tests/benchmark_tests/fea/btest_FEA_ANCFshell.cpp @@ -308,7 +308,6 @@ CH_BM_SIMULATION_LOOP(ANCFshell64_PARDISOPROJECT, ANCFshell_PARDISOPROJECT<64>, // ============================================================================= int main(int argc, char* argv[]) { - utils::AddComandLineArgument(&argc, &argv, "--benchmark_counters_tabular"); ::benchmark::Initialize(&argc, argv); #ifdef CHRONO_IRRLICHT diff --git a/src/tests/benchmark_tests/fea/btest_FEA_contact.cpp b/src/tests/benchmark_tests/fea/btest_FEA_contact.cpp index 8ae30810ae..b99384d8ee 100644 --- a/src/tests/benchmark_tests/fea/btest_FEA_contact.cpp +++ b/src/tests/benchmark_tests/fea/btest_FEA_contact.cpp @@ -268,7 +268,6 @@ CH_BM_SIMULATION_ONCE(FEAcontact_MUMPS, FEAcontactTest_MUMPS, NUM_SKIP_STEPS, NU // ============================================================================= int main(int argc, char* argv[]) { - utils::AddComandLineArgument(&argc, &argv, "--benchmark_counters_tabular"); ::benchmark::Initialize(&argc, argv); #ifdef CHRONO_IRRLICHT diff --git a/src/tests/benchmark_tests/fea/btest_FEA_sparse_solver.cpp b/src/tests/benchmark_tests/fea/btest_FEA_sparse_solver.cpp index 32f4ef01f9..bdc0a5e706 100644 --- a/src/tests/benchmark_tests/fea/btest_FEA_sparse_solver.cpp +++ b/src/tests/benchmark_tests/fea/btest_FEA_sparse_solver.cpp @@ -228,7 +228,6 @@ BM_SOLVER_QR(QR_learner_8000, 8000, true) BM_SOLVER_QR(QR_no_learner_8000, 8000, false) int main(int argc, char* argv[]) { - utils::AddComandLineArgument(&argc, &argv, "--benchmark_counters_tabular"); ::benchmark::Initialize(&argc, argv); ::benchmark::RunSpecifiedBenchmarks(); } diff --git a/src/tests/benchmark_tests/multicore/btest_MCORE_settling.cpp b/src/tests/benchmark_tests/multicore/btest_MCORE_settling.cpp index 686c66a147..4777938698 100644 --- a/src/tests/benchmark_tests/multicore/btest_MCORE_settling.cpp +++ b/src/tests/benchmark_tests/multicore/btest_MCORE_settling.cpp @@ -184,7 +184,6 @@ BENCHMARK_REGISTER_F(TEST_NAME, Settle) // ============================================================================= int main(int argc, char* argv[]) { - utils::AddComandLineArgument(&argc, &argv, "--benchmark_counters_tabular"); ::benchmark::Initialize(&argc, argv); #ifdef CHRONO_IRRLICHT diff --git a/src/tests/benchmark_tests/physics/btest_CH_mixerNSC.cpp b/src/tests/benchmark_tests/physics/btest_CH_mixerNSC.cpp index 2f7a3ba152..af59852687 100644 --- a/src/tests/benchmark_tests/physics/btest_CH_mixerNSC.cpp +++ b/src/tests/benchmark_tests/physics/btest_CH_mixerNSC.cpp @@ -138,7 +138,6 @@ CH_BM_SIMULATION_LOOP(MixerNSC064, MixerTestNSC<64>, NUM_SKIP_STEPS, NUM_SIM_ST // ============================================================================= int main(int argc, char* argv[]) { - utils::AddComandLineArgument(&argc, &argv, "--benchmark_counters_tabular"); ::benchmark::Initialize(&argc, argv); #ifdef CHRONO_IRRLICHT diff --git a/src/tests/benchmark_tests/physics/btest_CH_pendulums.cpp b/src/tests/benchmark_tests/physics/btest_CH_pendulums.cpp index b6b42a0f2a..7bf57cecb9 100644 --- a/src/tests/benchmark_tests/physics/btest_CH_pendulums.cpp +++ b/src/tests/benchmark_tests/physics/btest_CH_pendulums.cpp @@ -166,7 +166,6 @@ CH_BM_SIMULATION_LOOP(Chain64, ChainTest<64>, NUM_SKIP_STEPS, NUM_SIM_STEPS, 20) // ============================================================================= int main(int argc, char* argv[]) { - utils::AddComandLineArgument(&argc, &argv, "--benchmark_counters_tabular"); ::benchmark::Initialize(&argc, argv); #ifdef CHRONO_IRRLICHT diff --git a/src/tests/benchmark_tests/vehicle/btest_VEH_hmmwvDLC.cpp b/src/tests/benchmark_tests/vehicle/btest_VEH_hmmwvDLC.cpp index 7341fd134c..a0f46a6282 100644 --- a/src/tests/benchmark_tests/vehicle/btest_VEH_hmmwvDLC.cpp +++ b/src/tests/benchmark_tests/vehicle/btest_VEH_hmmwvDLC.cpp @@ -184,7 +184,6 @@ CH_BM_SIMULATION_ONCE(HmmwvDLC_RIGIDMESH, rigidmesh_test_type, NUM_SKIP_STEPS, N // ============================================================================= int main(int argc, char* argv[]) { - utils::AddComandLineArgument(&argc, &argv, "--benchmark_counters_tabular"); ::benchmark::Initialize(&argc, argv); #ifdef CHRONO_IRRLICHT diff --git a/src/tests/benchmark_tests/vehicle/btest_VEH_hmmwvSCM.cpp b/src/tests/benchmark_tests/vehicle/btest_VEH_hmmwvSCM.cpp index 3213f53dc5..619cbb8646 100644 --- a/src/tests/benchmark_tests/vehicle/btest_VEH_hmmwvSCM.cpp +++ b/src/tests/benchmark_tests/vehicle/btest_VEH_hmmwvSCM.cpp @@ -242,7 +242,6 @@ CH_BM_SIMULATION_ONCE(HmmwvSCM_CYL_1, cyl_1_test_type, NUM_SKIP_STEPS, NUM_SIM_S // ============================================================================= int main(int argc, char* argv[]) { - utils::AddComandLineArgument(&argc, &argv, "--benchmark_counters_tabular"); ::benchmark::Initialize(&argc, argv); #ifdef CHRONO_IRRLICHT diff --git a/src/tests/benchmark_tests/vehicle/btest_VEH_m113Acc.cpp b/src/tests/benchmark_tests/vehicle/btest_VEH_m113Acc.cpp index 4d3b981d49..d1c3222498 100644 --- a/src/tests/benchmark_tests/vehicle/btest_VEH_m113Acc.cpp +++ b/src/tests/benchmark_tests/vehicle/btest_VEH_m113Acc.cpp @@ -190,7 +190,6 @@ CH_BM_SIMULATION_LOOP(M113Acc_DP, dp_test_type, NUM_SKIP_STEPS, NUM_SIM_STEPS, R // ============================================================================= int main(int argc, char* argv[]) { - utils::AddComandLineArgument(&argc, &argv, "--benchmark_counters_tabular"); ::benchmark::Initialize(&argc, argv); #ifdef CHRONO_IRRLICHT From 4e762bacb1372714f1c499ef1dea6ef88a3637fa Mon Sep 17 00:00:00 2001 From: Radu Serban Date: Thu, 11 Feb 2021 16:38:33 +0100 Subject: [PATCH 8/8] Fix installation of headers - fix bug where an extraneous level was created - do not install empty directories --- src/CMakeLists.txt | 25 ++++++++++++++----------- src/chrono_gpu/CMakeLists.txt | 2 +- src/chrono_multicore/CMakeLists.txt | 4 ++-- src/chrono_opengl/CMakeLists.txt | 7 ++++++- src/chrono_sensor/CMakeLists.txt | 2 +- src/chrono_synchrono/CMakeLists.txt | 4 ++-- src/chrono_vehicle/CMakeLists.txt | 4 ++-- 7 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f2f30961a7..4a6494c2d1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -563,45 +563,48 @@ endif() #------------------------------------------------------------ install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/filesystem - DESTINATION include/chrono_thirdparty/filesystem + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/cxxopts - DESTINATION include/chrono_thirdparty/cxxopts + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/HACD - DESTINATION include/chrono_thirdparty/HACD + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/HACDv2 - DESTINATION include/chrono_thirdparty/HACDv2 + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/rapidjson - DESTINATION include/chrono_thirdparty/rapidjson + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/rapidxml - DESTINATION include/chrono_thirdparty/rapidxml + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/tinyobjloader - DESTINATION include/chrono_thirdparty/tinyobjloader + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/yafel - DESTINATION include/chrono_thirdparty/yafel + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") if(BUILD_TESTING) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/googletest - DESTINATION include/chrono_thirdparty/googletest + install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/googletest/googletest/include + DESTINATION include/chrono_thirdparty/googletest/googletest + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") + install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/googletest/googlemock/include + DESTINATION include/chrono_thirdparty/googletest/googlemock FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") endif() if(BUILD_BENCHMARKING) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/googlebenchmark + install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/googlebenchmark/include DESTINATION include/chrono_thirdparty/googlebenchmark FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") endif() diff --git a/src/chrono_gpu/CMakeLists.txt b/src/chrono_gpu/CMakeLists.txt index ba20ba31a6..e620fd9a97 100644 --- a/src/chrono_gpu/CMakeLists.txt +++ b/src/chrono_gpu/CMakeLists.txt @@ -231,5 +231,5 @@ message(STATUS "NVCC Flags are " ${CUDA_NVCC_FLAGS}) # Install required chrono_thirdparty headers install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/cub - DESTINATION include/chrono_thirdparty/cub + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") diff --git a/src/chrono_multicore/CMakeLists.txt b/src/chrono_multicore/CMakeLists.txt index b8aab0e73d..6123f4ec1c 100644 --- a/src/chrono_multicore/CMakeLists.txt +++ b/src/chrono_multicore/CMakeLists.txt @@ -521,11 +521,11 @@ ENDIF() # Install required chrono_thirdparty headers install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/easylogging - DESTINATION include/chrono_thirdparty/easylogging + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") if(USE_MULTICORE_CUDA) install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/cub - DESTINATION include/chrono_thirdparty/cub + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") endif() diff --git a/src/chrono_opengl/CMakeLists.txt b/src/chrono_opengl/CMakeLists.txt index 26d45a9c3f..ad10042f5a 100644 --- a/src/chrono_opengl/CMakeLists.txt +++ b/src/chrono_opengl/CMakeLists.txt @@ -299,7 +299,12 @@ INSTALL(TARGETS ChronoEngine_opengl INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION include/chrono_opengl - FILES_MATCHING PATTERN "*.h") + FILES_MATCHING PATTERN "*.h" PATTERN "resources" EXCLUDE) + +# Install required chrono_thirdparty headers +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/tinyobjloader + DESTINATION include/chrono_thirdparty + FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") #------------------------------------------------------------------------------- # On Windows, copy the GLEW and GLFW DLLs (if specified) diff --git a/src/chrono_sensor/CMakeLists.txt b/src/chrono_sensor/CMakeLists.txt index f3c43d7a43..45b46cc7a2 100644 --- a/src/chrono_sensor/CMakeLists.txt +++ b/src/chrono_sensor/CMakeLists.txt @@ -515,5 +515,5 @@ install(FILES ${ChronoEngine_sensor_SCENE_HEADERS} # Install required chrono_thirdparty headers install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/stb - DESTINATION include/chrono_thirdparty/stb + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") diff --git a/src/chrono_synchrono/CMakeLists.txt b/src/chrono_synchrono/CMakeLists.txt index 53d46c5b74..c8b2c9c6fd 100644 --- a/src/chrono_synchrono/CMakeLists.txt +++ b/src/chrono_synchrono/CMakeLists.txt @@ -211,9 +211,9 @@ install(TARGETS ChronoEngine_synchrono install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION include/chrono_synchrono - FILES_MATCHING PATTERN "*.h") + FILES_MATCHING PATTERN "*.h" PATTERN "fbs" EXCLUDE) # Install required chrono_thirdparty headers -install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/flatbuffers +install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/flatbuffers/include DESTINATION include/chrono_thirdparty/flatbuffers FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") diff --git a/src/chrono_vehicle/CMakeLists.txt b/src/chrono_vehicle/CMakeLists.txt index 67a3a77014..b4f019440a 100644 --- a/src/chrono_vehicle/CMakeLists.txt +++ b/src/chrono_vehicle/CMakeLists.txt @@ -934,11 +934,11 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ # Install required chrono_thirdparty headers install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/Easy_BMP - DESTINATION include/chrono_thirdparty/Easy_BMP + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/stb - DESTINATION include/chrono_thirdparty/stb + DESTINATION include/chrono_thirdparty FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl") #-------------------------------------------------------------------------------