Skip to content

Commit 6a4f6a5

Browse files
committed
opencv sh
1 parent 777fd86 commit 6a4f6a5

File tree

5 files changed

+63
-53
lines changed

5 files changed

+63
-53
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,14 @@ jobs:
7979
- name: Install project
8080
run: |
8181
cmake --build build --target install
82+
- name: Archive installed package
83+
run: |
84+
tar -czvf ubuntu-gcc-install.tar.gz -C install .
8285
- name: Upload installed package
83-
uses: actions/upload-artifact@v4.3.0
86+
uses: actions/upload-artifact@v4
8487
with:
8588
name: ubuntu-gcc-install
86-
path: install
89+
path: ubuntu-gcc-install.tar.gz
8790
ubuntu-gcc-test:
8891
needs:
8992
- ubuntu-gcc-build
@@ -106,9 +109,10 @@ jobs:
106109
uses: actions/download-artifact@v4
107110
with:
108111
name: ubuntu-gcc-install
109-
path: install
110-
- name: Add install/bin to PATH
111-
run: echo "$(pwd)/install/bin" >> $GITHUB_PATH
112+
- name: Extract installed package
113+
run: |
114+
mkdir -p install
115+
tar -xzvf ubuntu-gcc-install.tar.gz -C install
112116
- name: Run func tests (MPI, num_proc=1)
113117
run: |
114118
source scripts/run_mpi.sh
@@ -167,14 +171,14 @@ jobs:
167171
sudo apt-get install libomp-dev
168172
sudo apt-get install valgrind
169173
python3 -m pip install -r requirements.txt
170-
171174
- name: Download installed package
172175
uses: actions/download-artifact@v4
173176
with:
174177
name: ubuntu-gcc-install
175-
path: install
176-
- name: Add install/bin to PATH
177-
run: echo "$(pwd)/install/bin" >> $GITHUB_PATH
178+
- name: Extract installed package
179+
run: |
180+
mkdir -p install
181+
tar -xzvf ubuntu-gcc-install.tar.gz -C install
178182
- name: Run func tests (threads, num_threads=5)
179183
run: source scripts/run_threads.sh
180184
env:
@@ -238,7 +242,7 @@ jobs:
238242
cmake -S . -B build
239243
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
240244
-D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
241-
-D CMAKE_BUILD_TYPE=RELEASE
245+
-D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=install
242246
env:
243247
CC: clang-19
244248
CXX: clang++-19
@@ -248,8 +252,6 @@ jobs:
248252
env:
249253
CC: clang-19
250254
CXX: clang++-19
251-
- name: Add build/bin to PATH
252-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
253255
- name: Run func tests (MPI, num_proc=1)
254256
run: |
255257
source scripts/run_mpi.sh
@@ -320,7 +322,7 @@ jobs:
320322
cmake -S . -B build
321323
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
322324
-D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
323-
-D CMAKE_BUILD_TYPE=RELEASE
325+
-D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=install
324326
env:
325327
CC: clang-19
326328
CXX: clang++-19
@@ -330,8 +332,6 @@ jobs:
330332
env:
331333
CC: clang-19
332334
CXX: clang++-19
333-
- name: Add build/bin to PATH
334-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
335335
- name: Run tests (threads, num_threads=5)
336336
run: source scripts/run_threads.sh
337337
env:
@@ -394,7 +394,7 @@ jobs:
394394
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
395395
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
396396
-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
397+
-D CMAKE_BUILD_TYPE=RELEASE -D ENABLE_ADDRESS_SANITIZER=ON -D ENABLE_UB_SANITIZER=ON -DCMAKE_INSTALL_PREFIX=install
398398
env:
399399
CC: clang-19
400400
CXX: clang++-19
@@ -404,8 +404,6 @@ jobs:
404404
env:
405405
CC: clang-19
406406
CXX: clang++-19
407-
- name: Add build/bin to PATH
408-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
409407
- name: Run tests (MPI)
410408
run: |
411409
source scripts/run_mpi.sh "--oversubscribe"
@@ -473,7 +471,7 @@ jobs:
473471
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
474472
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
475473
-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
474+
-D CMAKE_BUILD_TYPE=RELEASE -D ENABLE_ADDRESS_SANITIZER=ON -D ENABLE_UB_SANITIZER=ON -DCMAKE_INSTALL_PREFIX=install
477475
env:
478476
CC: clang-19
479477
CXX: clang++-19
@@ -483,8 +481,6 @@ jobs:
483481
env:
484482
CC: clang-19
485483
CXX: clang++-19
486-
- name: Add build/bin to PATH
487-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
488484
- name: Run tests (threads, num_threads=5)
489485
run: source scripts/run_threads.sh
490486
env:
@@ -554,12 +550,10 @@ jobs:
554550
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
555551
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
556552
-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
553+
-D CMAKE_BUILD_TYPE=RELEASE -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON -DCMAKE_INSTALL_PREFIX=install
558554
- name: Build project
559555
run: |
560556
cmake --build build --parallel
561-
- name: Add build/bin to PATH
562-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
563557
- name: Run func tests (MPI, num_proc=1)
564558
run: |
565559
source scripts/run_mpi.sh
@@ -628,12 +622,10 @@ jobs:
628622
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
629623
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
630624
-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
625+
-D CMAKE_BUILD_TYPE=RELEASE -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON -DCMAKE_INSTALL_PREFIX=install
632626
- name: Build project
633627
run: |
634628
cmake --build build --parallel
635-
- name: Add build/bin to PATH
636-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
637629
- name: Run tests (threads, num_threads=5)
638630
run: source scripts/run_threads.sh
639631
env:
@@ -965,8 +957,6 @@ jobs:
965957
- name: Build project
966958
run: |
967959
cmake --build build --parallel
968-
- name: Add build/bin to PATH
969-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
970960
- name: Run tests (MPI)
971961
run: |
972962
source scripts/run_mpi.sh
@@ -1058,8 +1048,6 @@ jobs:
10581048
env:
10591049
CC: gcc-14
10601050
CXX: g++-14
1061-
- name: Add build/bin to PATH
1062-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
10631051
- name: Run perf count checker
10641052
run: |
10651053
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+
)

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

0 commit comments

Comments
 (0)