Skip to content

Commit 0544b8f

Browse files
committed
COMP: Syncronize with cookie cutter recommendations
1 parent 8f2fd1a commit 0544b8f

File tree

7 files changed

+128
-16
lines changed

7 files changed

+128
-16
lines changed

.github/workflows/build-test.yml renamed to .github/workflows/build-test-package.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
name: Build, test, package
22

3-
on: [push,pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- main
412

513
jobs:
6-
build-test-cxx:
14+
cxx-build-workflow:
715
runs-on: ${{ matrix.os }}
816
strategy:
917
max-parallel: 3
@@ -40,7 +48,7 @@ jobs:
4048
python -m pip install ninja
4149
4250
- name: Get specific version of CMake, Ninja
43-
uses: lukka/get-cmake@latest
51+
uses: lukka/get-cmake@3.31.5
4452

4553
- name: Download ITK
4654
run: |

CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ project(PerformanceBenchmarking
2020
HOMEPAGE_URL "https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking"
2121
LANGUAGES CXX C
2222
)
23+
24+
set(PerformanceBenchmarking_LIBRARIES PerformanceBenchmarking)
25+
2326
if(NOT ITK_SOURCE_DIR)
2427
find_package(ITK REQUIRED)
2528
list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
@@ -41,14 +44,12 @@ if(NOT ITK_SOURCE_DIR)
4144
# Set the possible values of build type for cmake-gui
4245
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
4346
endif()
44-
endif()
45-
set(PerformanceBenchmarking_LIBRARIES PerformanceBenchmarking)
4647

47-
include_directories(${CMAKE_BINARY_DIR})
48-
if(NOT ITK_SOURCE_DIR)
4948
include(ITKModuleExternal)
5049
else()
5150
set(ITK_DIR ${CMAKE_BINARY_DIR})
5251
itk_module_impl()
5352
endif()
54-
add_subdirectory(examples)
53+
54+
itk_module_examples() # This builds the src directory
55+
add_subdirectory(examples) # this builds each of the itk benchmark domains

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# PerformanceBenchmarking
2+
3+
image:: https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/workflows/Build,%20test,%20package/badge.svg
4+
5+
[![Build Status](https://github.com/InsightSoftwareConsortium/PerformanceBenchmarking/actions/workflows/build-test-package.yml/badge.svg)](https://github.com/InsightSoftwareConsortium/PerformanceBenchmarking/actions/workflows/build-test-package.yml)
6+
7+
[![PyPI Version](https://img.shields.io/pypi/v/itk-PerformanceBenchmarking.svg)](https://pypi.python.org/pypi/itk-PerformanceBenchmarking)
8+
9+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/InsightSoftwareConsortium/PerformanceBenchmarking/blob/main/LICENSE)
10+
11+
## Overview
12+
13+
Real-world tests to benchmark ITK performance.
14+
15+
New classes increase operating system process priority to
16+
minimize the impact of other processes running on the system.
17+
18+
These classes are used by a suite of example ITK benchmarks to quantify toolkit
19+
performance.
20+
21+
For more information, see::
22+
23+
```txt
24+
McCormick M., Kang H.J., Barre S.
25+
Performance Benchmarking the Insight Toolkit
26+
The Insight Journal. January-December. 2016.
27+
https://hdl.handle.net/10380/3557
28+
https://insight-journal.org/browse/publication/972
29+
```
30+
31+
Since ITK 4.11.0, this module is available in the ITK source tree as a Remote
32+
module. To enable it, set::
33+
34+
Module_PerformanceBenchmarking:BOOL=ON
35+
36+
in ITK's CMake build configuration.
37+
38+
Requirements
39+
------------
40+
- `CMake <https://cmake.org/>`_
41+
- `Ninja <https://ninja-build.org/>`_
42+
- `Python <https://www.python.org/>`_
43+
44+
Notes for running the benchmarks
45+
--------------------------------
46+
47+
An example to call the benchmarking script is::
48+
49+
$ python ./evaluate-itk-performance.py run -g {ITK-version} {ITK-source} {ITK-build} {ITKPerformanceBenchmarking-build}
50+
51+
where ``{ITK-version}`` is the ITK version that the user wishes to evaluate.
52+
53+
Also, note that the ITK source folder ``(ITK-source}``, where the specific
54+
version is fetched, needs to exist.
55+
56+
The generated/result ``JSON`` files are placed in::
57+
58+
./{ITKPerformanceBenchmarking-build}/BenchmarkResults/{machine-name}
59+
60+
61+
Notes for benchmarking in Windows
62+
---------------------------------
63+
64+
**CMake** and **Ninja** need to be in the ``PATH``. Also, the **C++ compiler**
65+
has to be in the ``PATH`` so that Ninja can find it.
66+
67+
For the Microsoft Visual Studio compiler, the C++ compiler is a file that is
68+
usually under::
69+
70+
C:/Program Files/Microsoft Visual Studio {version}/VC/bin/cl.exe
71+
72+
The user will need to change the path to the *vcvars\*.bat* command file in the
73+
`RunWithVisualStudio.cmd <https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/blob/master/RunWithVisualStudio.cmd#L1>`_ command line script to the specific location of their
74+
*vcvars* file, e.g.::
75+
76+
C:/Program Files/Microsoft Visual Studio {version}/VC/vcvarsall.bat
77+
78+
Finally, the user will need to start the Git bash by double-clicking on the
79+
``RunWithVisualStudio.cmd`` script.
80+
81+
Note that the module is built with static libraries to allow for ITK
82+
benchmarking in Windows: the ``BUILD_SHARED_LIBS`` flag in the
83+
`evaluate-itk-performance.py <https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/blob/master/evaluate-itk-performance.py>`_ script is set to `OFF`.
84+
85+
86+
License
87+
-------
88+
89+
This software is distributed under the Apache 2.0 license. Please see
90+
the *LICENSE* file for details.

README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
ITKPerformanceBenchmarking
2-
==========================
32

4-
.. image:: https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/workflows/Build,%20test,%20package/badge.svg
3+
image:: https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/workflows/Build,%20test,%20package/badge.svg
54

65
Real-world tests to benchmark ITK performance.
76

@@ -11,13 +10,15 @@ minimize the impact of other processes running on the system.
1110
These classes are used by a suite of example ITK benchmarks to quantify toolkit
1211
performance.
1312

14-
For more information, see the `Insight Journal article <https://hdl.handle.net/10380/3557>`_::
13+
For more information, see::
1514

15+
```txt
1616
McCormick M., Kang H.J., Barre S.
1717
Performance Benchmarking the Insight Toolkit
1818
The Insight Journal. January-December. 2016.
1919
https://hdl.handle.net/10380/3557
2020
https://insight-journal.org/browse/publication/972
21+
```
2122

2223
Since ITK 4.11.0, this module is available in the ITK source tree as a Remote
2324
module. To enable it, set::

examples/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
cmake_minimum_required(VERSION 3.10.2)
2-
project(ITKBenchmarks NONE)
1+
cmake_minimum_required(VERSION 3.22.1)
2+
project(ITKBenchmarks
3+
VERSION 0.9.0
4+
DESCRIPTION
5+
"Benchmarks performance."
6+
HOMEPAGE_URL "https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking"
7+
LANGUAGES CXX C
8+
)
39

410
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH})
511
include(ITKBenchmarksExternalData)

itk-module.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
set(DOCUMENTATION "New classes increase operating system process priority to
1+
# the top-level README is used for describing this module, just
2+
# re-used it for documentation here
3+
get_filename_component(MY_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
4+
file(READ "${MY_CURRENT_DIR}/README.md" DOCUMENTATION)
5+
6+
set(DOCUMENTATION
7+
"New classes increase operating system process priority to
28
minimize the impact of other processes running on the system.
39
410
These classes are used by a used by a suite of example ITK benchmarks to

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ set(MAPPING_VALUES "
5353
")
5454

5555
configure_file(PerformanceBenchmarkingInformation.cxx.in ${CMAKE_BINARY_DIR}/PerformanceBenchmarkingInformation.cxx)
56-
configure_file(PerformanceBenchmarkingInformation.h.in ${CMAKE_BINARY_DIR}/PerformanceBenchmarkingInformation.h)
56+
configure_file(PerformanceBenchmarkingInformation.h.in ${CMAKE_BINARY_DIR}/include/PerformanceBenchmarkingInformation.h)
5757

5858
set( PerformanceBenchmarking_SRCS
5959
jsonxx.cc ## MIT License https://github.com/hjiang/jsonxx
@@ -62,7 +62,7 @@ set( PerformanceBenchmarking_SRCS
6262
itkHighPriorityRealTimeProbe.cxx
6363
itkHighPriorityRealTimeProbesCollector.cxx
6464
PerformanceBenchmarkingUtilities.cxx
65-
${CMAKE_BINARY_DIR}/PerformanceBenchmarkingInformation.h)
65+
${CMAKE_BINARY_DIR}/include/PerformanceBenchmarkingInformation.h)
6666

6767
if(MSVC)
6868
add_definitions(-D_CRT_SECURE_NO_WARNINGS)

0 commit comments

Comments
 (0)