Commit 86a47d70 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/build-options' into integration_2024_w49 (!3136)

Use ninja -k option in CI

Use ninja -k10 in the CI to keep going after build errors to see more errors
than just the first.
parents 393185df 9409348d
...@@ -48,6 +48,7 @@ CMAKE_BUILD_TYPE="RelWithDebInfo" ...@@ -48,6 +48,7 @@ CMAKE_BUILD_TYPE="RelWithDebInfo"
CMAKE_CMD="$CMAKE" CMAKE_CMD="$CMAKE"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope ldpc_cuda ldpc_t2 websrv oai_iqplayer imscope" OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope ldpc_cuda ldpc_t2 websrv oai_iqplayer imscope"
TARGET_LIST="" TARGET_LIST=""
BUILD_TOOL_OPT="-j$(nproc)"
function print_help() { function print_help() {
echo_info " echo_info "
...@@ -56,6 +57,8 @@ for a number of distributions (Ubuntu 22-24, Fedora, RHEL9). ...@@ -56,6 +57,8 @@ for a number of distributions (Ubuntu 22-24, Fedora, RHEL9).
Options: Options:
--arch-native --arch-native
Passes -march=native to the compiler. Passes -march=native to the compiler.
--build-tool-opt
Pass options to build tool (ninja/make), e.g. -k (\"keep going\")
-c | --clean -c | --clean
Erase all files to make a rebuild from start Erase all files to make a rebuild from start
-C | --clean-all -C | --clean-all
...@@ -160,6 +163,9 @@ function main() { ...@@ -160,6 +163,9 @@ function main() {
--arch-native) --arch-native)
echo_fatal "Error: specify --arch-native on the command line to cmake directly: ./build_oai --cmake-opt \"-DCMAKE_C_FLAGS=-march=native -DCMAKE_CXX_FLAGS=-march=native\"" echo_fatal "Error: specify --arch-native on the command line to cmake directly: ./build_oai --cmake-opt \"-DCMAKE_C_FLAGS=-march=native -DCMAKE_CXX_FLAGS=-march=native\""
shift;; shift;;
--build-tool-opt)
BUILD_TOOL_OPT+=" $2"
shift 2;;
-c | --clean) -c | --clean)
CLEAN=1 CLEAN=1
shift;; shift;;
...@@ -490,7 +496,7 @@ function main() { ...@@ -490,7 +496,7 @@ function main() {
CMAKE_CMD="$CMAKE_CMD ../../.." CMAKE_CMD="$CMAKE_CMD ../../.."
echo_info "Running \"$CMAKE_CMD\"" echo_info "Running \"$CMAKE_CMD\""
eval $CMAKE_CMD eval $CMAKE_CMD
compilations $BUILD_DIR all.txt $TARGET_LIST compilations $BUILD_DIR all.txt "$TARGET_LIST" "${BUILD_TOOL_OPT}"
################### ###################
# Doxygen Support # # Doxygen Support #
################### ###################
...@@ -513,9 +519,9 @@ function main() { ...@@ -513,9 +519,9 @@ function main() {
cd $DIR/nas_sim_tools/build cd $DIR/nas_sim_tools/build
${CMAKE_CMD% *} .. ${CMAKE_CMD% *} ..
compilations nas_sim_tools usim.txt usim compilations nas_sim_tools usim.txt "usim" "${BUILD_TOOL_OPT}"
compilations nas_sim_tools nvram.txt nvram compilations nas_sim_tools nvram.txt "nvram" "${BUILD_TOOL_OPT}"
compilations nas_sim_tools conf2uedata.txt conf2uedata compilations nas_sim_tools conf2uedata.txt "conf2uedata" "${BUILD_TOOL_OPT}"
# generate USIM data # generate USIM data
if [ -f conf2uedata ]; then if [ -f conf2uedata ]; then
......
...@@ -208,20 +208,20 @@ check_errors() { ...@@ -208,20 +208,20 @@ check_errors() {
} }
compilations() { compilations() {
[[ $# -gt 2 ]] || echo_fatal "compilations needs more than three arguments" [[ $# -eq 4 ]] || echo_fatal "compilations <dir> <logfile> <targets> <build-tool-opt>"
local dir=$1 local dir=$1
shift 1 local logfile=$2
local logfile=$1 local targets=$3
shift 1 local build_tool_opt=$4
local targets=$@
local verbose=$([ "$VERBOSE_COMPILE" == "1" ] && echo "-v" || echo "") local verbose=$([ "$VERBOSE_COMPILE" == "1" ] && echo "-v" || echo "")
echo cd $OPENAIR_DIR/cmake_targets/$dir/build echo cd $OPENAIR_DIR/cmake_targets/$dir/build
cd $OPENAIR_DIR/cmake_targets/$dir/build cd $OPENAIR_DIR/cmake_targets/$dir/build
echo_info "Running \"$CMAKE --build . $verbose --target $targets -- -j$(nproc)\"" $green cmd="$CMAKE --build . ${verbose} --target ${targets} -- ${build_tool_opt}"
echo_info "Running \"${cmd}\"" $green
echo "Log file for compilation is being written to: $dlog/$logfile" echo "Log file for compilation is being written to: $dlog/$logfile"
set +e set +e
{ {
$CMAKE --build . $verbose --target $targets -- -j$(nproc) eval ${cmd}
ret=$? ret=$?
} > $dlog/$logfile 2>&1 } > $dlog/$logfile 2>&1
# Print the errors and warnings for CI purposes # Print the errors and warnings for CI purposes
......
...@@ -44,6 +44,7 @@ RUN /bin/sh oaienv && \ ...@@ -44,6 +44,7 @@ RUN /bin/sh oaienv && \
--build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt \ --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt \
-DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \ -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \
--build-lib 'telnetsrv enbscope uescope nrscope' \ --build-lib 'telnetsrv enbscope uescope nrscope' \
--build-tool-opt -k10 \
-w USRP -t Ethernet \ -w USRP -t Ethernet \
--noavx512" && \ --noavx512" && \
echo "---- ldd on executables ----" && \ echo "---- ldd on executables ----" && \
......
...@@ -38,6 +38,7 @@ RUN /bin/sh oaienv && \ ...@@ -38,6 +38,7 @@ RUN /bin/sh oaienv && \
CXXFLAGS="-Werror -fstack-protector-strong" CFLAGS="-Werror -fstack-protector-strong" ./build_oai -c --ninja \ CXXFLAGS="-Werror -fstack-protector-strong" CFLAGS="-Werror -fstack-protector-strong" ./build_oai -c --ninja \
--eNB --gNB --RU --UE --nrUE \ --eNB --gNB --RU --UE --nrUE \
--build-lib "telnetsrv enbscope uescope nrscope" \ --build-lib "telnetsrv enbscope uescope nrscope" \
--build-tool-opt -k10 \
-w USRP -t Ethernet \ -w USRP -t Ethernet \
--noavx512 && \ --noavx512 && \
echo "---- ldd on executables ----" && \ echo "---- ldd on executables ----" && \
......
...@@ -45,6 +45,7 @@ RUN /bin/sh oaienv && \ ...@@ -45,6 +45,7 @@ RUN /bin/sh oaienv && \
-w USRP -t Ethernet \ -w USRP -t Ethernet \
--build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \ --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \
--noavx512 \ --noavx512 \
--build-tool-opt -k10 \
--cmake-opt -DCMAKE_C_FLAGS="-Werror" --cmake-opt -DCMAKE_CXX_FLAGS="-Werror" $BUILD_OPTION && \ --cmake-opt -DCMAKE_C_FLAGS="-Werror" --cmake-opt -DCMAKE_CXX_FLAGS="-Werror" $BUILD_OPTION && \
# Mainly to see if the sanitize option was perfectly executed # Mainly to see if the sanitize option was perfectly executed
echo "---- ldd on executables ----" && \ echo "---- ldd on executables ----" && \
......
...@@ -48,7 +48,7 @@ RUN /bin/sh oaienv && \ ...@@ -48,7 +48,7 @@ RUN /bin/sh oaienv && \
-DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" && \ -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" && \
echo "====== Start of log for cross-build executables ======" && \ echo "====== Start of log for cross-build executables ======" && \
# making always passing so we can analyze the all.txt file # making always passing so we can analyze the all.txt file
ninja dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim lte-softmodem nr-softmodem nr-cuup oairu lte-uesoftmodem nr-uesoftmodem params_libconfig coding rfsimulator telnetsrv > ../../log/all.txt 2>&1; \ ninja -k10 dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim lte-softmodem nr-softmodem nr-cuup oairu lte-uesoftmodem nr-uesoftmodem params_libconfig coding rfsimulator telnetsrv > ../../log/all.txt 2>&1; \
# displaying errors and warnings # displaying errors and warnings
grep -E -A3 "warning:|error:" ../../log/all.txt || true && \ grep -E -A3 "warning:|error:" ../../log/all.txt || true && \
# will fail only if string "errors:" is found # will fail only if string "errors:" is found
......
...@@ -40,4 +40,7 @@ RUN /bin/sh oaienv && \ ...@@ -40,4 +40,7 @@ RUN /bin/sh oaienv && \
mkdir -p log && \ mkdir -p log && \
export CC=/usr/bin/clang && \ export CC=/usr/bin/clang && \
export CXX=/usr/bin/clang++ && \ export CXX=/usr/bin/clang++ && \
CFLAGS="-Werror" CXXFLAGS="-Werror -Wno-vla-cxx-extension" ./build_oai --phy_simulators --gNB --eNB --nrUE --UE --ninja --noavx512 --disable-T-Tracer -c CFLAGS="-Werror" CXXFLAGS="-Werror -Wno-vla-cxx-extension" \
./build_oai --phy_simulators --gNB --eNB --nrUE --UE \
--ninja --build-tool-opt -k10 \
--noavx512 --disable-T-Tracer -c
...@@ -54,7 +54,7 @@ RUN /bin/sh oaienv && \ ...@@ -54,7 +54,7 @@ RUN /bin/sh oaienv && \
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
mkdir -p log && \ mkdir -p log && \
./build_oai -c -w AERIAL --gNB --ninja \ ./build_oai -c -w AERIAL --gNB --ninja --build-tool-opt -k10 \
--cmake-opt -DCMAKE_C_FLAGS="-Werror" --cmake-opt -DCMAKE_CXX_FLAGS="-Werror" --cmake-opt -DCMAKE_C_FLAGS="-Werror" --cmake-opt -DCMAKE_CXX_FLAGS="-Werror"
......
...@@ -38,7 +38,7 @@ RUN dnf install -y libasan libubsan ...@@ -38,7 +38,7 @@ RUN dnf install -y libasan libubsan
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
mkdir -p log && \ mkdir -p log && \
./build_oai --phy_simulators --ninja --sanitize --noavx512 -c --cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror ./build_oai --phy_simulators --ninja --build-tool-opt -k10 --sanitize --noavx512 -c --cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror
#start from scratch for target executable #start from scratch for target executable
FROM registry.access.redhat.com/ubi9/ubi:latest AS oai-physim FROM registry.access.redhat.com/ubi9/ubi:latest AS oai-physim
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment