Skip to content

Commit e827969

Browse files
committed
opencv sh
1 parent 777fd86 commit e827969

File tree

7 files changed

+59
-53
lines changed

7 files changed

+59
-53
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ jobs:
107107
with:
108108
name: ubuntu-gcc-install
109109
path: install
110-
- name: Add install/bin to PATH
111-
run: echo "$(pwd)/install/bin" >> $GITHUB_PATH
110+
- run: ls -la .
111+
- run: ls -la install
112+
- run: ls -la install/bin
112113
- name: Run func tests (MPI, num_proc=1)
113114
run: |
114115
source scripts/run_mpi.sh
@@ -173,8 +174,6 @@ jobs:
173174
with:
174175
name: ubuntu-gcc-install
175176
path: install
176-
- name: Add install/bin to PATH
177-
run: echo "$(pwd)/install/bin" >> $GITHUB_PATH
178177
- name: Run func tests (threads, num_threads=5)
179178
run: source scripts/run_threads.sh
180179
env:
@@ -238,7 +237,7 @@ jobs:
238237
cmake -S . -B build
239238
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
240239
-D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
241-
-D CMAKE_BUILD_TYPE=RELEASE
240+
-D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=install
242241
env:
243242
CC: clang-19
244243
CXX: clang++-19
@@ -248,8 +247,6 @@ jobs:
248247
env:
249248
CC: clang-19
250249
CXX: clang++-19
251-
- name: Add build/bin to PATH
252-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
253250
- name: Run func tests (MPI, num_proc=1)
254251
run: |
255252
source scripts/run_mpi.sh
@@ -320,7 +317,7 @@ jobs:
320317
cmake -S . -B build
321318
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
322319
-D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
323-
-D CMAKE_BUILD_TYPE=RELEASE
320+
-D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=install
324321
env:
325322
CC: clang-19
326323
CXX: clang++-19
@@ -330,8 +327,6 @@ jobs:
330327
env:
331328
CC: clang-19
332329
CXX: clang++-19
333-
- name: Add build/bin to PATH
334-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
335330
- name: Run tests (threads, num_threads=5)
336331
run: source scripts/run_threads.sh
337332
env:
@@ -394,7 +389,7 @@ jobs:
394389
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
395390
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
396391
-D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
397-
-D CMAKE_BUILD_TYPE=RELEASE -D ENABLE_ADDRESS_SANITIZER=ON -D ENABLE_UB_SANITIZER=ON
392+
-D CMAKE_BUILD_TYPE=RELEASE -D ENABLE_ADDRESS_SANITIZER=ON -D ENABLE_UB_SANITIZER=ON -DCMAKE_INSTALL_PREFIX=install
398393
env:
399394
CC: clang-19
400395
CXX: clang++-19
@@ -404,8 +399,6 @@ jobs:
404399
env:
405400
CC: clang-19
406401
CXX: clang++-19
407-
- name: Add build/bin to PATH
408-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
409402
- name: Run tests (MPI)
410403
run: |
411404
source scripts/run_mpi.sh "--oversubscribe"
@@ -473,7 +466,7 @@ jobs:
473466
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
474467
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
475468
-D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
476-
-D CMAKE_BUILD_TYPE=RELEASE -D ENABLE_ADDRESS_SANITIZER=ON -D ENABLE_UB_SANITIZER=ON
469+
-D CMAKE_BUILD_TYPE=RELEASE -D ENABLE_ADDRESS_SANITIZER=ON -D ENABLE_UB_SANITIZER=ON -DCMAKE_INSTALL_PREFIX=install
477470
env:
478471
CC: clang-19
479472
CXX: clang++-19
@@ -483,8 +476,6 @@ jobs:
483476
env:
484477
CC: clang-19
485478
CXX: clang++-19
486-
- name: Add build/bin to PATH
487-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
488479
- name: Run tests (threads, num_threads=5)
489480
run: source scripts/run_threads.sh
490481
env:
@@ -554,12 +545,10 @@ jobs:
554545
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
555546
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
556547
-DCMAKE_C_FLAGS="-I$(brew --prefix)/opt/libomp/include" -DCMAKE_CXX_FLAGS="-I$(brew --prefix)/opt/libomp/include"
557-
-D CMAKE_BUILD_TYPE=RELEASE -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
548+
-D CMAKE_BUILD_TYPE=RELEASE -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON -DCMAKE_INSTALL_PREFIX=install
558549
- name: Build project
559550
run: |
560551
cmake --build build --parallel
561-
- name: Add build/bin to PATH
562-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
563552
- name: Run func tests (MPI, num_proc=1)
564553
run: |
565554
source scripts/run_mpi.sh
@@ -628,12 +617,10 @@ jobs:
628617
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
629618
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
630619
-DCMAKE_C_FLAGS="-I$(brew --prefix)/opt/libomp/include" -DCMAKE_CXX_FLAGS="-I$(brew --prefix)/opt/libomp/include"
631-
-D CMAKE_BUILD_TYPE=RELEASE -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
620+
-D CMAKE_BUILD_TYPE=RELEASE -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON -DCMAKE_INSTALL_PREFIX=install
632621
- name: Build project
633622
run: |
634623
cmake --build build --parallel
635-
- name: Add build/bin to PATH
636-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
637624
- name: Run tests (threads, num_threads=5)
638625
run: source scripts/run_threads.sh
639626
env:
@@ -965,8 +952,6 @@ jobs:
965952
- name: Build project
966953
run: |
967954
cmake --build build --parallel
968-
- name: Add build/bin to PATH
969-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
970955
- name: Run tests (MPI)
971956
run: |
972957
source scripts/run_mpi.sh
@@ -1058,8 +1043,6 @@ jobs:
10581043
env:
10591044
CC: gcc-14
10601045
CXX: g++-14
1061-
- name: Add build/bin to PATH
1062-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
10631046
- name: Run perf count checker
10641047
run: |
10651048
source scripts/run_perf_count_checker.sh

cmake/onetbb.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@ if( USE_TBB )
2828
BUILD_COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/build" --config ${CMAKE_BUILD_TYPE} --parallel
2929
INSTALL_COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/build" --prefix "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/install")
3030
endif()
31+
add_custom_command(TARGET ppc_onetbb POST_BUILD
32+
COMMAND ${CMAKE_COMMAND} -E copy_directory
33+
"${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/install"
34+
"${CMAKE_INSTALL_PREFIX}"
35+
)
3136
endif( USE_TBB )

cmake/opencv.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ else()
2828
BUILD_COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/ppc_opencv/build" --config ${CMAKE_BUILD_TYPE} --parallel
2929
INSTALL_COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_CURRENT_BINARY_DIR}/ppc_opencv/build" --prefix "${CMAKE_CURRENT_BINARY_DIR}/ppc_opencv/install")
3030
endif()
31+
add_custom_command(TARGET ppc_opencv POST_BUILD
32+
COMMAND ${CMAKE_COMMAND} -E copy_directory
33+
"${CMAKE_CURRENT_BINARY_DIR}/ppc_opencv/install"
34+
"${CMAKE_INSTALL_PREFIX}"
35+
)

modules/ref/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ add_test(NAME ${exec_func_tests} COMMAND ${exec_func_tests})
4545

4646
# Installation rules
4747
install(TARGETS ${exec_func_lib}
48-
ARCHIVE DESTINATION lib
49-
LIBRARY DESTINATION lib
50-
RUNTIME DESTINATION bin)
48+
ARCHIVE DESTINATION lib
49+
LIBRARY DESTINATION lib
50+
RUNTIME DESTINATION bin)
5151

5252
install(TARGETS ${exec_func_tests}
53-
RUNTIME DESTINATION bin)
53+
RUNTIME DESTINATION bin
54+
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ)

scripts/run_mpi.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
#!/bin/bash
2-
source build/ppc_opencv/install/bin/setup_vars_opencv4.sh
2+
if [[ -f build/ppc_opencv/install/bin/setup_vars_opencv4.sh ]]; then
3+
INSTALL_BIN_DIR="build/bin"
4+
source build/ppc_opencv/install/bin/setup_vars_opencv4.sh
5+
else
6+
INSTALL_BIN_DIR="install/bin"
7+
source $INSTALL_BIN_DIR/setup_vars_opencv4.sh
8+
fi
39

410
if [[ $OSTYPE == "linux-gnu" && -z "$ASAN_RUN" ]]; then
5-
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all core_func_tests
6-
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all ref_func_tests
11+
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all $INSTALL_BIN_DIR/core_func_tests
12+
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all $INSTALL_BIN_DIR/ref_func_tests
713

8-
# valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all all_func_tests
9-
# valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all mpi_func_tests
14+
# valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all $INSTALL_BIN_DIR/all_func_tests
15+
# valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all $INSTALL_BIN_DIR/mpi_func_tests
1016
fi
1117

12-
core_func_tests --gtest_also_run_disabled_tests --gtest_repeat=10 --gtest_recreate_environments_when_repeating
13-
ref_func_tests --gtest_also_run_disabled_tests --gtest_repeat=10 --gtest_recreate_environments_when_repeating
18+
$INSTALL_BIN_DIR/core_func_tests --gtest_also_run_disabled_tests --gtest_repeat=10 --gtest_recreate_environments_when_repeating
19+
$INSTALL_BIN_DIR/ref_func_tests --gtest_also_run_disabled_tests --gtest_repeat=10 --gtest_recreate_environments_when_repeating
1420

1521
if [[ -z "$ASAN_RUN" ]]; then
16-
mpirun $1 -np $PROC_COUNT all_func_tests --gtest_also_run_disabled_tests --gtest_repeat=10 --gtest_recreate_environments_when_repeating
17-
mpirun $1 -np $PROC_COUNT mpi_func_tests --gtest_also_run_disabled_tests --gtest_repeat=10 --gtest_recreate_environments_when_repeating
22+
mpirun $1 -np $PROC_COUNT $INSTALL_BIN_DIR/all_func_tests --gtest_also_run_disabled_tests --gtest_repeat=10 --gtest_recreate_environments_when_repeating
23+
mpirun $1 -np $PROC_COUNT $INSTALL_BIN_DIR/mpi_func_tests --gtest_also_run_disabled_tests --gtest_repeat=10 --gtest_recreate_environments_when_repeating
1824
fi

scripts/run_threads.sh

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
#!/bin/bash
2-
source build/ppc_opencv/install/bin/setup_vars_opencv4.sh
2+
if [[ -f build/ppc_opencv/install/bin/setup_vars_opencv4.sh ]]; then
3+
INSTALL_BIN_DIR="build/bin"
4+
source build/ppc_opencv/install/bin/setup_vars_opencv4.sh
5+
else
6+
INSTALL_BIN_DIR="install/bin"
7+
source $INSTALL_BIN_DIR/setup_vars_opencv4.sh
8+
fi
39

410
if [[ $OSTYPE == "linux-gnu" && -z "$ASAN_RUN" ]]; then
5-
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all core_func_tests
6-
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all ref_func_tests
11+
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all $INSTALL_BIN_DIR/core_func_tests
12+
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all $INSTALL_BIN_DIR/ref_func_tests
713

8-
# valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all omp_func_tests
9-
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all seq_func_tests
10-
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all stl_func_tests
11-
# valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all tbb_func_tests
14+
# valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all $INSTALL_BIN_DIR/omp_func_tests
15+
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all $INSTALL_BIN_DIR/seq_func_tests
16+
valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all $INSTALL_BIN_DIR/stl_func_tests
17+
# valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all $INSTALL_BIN_DIR/tbb_func_tests
1218
fi
1319

14-
core_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
15-
ref_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
20+
$INSTALL_BIN_DIR/core_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
21+
$INSTALL_BIN_DIR/ref_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
1622

17-
omp_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
18-
seq_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
19-
stl_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
20-
tbb_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
23+
$INSTALL_BIN_DIR/omp_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
24+
$INSTALL_BIN_DIR/seq_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
25+
$INSTALL_BIN_DIR/stl_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating
26+
$INSTALL_BIN_DIR/tbb_func_tests --gtest_also_run_disabled_tests --gtest_repeat=3 --gtest_recreate_environments_when_repeating

tasks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ foreach(TASK_TYPE ${LIST_OF_TASKS})
171171
add_test(NAME ${EXEC_FUNC} COMMAND ${EXEC_FUNC})
172172

173173
# Install the executable
174-
install(TARGETS ${EXEC_FUNC} RUNTIME DESTINATION bin)
174+
install(TARGETS ${EXEC_FUNC} RUNTIME DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
175175
endforeach ()
176176

177177
# Install the library

0 commit comments

Comments
 (0)