Skip to content

Commit 56e41ab

Browse files
committed
opencv sh
1 parent 777fd86 commit 56e41ab

File tree

5 files changed

+66
-53
lines changed

5 files changed

+66
-53
lines changed

.github/workflows/main.yml

Lines changed: 22 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,13 @@ 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
116+
- run: ls -la .
117+
- run: ls -la ./install
118+
- run: ls -la ./install/bin
112119
- name: Run func tests (MPI, num_proc=1)
113120
run: |
114121
source scripts/run_mpi.sh
@@ -167,14 +174,14 @@ jobs:
167174
sudo apt-get install libomp-dev
168175
sudo apt-get install valgrind
169176
python3 -m pip install -r requirements.txt
170-
171177
- name: Download installed package
172178
uses: actions/download-artifact@v4
173179
with:
174180
name: ubuntu-gcc-install
175-
path: install
176-
- name: Add install/bin to PATH
177-
run: echo "$(pwd)/install/bin" >> $GITHUB_PATH
181+
- name: Extract installed package
182+
run: |
183+
mkdir -p install
184+
tar -xzvf ubuntu-gcc-install.tar.gz -C install
178185
- name: Run func tests (threads, num_threads=5)
179186
run: source scripts/run_threads.sh
180187
env:
@@ -238,7 +245,7 @@ jobs:
238245
cmake -S . -B build
239246
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
240247
-D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
241-
-D CMAKE_BUILD_TYPE=RELEASE
248+
-D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=install
242249
env:
243250
CC: clang-19
244251
CXX: clang++-19
@@ -248,8 +255,6 @@ jobs:
248255
env:
249256
CC: clang-19
250257
CXX: clang++-19
251-
- name: Add build/bin to PATH
252-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
253258
- name: Run func tests (MPI, num_proc=1)
254259
run: |
255260
source scripts/run_mpi.sh
@@ -320,7 +325,7 @@ jobs:
320325
cmake -S . -B build
321326
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
322327
-D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
323-
-D CMAKE_BUILD_TYPE=RELEASE
328+
-D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=install
324329
env:
325330
CC: clang-19
326331
CXX: clang++-19
@@ -330,8 +335,6 @@ jobs:
330335
env:
331336
CC: clang-19
332337
CXX: clang++-19
333-
- name: Add build/bin to PATH
334-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
335338
- name: Run tests (threads, num_threads=5)
336339
run: source scripts/run_threads.sh
337340
env:
@@ -394,7 +397,7 @@ jobs:
394397
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
395398
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
396399
-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
400+
-D CMAKE_BUILD_TYPE=RELEASE -D ENABLE_ADDRESS_SANITIZER=ON -D ENABLE_UB_SANITIZER=ON -DCMAKE_INSTALL_PREFIX=install
398401
env:
399402
CC: clang-19
400403
CXX: clang++-19
@@ -404,8 +407,6 @@ jobs:
404407
env:
405408
CC: clang-19
406409
CXX: clang++-19
407-
- name: Add build/bin to PATH
408-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
409410
- name: Run tests (MPI)
410411
run: |
411412
source scripts/run_mpi.sh "--oversubscribe"
@@ -473,7 +474,7 @@ jobs:
473474
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
474475
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
475476
-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
477+
-D CMAKE_BUILD_TYPE=RELEASE -D ENABLE_ADDRESS_SANITIZER=ON -D ENABLE_UB_SANITIZER=ON -DCMAKE_INSTALL_PREFIX=install
477478
env:
478479
CC: clang-19
479480
CXX: clang++-19
@@ -483,8 +484,6 @@ jobs:
483484
env:
484485
CC: clang-19
485486
CXX: clang++-19
486-
- name: Add build/bin to PATH
487-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
488487
- name: Run tests (threads, num_threads=5)
489488
run: source scripts/run_threads.sh
490489
env:
@@ -554,12 +553,10 @@ jobs:
554553
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
555554
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
556555
-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
556+
-D CMAKE_BUILD_TYPE=RELEASE -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON -DCMAKE_INSTALL_PREFIX=install
558557
- name: Build project
559558
run: |
560559
cmake --build build --parallel
561-
- name: Add build/bin to PATH
562-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
563560
- name: Run func tests (MPI, num_proc=1)
564561
run: |
565562
source scripts/run_mpi.sh
@@ -628,12 +625,10 @@ jobs:
628625
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
629626
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
630627
-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
628+
-D CMAKE_BUILD_TYPE=RELEASE -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON -DCMAKE_INSTALL_PREFIX=install
632629
- name: Build project
633630
run: |
634631
cmake --build build --parallel
635-
- name: Add build/bin to PATH
636-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
637632
- name: Run tests (threads, num_threads=5)
638633
run: source scripts/run_threads.sh
639634
env:
@@ -965,8 +960,6 @@ jobs:
965960
- name: Build project
966961
run: |
967962
cmake --build build --parallel
968-
- name: Add build/bin to PATH
969-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
970963
- name: Run tests (MPI)
971964
run: |
972965
source scripts/run_mpi.sh
@@ -1058,8 +1051,6 @@ jobs:
10581051
env:
10591052
CC: gcc-14
10601053
CXX: g++-14
1061-
- name: Add build/bin to PATH
1062-
run: echo "$(pwd)/build/bin" >> $GITHUB_PATH
10631054
- name: Run perf count checker
10641055
run: |
10651056
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)