From d9a5866bcd89d37d811204e750aaca255ff6ba01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Soares=20Silva?= Date: Tue, 15 Oct 2024 16:48:23 +0100 Subject: [PATCH 1/5] Address warning unused variable 'tw512_128p' --- openair1/PHY/TOOLS/oai_dfts_neon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/TOOLS/oai_dfts_neon.c b/openair1/PHY/TOOLS/oai_dfts_neon.c index 5b72359179..b920f6aae4 100644 --- a/openair1/PHY/TOOLS/oai_dfts_neon.c +++ b/openair1/PHY/TOOLS/oai_dfts_neon.c @@ -1549,7 +1549,7 @@ void dft512(int16_t *x,int16_t *y,unsigned char scale) { simdshort_q15_t xtmp[256],*xtmpp,*x64 = (simdshort_q15_t *)x; - simd_q15_t ytmp[128],*tw512_128p=(simd_q15_t*)tw512,*tw512a_128p=(simd_q15_t *)tw512a,*tw512b_128p=(simd_q15_t *)tw512b,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; + simd_q15_t ytmp[128],*tw512a_128p=(simd_q15_t *)tw512a,*tw512b_128p=(simd_q15_t *)tw512b,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i; simd_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16(ONE_OVER_SQRT2_Q15); From b46e20abb96816bd8c0c98e649bd83d353e8ddc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Soares=20Silva?= Date: Tue, 15 Oct 2024 17:55:03 +0100 Subject: [PATCH 2/5] Address warnings in lte-enb.c by changing oai_cputime_t type. Since long long is the bigger type ( 8 bytes ) of the two used ( long long and uint32_t ), and long long is also available on ARM, change this parameter to always have this type. This allows to always use format specifier '%lld' in the logs that use TICK_TO_US, which would otherwise return long long or uint32_t depending on architecture. --- common/utils/time_meas.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/utils/time_meas.h b/common/utils/time_meas.h index bc37104a60..f7c2810b60 100644 --- a/common/utils/time_meas.h +++ b/common/utils/time_meas.h @@ -35,10 +35,8 @@ extern int cpu_meas_enabled; extern double cpu_freq_GHz __attribute__ ((aligned(32)));; // structure to store data to compute cpu measurment -#if defined(__x86_64__) || defined(__i386__) +#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__) typedef long long oai_cputime_t; -#elif defined(__arm__) || defined(__aarch64__) - typedef uint32_t oai_cputime_t; #else #error "building on unsupported CPU architecture" #endif From 57cccd633f1abe66a9ab9dc135eefd5c8b7076aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Soares=20Silva?= Date: Tue, 15 Oct 2024 19:26:51 +0100 Subject: [PATCH 3/5] Correctly cast qam64_qam64 parameters in dlsch_llr_computation.c Change call to qam64_qam64 to use (short *) parameters as defined in the function declaration --- .../PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c index c3c3f0d006..094b1ef8d5 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c @@ -8010,12 +8010,12 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, (int32_t *) rho_256i, len); #else // defined(__arm__) || defined(__aarch64__) - qam64_qam64((int32_t *)rxF_256i, - (int32_t *)rxF_i_256i, - (int32_t *)ch_mag_256i, - (int32_t *)ch_mag_i_256i, - (int16_t *)llr16, - (int32_t *) rho_256i, + qam64_qam64((short *)rxF_256i, + (short *)rxF_i_256i, + (short *)ch_mag_256i, + (short *)ch_mag_i_256i, + (short *)llr16, + (short *) rho_256i, len); #endif From 99d251b29df6f701ab7cf45d8af33ac46304e4a3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 16 Oct 2024 20:09:56 +0200 Subject: [PATCH 4/5] Correct pkg-config include path when cross-compiling Prior to this commit, the include path for some libraries found through pkg-config when cross compiling is not correct: $ grep include CMakeCache.txt blas_INCLUDEDIR:INTERNAL=/usr/include/x86_64-linux-gnu ... This is because we did not tell pkg-config to search in the right path. Since for cross-compilation, we install packages in parallel in the system, override the primary directory where the .pc files located, in the cross-compilation toolchain file for cmake. Closes: #746 --- cmake_targets/cross-arm.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake_targets/cross-arm.cmake b/cmake_targets/cross-arm.cmake index 5384c09c5a..9480fc0fe0 100644 --- a/cmake_targets/cross-arm.cmake +++ b/cmake_targets/cross-arm.cmake @@ -4,6 +4,8 @@ set(CMAKE_SYSTEM_PROCESSOR arm) set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc-11) set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++-11) +set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/aarch64-linux-gnu/pkgconfig") + set(CROSS_COMPILE 1) set(bnProc_gen_128_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build) set(bnProc_gen_avx2_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build) From 312f23189a6ee6d2ae660244866fa2490609c594 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 17 Oct 2024 14:14:57 +0200 Subject: [PATCH 5/5] Cross-build: add -Werror for CI build --- docker/Dockerfile.build.ubuntu22.cross-arm64 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.build.ubuntu22.cross-arm64 b/docker/Dockerfile.build.ubuntu22.cross-arm64 index 16090c87e8..7b145fdc5b 100644 --- a/docker/Dockerfile.build.ubuntu22.cross-arm64 +++ b/docker/Dockerfile.build.ubuntu22.cross-arm64 @@ -43,7 +43,9 @@ RUN /bin/sh oaienv && \ cd ../build-cross/ && \ # install missing libyaml-cpp-dev for arm64 apt install -y libyaml-cpp-dev:arm64 && \ - cmake ../../.. -GNinja -DCMAKE_TOOLCHAIN_FILE=../../../cmake_targets/cross-arm.cmake -DNATIVE_DIR=../build && \ + cmake ../../.. -GNinja \ + -DCMAKE_TOOLCHAIN_FILE=../../../cmake_targets/cross-arm.cmake -DNATIVE_DIR=../build \ + -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" && \ echo "====== Start of log for cross-build executables ======" && \ # 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 > ../../log/all.txt 2>&1; \