Skip to content

Commit 6e5387b

Browse files
committed
Add DART_USE_SYSTEM_TRACY option
1 parent 3142070 commit 6e5387b

File tree

11 files changed

+669
-1087
lines changed

11 files changed

+669
-1087
lines changed

.github/workflows/cache_docker.yml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -185,39 +185,3 @@ jobs:
185185
tags: ${{ env.DOCKER_REPO }}:${{ matrix.image }}-${{ matrix.dart_version }}
186186
- name: Image digest
187187
run: echo ${{ steps.docker_build.outputs.digest }}
188-
189-
# Tracy Profiler
190-
tracy:
191-
name: tracy profiler
192-
runs-on: ubuntu-latest
193-
strategy:
194-
fail-fast: false
195-
matrix:
196-
dart_version: [v6.15]
197-
build_min: [ON]
198-
env:
199-
OS_VERSION: tracy
200-
DART_VERSION: ${{ matrix.dart_version }}
201-
steps:
202-
# https://github.com/marketplace/actions/docker-setup-qemu
203-
- name: Set up QEMU
204-
uses: docker/setup-qemu-action@v3
205-
# https://github.com/marketplace/actions/docker-setup-buildx
206-
- name: Set up Docker Buildx
207-
uses: docker/setup-buildx-action@v3
208-
# https://github.com/marketplace/actions/docker-login
209-
- name: Login to DockerHub
210-
uses: docker/login-action@v3
211-
with:
212-
username: ${{ secrets.DOCKER_USERNAME }}
213-
password: ${{ secrets.DOCKER_PASSWORD }}
214-
# https://github.com/marketplace/actions/build-and-push-docker-images
215-
- name: Build and push
216-
id: docker_build
217-
uses: docker/build-push-action@v6
218-
with:
219-
file: ./docker/dev/${{ env.DART_VERSION }}/Dockerfile.${{ env.OS_VERSION }}
220-
push: true
221-
tags: ${{ env.DOCKER_REPO }}:${{ env.OS_VERSION }}-${{ env.DART_VERSION }}
222-
- name: Image digest
223-
run: echo ${{ steps.docker_build.outputs.digest }}

CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,17 @@ set(DART_PKG_EXTERNAL_DEPS "assimp, ccd, eigen3, fcl, octomap")
6969
#===============================================================================
7070
# Build options
7171
#===============================================================================
72-
dart_option(DART_VERBOSE "Whether print detailed information in CMake process" OFF)
7372
if(MSVC)
7473
set(DART_RUNTIME_LIBRARY "/MD" CACHE STRING "BaseName chosen by the user at CMake configure time")
7574
set_property(CACHE DART_RUNTIME_LIBRARY PROPERTY STRINGS /MD /MT)
7675
dart_option(DART_MSVC_DEFAULT_OPTIONS "Build DART with default Visual Studio options" OFF)
7776
else()
7877
dart_option(BUILD_SHARED_LIBS "Build shared libraries" ON)
7978
endif()
79+
dart_option(DART_BUILD_DARTPY "Build dartpy" OFF)
80+
dart_option(DART_BUILD_GUI_OSG "Build osgDart library" ON)
81+
dart_option(DART_BUILD_PROFILE "Build DART with profiling options" OFF)
82+
dart_option(DART_CODECOV "Turn on codecov support" OFF)
8083
# Warning: DART_ENABLE_SIMD should be ON only when you build DART and the DART
8184
# dependent projects on the same machine. If this option is on, then compile
8285
# option `-march=native` is added to the target `dart` that enables all
@@ -86,10 +89,6 @@ endif()
8689
# errors.
8790
dart_option(DART_ENABLE_SIMD
8891
"Build DART with all SIMD instructions on the current local machine" OFF)
89-
dart_option(DART_BUILD_GUI_OSG "Build osgDart library" ON)
90-
dart_option(DART_BUILD_DARTPY "Build dartpy" OFF)
91-
dart_option(DART_BUILD_PROFILE "Build DART with profiling options" OFF)
92-
dart_option(DART_CODECOV "Turn on codecov support" OFF)
9392
dart_option(DART_FAST_DEBUG "Add -O1 option for DEBUG mode build" OFF)
9493
# GCC and Clang add ANSI-formatted colors when they detect the output medium is a
9594
# terminal. However, this doesn't work in some cases such as when the makefile is
@@ -102,6 +101,8 @@ dart_option(DART_USE_SYSTEM_IMGUI "Use system ImGui" OFF)
102101
dart_option(DART_USE_SYSTEM_GOOGLEBENCHMARK "Use system GoogleBenchmark" OFF)
103102
dart_option(DART_USE_SYSTEM_GOOGLETEST "Use system GoogleTest" OFF)
104103
dart_option(DART_USE_SYSTEM_PYBIND11 "Use system pybind11" OFF)
104+
dart_option(DART_USE_SYSTEM_TRACY "Use system Tracy" OFF)
105+
dart_option(DART_VERBOSE "Whether print detailed information in CMake process" OFF)
105106

106107
#===============================================================================
107108
# Print intro

cmake/DARTFindDependencies.cmake

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,22 @@ endif()
111111
#=======================
112112

113113
if(DART_BUILD_PROFILE)
114-
include(FetchContent)
115-
FetchContent_Declare(tracy
116-
GIT_REPOSITORY https://github.com/wolfpld/tracy.git
117-
GIT_TAG master # TODO: Change to a fixed version once > 0.10 is released
118-
GIT_SHALLOW TRUE
119-
GIT_PROGRESS TRUE
120-
)
121-
FetchContent_MakeAvailable(tracy)
122-
if(MSVC)
123-
target_compile_options(TracyClient PRIVATE /W0)
114+
if(DART_USE_SYSTEM_TRACY)
115+
find_package(Tracy CONFIG REQUIRED)
124116
else()
125-
target_compile_options(TracyClient PRIVATE -w)
117+
include(FetchContent)
118+
FetchContent_Declare(tracy
119+
GIT_REPOSITORY https://github.com/wolfpld/tracy.git
120+
GIT_TAG v0.11.1
121+
GIT_SHALLOW TRUE
122+
GIT_PROGRESS TRUE
123+
)
124+
FetchContent_MakeAvailable(tracy)
125+
if(MSVC)
126+
target_compile_options(TracyClient PRIVATE /W0)
127+
else()
128+
target_compile_options(TracyClient PRIVATE -w)
129+
endif()
126130
endif()
127131
endif()
128132

dart/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ if(DART_CODECOV)
234234
endif()
235235

236236
if(DART_BUILD_PROFILE)
237-
target_link_libraries(dart PUBLIC TracyClient)
237+
target_link_libraries(dart PUBLIC Tracy::TracyClient)
238238
endif()
239239

240240
install(FILES dart.hpp DESTINATION include/dart/ COMPONENT headers)

dart/common/Profile.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636

3737
#if DART_BUILD_PROFILE
3838
#include <tracy/Tracy.hpp>
39-
#endif
40-
41-
#if DART_BUILD_PROFILE
4239

4340
#define DART_PROFILE_FRAME FrameMark
4441
#define DART_PROFILE_SCOPED ZoneScoped

dart/simulation/World.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ void World::reset()
163163
//==============================================================================
164164
void World::step(bool _resetCommand)
165165
{
166+
DART_PROFILE_FRAME;
167+
166168
// Integrate velocity for unconstrained skeletons
167169
{
168170
DART_PROFILE_SCOPED_N("World::step - Integrate velocity");
@@ -202,7 +204,6 @@ void World::step(bool _resetCommand)
202204

203205
mTime += mTimeStep;
204206
mFrame++;
205-
DART_PROFILE_FRAME;
206207
}
207208

208209
//==============================================================================

docker/dev/v6.15/Dockerfile.tracy

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)