Skip to content

Commit

Permalink
Merge branch 'release/6.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rserban committed Feb 11, 2021
2 parents 3a9e008 + 4e762ba commit b048d0b
Show file tree
Hide file tree
Showing 33 changed files with 190 additions and 48 deletions.
3 changes: 2 additions & 1 deletion doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
57 changes: 54 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,52 @@ 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
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")

install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/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
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")

install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/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
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")

install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/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
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")

install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/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/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/include
DESTINATION include/chrono_thirdparty/googlebenchmark
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")
endif()

#------------------------------------------------------------
# Generate and install the Chrono configuration header
Expand Down Expand Up @@ -689,6 +732,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)
Expand Down
9 changes: 9 additions & 0 deletions src/chrono/ChConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions src/chrono/utils/ChBenchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,6 @@ class ChBenchmarkFixture : public ::benchmark::Fixture {
TEST* m_test;
};

static void AddComandLineArgument(int* argc, char** argv[], const char* extra) {
std::vector<char*> 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

Expand Down
2 changes: 1 addition & 1 deletion src/chrono_cascade/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
24 changes: 17 additions & 7 deletions src/chrono_gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -223,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
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")
11 changes: 11 additions & 0 deletions src/chrono_multicore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")
endif()
5 changes: 5 additions & 0 deletions src/chrono_multicore/ChConfigMulticore.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions src/chrono_multicore/ChMulticoreDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

#include <iostream>

// Include the ChConfigMulticore header *before* any Thrust headers!
#include "chrono_multicore/ChApiMulticore.h"
#include "chrono_multicore/ChConfigMulticore.h"

#include <thrust/reduce.h>
#include <thrust/gather.h>
#include <thrust/scan.h>
Expand All @@ -40,9 +44,6 @@
#include <cfenv>
#endif

#include "chrono_multicore/ChApiMulticore.h"
#include "chrono_multicore/ChConfigMulticore.h"

typedef int shape_type;

#ifdef __CDT_PARSER__
Expand Down
4 changes: 4 additions & 0 deletions src/chrono_multicore/physics/ChFluidContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/chrono_multicore/physics/ChParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@

#include <algorithm>
#include <stdexcept>
#include <thrust/sort.h>

#include "chrono/physics/ChSystemSMC.h"
#include "chrono/physics/ChMaterialSurfaceSMC.h"
#include "chrono_multicore/solver/ChIterativeSolverMulticore.h"

#include <thrust/sort.h>

#if defined _WIN32
#include <cstdint>
#endif
Expand Down
2 changes: 0 additions & 2 deletions src/chrono_multicore/solver/ChSystemDescriptorMulticore.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

#pragma once

//#include <thrust/count.h>

#include "chrono/solver/ChSystemDescriptor.h"

#include "chrono_multicore/ChMulticoreDefines.h"
Expand Down
11 changes: 8 additions & 3 deletions src/chrono_opengl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -299,20 +299,25 @@ 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)
#-------------------------------------------------------------------------------

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/$<CONFIGURATION>")
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}"
Expand Down
13 changes: 9 additions & 4 deletions src/chrono_sensor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")
7 changes: 6 additions & 1 deletion src/chrono_synchrono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +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/include
DESTINATION include/chrono_thirdparty/flatbuffers
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")
15 changes: 12 additions & 3 deletions src/chrono_vehicle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -932,20 +932,29 @@ 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
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")

install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/chrono_thirdparty/stb
DESTINATION include/chrono_thirdparty
FILES_MATCHING PATTERN "*.h" PATTERN "*.cuh" PATTERN "*.hpp" PATTERN "*.inl")

#-------------------------------------------------------------------------------
# On Windows, copy DLLs (if specified)
#-------------------------------------------------------------------------------

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/$<CONFIGURATION>")
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}"
Expand Down
36 changes: 36 additions & 0 deletions src/tests/README.md
Original file line number Diff line number Diff line change
@@ -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 <build_dir>
> 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 <build_dir>
> ctest
```
On Windows, you may need to specify the build configuration. For example:
```
> cd <build_dir>
> & 'C:\Program Files\CMake\bin\ctest.exe' -C Release
```

During installation, all existing unit and benchmark tests are copied to the *install tree*:
- `<install_dir>/share/chrono/bin` on Linux
- `<install_dir>/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.
Loading

0 comments on commit b048d0b

Please sign in to comment.