diff --git a/.github/workflows/volk_android.yml b/.github/workflows/volk_android.yml new file mode 100644 index 000000000..ebdf9fc9d --- /dev/null +++ b/.github/workflows/volk_android.yml @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: GPL-3.0-or-later +# SPDX-FileCopyrightText: 2022 Carles Fernandez-Prades +on: + push: + paths: + - 'src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/**' + workflow_dispatch: + pull_request: + paths: + - 'src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/**' + workflow_dispatch: + +name: Build volk-gnssdr on Android NDK +jobs: + build: + name: Build on Android NDK ${{ matrix.arch.name }} + + strategy: + fail-fast: false + matrix: + arch: + - { name: armeabi-v7a, allow_fail: false } + - { name: arm64-v8a, allow_fail: false } + - { name: x86, allow_fail: false } + - { name: x86_64, allow_fail: false } + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3.0.0 + + - name: Update repositories + run: sudo apt update + + # All dependencies + - name: Install dependencies + run: sudo apt install -y cmake openjdk-11-jre-headless wget unzip make python3-mako + + # Setup Android SDK, and auto-accept licenses + - name: Install Android SDK + run: wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip && mkdir android-sdk-linux && unzip -qq android-sdk.zip -d android-sdk-linux && export ANDROID_HOME=./android-sdk-linux && echo y | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=android-sdk-linux --update && (echo y; echo y; echo y; echo y; echo y; echo y; echo y; echo y) | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=android-sdk-linux --licenses + + # Call SDKManager to install the Android NDK + - name: Install Android NDK + run: $GITHUB_WORKSPACE/android-sdk-linux/cmdline-tools/bin/sdkmanager --sdk_root=$GITHUB_WORKSPACE/android-sdk-linux --install "ndk;24.0.8215888" --channel=3 + + # Setup build directory + - name: Setup ${{ matrix.arch.name }} + shell: bash + run: cd $GITHUB_WORKSPACE/ && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-sdk-linux/ndk/24.0.8215888/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.arch.name }} -DANDROID_PLATFORM=android-24 ../src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + + # Build + - name: Build ${{ matrix.arch.name }} + shell: bash + run: cd $GITHUB_WORKSPACE/build && make + continue-on-error: ${{ matrix.arch.allow_fail }} diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index d3446b11b..8bd243f85 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -209,7 +209,7 @@ message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") set(VERSION_INFO_MAJOR_VERSION 0) set(VERSION_INFO_MINOR_VERSION 0) -set(VERSION_INFO_MAINT_VERSION 17) +set(VERSION_INFO_MAINT_VERSION 17.git) include(VolkGnsssdrVersion) # setup version info diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h index 0af2194e2..ed6bb85de 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h @@ -72,7 +72,7 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_g lv_32fc_t phase_doppler = (*phase); int n_vec; unsigned int n; -#if _WIN32 +#if _WIN32 || __ANDROID_API__ const float arga = cargf(phase_inc_rate); #endif for (n_vec = 0; n_vec < num_a_vectors; n_vec++) @@ -92,7 +92,7 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_g } tmp32_1 = *in_common++ * (*phase); phase_doppler *= phase_inc; -#if _WIN32 +#if _WIN32 || __ANDROID_API__ const float theta = (float)(n * n) * arga; phase_doppler_rate = lv_cmake(cosf(theta), sinf(theta)); #else