Skip to content

Commit 31def15

Browse files
committed
Add PPC_TASKS build selector
1 parent a89df69 commit 31def15

4 files changed

Lines changed: 91 additions & 24 deletions

File tree

docs/locale/en/LC_MESSAGES/user_guide/build.po

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,48 +35,65 @@ msgid "**Configure the build**: ``Makefile``, ``.sln``, etc."
3535
msgstr ""
3636

3737
#: ../../../../docs/user_guide/build.rst:12
38-
msgid "Optional: enable sanitizers for local debugging"
38+
msgid "To configure only selected tasks:"
3939
msgstr ""
4040

4141
#: ../../../../docs/user_guide/build.rst:18
42+
msgid "Optional: enable sanitizers for local debugging"
43+
msgstr ""
44+
45+
#: ../../../../docs/user_guide/build.rst:24
4246
msgid "*Help on CMake keys:*"
4347
msgstr ""
4448

45-
#: ../../../../docs/user_guide/build.rst:21
49+
#: ../../../../docs/user_guide/build.rst:27
4650
msgid "``-D USE_FUNC_TESTS=ON`` enable functional tests."
4751
msgstr ""
4852

49-
#: ../../../../docs/user_guide/build.rst:22
53+
#: ../../../../docs/user_guide/build.rst:28
5054
msgid "``-D USE_PERF_TESTS=ON`` enable performance tests."
5155
msgstr ""
5256

53-
#: ../../../../docs/user_guide/build.rst:23
57+
#: ../../../../docs/user_guide/build.rst:29
58+
msgid ""
59+
"``-D PPC_TASKS=all`` builds every task (default). Pass one task or a "
60+
"semicolon list, for example ``-D PPC_TASKS=\"example_threads;example_processes\"``, "
61+
"to limit the build."
62+
msgstr ""
63+
64+
#: ../../../../docs/user_guide/build.rst:32
65+
msgid ""
66+
"``-D PPC_IMPLEMENTATIONS=\"seq;omp\"`` select implementation folders to "
67+
"configure."
68+
msgstr ""
69+
70+
#: ../../../../docs/user_guide/build.rst:34
5471
msgid "``-D CMAKE_BUILD_TYPE=Release`` normal build (default)."
5572
msgstr ""
5673

57-
#: ../../../../docs/user_guide/build.rst:24
74+
#: ../../../../docs/user_guide/build.rst:35
5875
msgid ""
5976
"``-D CMAKE_BUILD_TYPE=RelWithDebInfo`` recommended when using sanitizers "
6077
"or running ``valgrind`` to keep debug information."
6178
msgstr ""
6279

63-
#: ../../../../docs/user_guide/build.rst:26
80+
#: ../../../../docs/user_guide/build.rst:37
6481
msgid "``-D CMAKE_BUILD_TYPE=Debug`` for debugging sessions."
6582
msgstr ""
6683

67-
#: ../../../../docs/user_guide/build.rst:28
84+
#: ../../../../docs/user_guide/build.rst:39
6885
msgid "*A corresponding flag can be omitted if it's not needed.*"
6986
msgstr ""
7087

71-
#: ../../../../docs/user_guide/build.rst:30
88+
#: ../../../../docs/user_guide/build.rst:41
7289
msgid "**Build the project**:"
7390
msgstr ""
7491

75-
#: ../../../../docs/user_guide/build.rst:36
92+
#: ../../../../docs/user_guide/build.rst:47
7693
msgid "**Run tests**:"
7794
msgstr ""
7895

79-
#: ../../../../docs/user_guide/build.rst:38
96+
#: ../../../../docs/user_guide/build.rst:49
8097
msgid "Prefer the helper runner described in ``User Guide → CI``."
8198
msgstr ""
8299

@@ -88,4 +105,3 @@ msgstr ""
88105

89106
#~ msgid "Run ``<project's folder>/build/bin``"
90107
#~ msgstr ""
91-

docs/locale/ru/LC_MESSAGES/user_guide/build.po

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,49 @@ msgid "**Configure the build**: ``Makefile``, ``.sln``, etc."
3535
msgstr "**Конфигурация проекта**: ``Makefile``, ``.sln``, и т.д."
3636

3737
#: ../../../../docs/user_guide/build.rst:12
38+
msgid "To configure only selected tasks:"
39+
msgstr "Чтобы сконфигурировать только выбранные задачи:"
40+
41+
#: ../../../../docs/user_guide/build.rst:18
3842
msgid "Optional: enable sanitizers for local debugging"
3943
msgstr "Дополнительно: включите санитайзеры для локальной отладки"
4044

41-
#: ../../../../docs/user_guide/build.rst:18
45+
#: ../../../../docs/user_guide/build.rst:24
4246
msgid "*Help on CMake keys:*"
4347
msgstr "*Важные CMake ключи для конфигурации проекта:*"
4448

45-
#: ../../../../docs/user_guide/build.rst:21
49+
#: ../../../../docs/user_guide/build.rst:27
4650
msgid "``-D USE_FUNC_TESTS=ON`` enable functional tests."
4751
msgstr "``-D USE_FUNC_TESTS=ON`` включает функциональные тесты."
4852

49-
#: ../../../../docs/user_guide/build.rst:22
53+
#: ../../../../docs/user_guide/build.rst:28
5054
msgid "``-D USE_PERF_TESTS=ON`` enable performance tests."
5155
msgstr "``-D USE_PERF_TESTS=ON`` включает тесты на производительность."
5256

53-
#: ../../../../docs/user_guide/build.rst:23
57+
#: ../../../../docs/user_guide/build.rst:29
58+
msgid ""
59+
"``-D PPC_TASKS=all`` builds every task (default). Pass one task or a "
60+
"semicolon list, for example ``-D PPC_TASKS=\"example_threads;example_processes\"``, "
61+
"to limit the build."
62+
msgstr ""
63+
"``-D PPC_TASKS=all`` собирает все задачи (по умолчанию). Укажите одну "
64+
"задачу или список через точку с запятой, например "
65+
"``-D PPC_TASKS=\"example_threads;example_processes\"``, чтобы ограничить "
66+
"сборку."
67+
68+
#: ../../../../docs/user_guide/build.rst:32
69+
msgid ""
70+
"``-D PPC_IMPLEMENTATIONS=\"seq;omp\"`` select implementation folders to "
71+
"configure."
72+
msgstr ""
73+
"``-D PPC_IMPLEMENTATIONS=\"seq;omp\"`` выбирает папки реализаций для "
74+
"конфигурации."
75+
76+
#: ../../../../docs/user_guide/build.rst:34
5477
msgid "``-D CMAKE_BUILD_TYPE=Release`` normal build (default)."
5578
msgstr "``-D CMAKE_BUILD_TYPE=Release`` нормальная сборка (по умолчанию)."
5679

57-
#: ../../../../docs/user_guide/build.rst:24
80+
#: ../../../../docs/user_guide/build.rst:35
5881
msgid ""
5982
"``-D CMAKE_BUILD_TYPE=RelWithDebInfo`` recommended when using sanitizers "
6083
"or running ``valgrind`` to keep debug information."
@@ -63,25 +86,25 @@ msgstr ""
6386
"санитайзеров или запуске ``valgrind`` для сохранения отладочной "
6487
"информации."
6588

66-
#: ../../../../docs/user_guide/build.rst:26
89+
#: ../../../../docs/user_guide/build.rst:37
6790
msgid "``-D CMAKE_BUILD_TYPE=Debug`` for debugging sessions."
6891
msgstr "``-D CMAKE_BUILD_TYPE=Debug`` используется при отладке."
6992

70-
#: ../../../../docs/user_guide/build.rst:28
93+
#: ../../../../docs/user_guide/build.rst:39
7194
msgid "*A corresponding flag can be omitted if it's not needed.*"
7295
msgstr ""
7396
"*Ряд CMake флагов может быть выключен, если они не требуются для "
7497
"выполнения работы.*"
7598

76-
#: ../../../../docs/user_guide/build.rst:30
99+
#: ../../../../docs/user_guide/build.rst:41
77100
msgid "**Build the project**:"
78101
msgstr "**Построение проекта**:"
79102

80-
#: ../../../../docs/user_guide/build.rst:36
103+
#: ../../../../docs/user_guide/build.rst:47
81104
msgid "**Run tests**:"
82105
msgstr "**Запуск тестов**:"
83106

84-
#: ../../../../docs/user_guide/build.rst:38
107+
#: ../../../../docs/user_guide/build.rst:49
85108
msgid "Prefer the helper runner described in ``User Guide → CI``."
86109
msgstr "Рекомендуется использовать вспомогательный раннер, описанный в «Инструкция → CI»."
87110

docs/user_guide/build.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Navigate to the project root.
99
1010
cmake -S . -B build -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON -D CMAKE_BUILD_TYPE=Release
1111
12+
To configure only selected tasks:
13+
14+
.. code-block:: bash
15+
16+
cmake -S . -B build -DPPC_TASKS="example_threads;example_processes" -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON -D CMAKE_BUILD_TYPE=Release
17+
1218
Optional: enable sanitizers for local debugging
1319

1420
.. code-block:: bash
@@ -20,6 +26,11 @@ Navigate to the project root.
2026

2127
- ``-D USE_FUNC_TESTS=ON`` enable functional tests.
2228
- ``-D USE_PERF_TESTS=ON`` enable performance tests.
29+
- ``-D PPC_TASKS=all`` builds every task (default). Pass one task or a semicolon list,
30+
for example ``-D PPC_TASKS="example_threads;example_processes"``, to limit
31+
the build.
32+
- ``-D PPC_IMPLEMENTATIONS="seq;omp"`` select implementation folders to
33+
configure.
2334
- ``-D CMAKE_BUILD_TYPE=Release`` normal build (default).
2435
- ``-D CMAKE_BUILD_TYPE=RelWithDebInfo`` recommended when using sanitizers or
2536
running ``valgrind`` to keep debug information.

tasks/CMakeLists.txt

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,31 @@ ppc_add_test(${PERF_TEST_EXEC} common/runners/performance.cpp USE_PERF_TESTS)
1616
# ——— List of implementations ————————————————————————————————————————
1717
set(PPC_IMPLEMENTATIONS "all;mpi;omp;seq;stl;tbb" CACHE STRING "Implementations to build (semicolon-separated)")
1818

19+
# ——— List of tasks ———————————————————————————————————————————————————
20+
set(PPC_TASKS "all" CACHE STRING "Tasks to build (semicolon-separated, or 'all')")
21+
1922
# ——— Configure each subproject —————————————————————————————————————
2023
file(
2124
GLOB subdirs
2225
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
2326
"${CMAKE_CURRENT_SOURCE_DIR}/*")
27+
set(available_tasks "")
2428
foreach(sub IN LISTS subdirs)
25-
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${sub}" AND NOT sub STREQUAL
26-
"common")
27-
ppc_configure_subproject(${sub})
29+
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${sub}" AND NOT sub STREQUAL "common")
30+
list(APPEND available_tasks "${sub}")
31+
endif()
32+
endforeach()
33+
list(SORT available_tasks)
34+
35+
set(selected_tasks ${PPC_TASKS})
36+
if(PPC_TASKS STREQUAL "all")
37+
set(selected_tasks ${available_tasks})
38+
endif()
39+
40+
foreach(sub IN LISTS selected_tasks)
41+
if(NOT sub IN_LIST available_tasks)
42+
string(JOIN ", " available_tasks_message ${available_tasks})
43+
message(FATAL_ERROR "Unknown PPC_TASKS entry '${sub}'. Available tasks: ${available_tasks_message}")
2844
endif()
45+
ppc_configure_subproject(${sub})
2946
endforeach()

0 commit comments

Comments
 (0)