BelledonneCommunications / linphone-sdk

Mirror for linphone-sdk (https://gitlab.linphone.org/BC/public/linphone-sdk.git)
GNU Affero General Public License v3.0
99 stars 79 forks source link

locally built sdk for linphone android #94

Open gregperezz opened 3 years ago

gregperezz commented 3 years ago

Hi @Viish, I am trying to build the latest linphone sdk master code locally. I still can build the version I downloaded on October without any change. However the new code generates an error. cmake --build . gives the error below. I don't have a /usr/local/android-arm64 folder. Why does it try to use that? (As I said, I configure the previous code exactly the same way and still successfully build it)

CMake Error at configs/config-android.cmake:141 (file): file COPY cannot copy file "/Users/greg/Tools/android-ndk-r21d/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so" to "/usr/local/android-arm64/lib//libc++_shared.so": No such file or directory. Call Stack (most recent call first): CMakeLists.txt:65 (include)

Thanks in advance.

Viish commented 3 years ago

Hi, What version of cmake are you using? What are your cmake command line with arguments? Can you attach the full build logs?

gregperezz commented 3 years ago

Cmake version is 3.18.3. I export ANDROID_HOME sdk path, ANDROID_NDK_HOME ndk path. Also export Android/sdk/tools/bin, android-ndk-r21d, sdk/tools and sdk/platform-tools. cmake .. -DLINPHONESDK_PLATFORM=Android -DLINPHONESDK_ANDROID_ARCHS="arm64, armv7, x86_64, x86" -DENABLE_G729=ON -DENABLE_G729B_CNG=ON -DENABLE_VIDEO=ON -DENABLE_ADVANCED_IM=ON -DENABLE_DB_STORAGE=ON cmake --build .

I retried and got the same error now for android-x86. Here are the logs.

CMakeOutput.log

Viish commented 3 years ago

Your cmake output log doesn't contains much. Please attach all the output in your shell.

gregperezz commented 3 years ago

Here they are:

Bakis-MacBook-Pro:build greg$ cmake .. -DLINPHONESDK_PLATFORM=Android -DLINPHONESDK_ANDROID_ARCHS -DENABLE_G729=ON -DENABLE_G729B_CNG=ON -DENABLE_VIDEO=ON -DENABLE_ADVANCED_IM=ON -DENABLE_DB_STORAGE=ON CMake Error: Parse error in command line argument: -DLINPHONESDK_ANDROID_ARCHS Should be: VAR:type=value

CMake Error: Problem processing arguments. Aborting.

Bakis-MacBook-Pro:build greg$ cmake .. -DLINPHONESDK_PLATFORM=Android -DENABLE_G729=ON -DENABLE_G729B_CNG=ON -DENABLE_VIDEO=ON -DENABLE_ADVANCED_IM=ON -DENABLE_DB_STORAGE=ON -- 'pystache' python module found -- 'six' python module found -- Enabled features:

-- Disabled features:

-- Configuring done -- Generating done -- Build files have been written to: /Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build Bakis-MacBook-Pro:build greg$ cmake --build .

Configure project : Old java wrapper detected, adding it to sources and removing some incompatible classes

Task :clean UP-TO-DATE

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 538ms 1 actionable task: 1 up-to-date [ 0%] Built target gradle-clean [ 2%] Performing configure step for 'android-x86' loading initial cache file /Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build/android-x86-prefix/tmp/android-x86-cache-RelWithDebInfo.cmake CMake Warning (dev) in CMakeLists.txt: No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as

project(ProjectName)

near the top of the file, but after cmake_minimum_required().

CMake is pretending there is a "project(Project)" command on the first line. This warning is for project developers. Use -Wno-dev to suppress it.

-- Using toolchain file '/Users/greg/Downloads/linphoneSDK041220/linphone-sdk/cmake-builder/toolchains/toolchain-android-x86.cmake' -- Using configuration file '/Users/greg/Downloads/linphoneSDK041220/linphone-sdk/cmake-builder/configs/config-android.cmake' -- Including builder linphone -- Including builder bctoolbox -- Including builder mbedtls -- Including builder decaf -- Including builder bellesip -- Including builder ortp -- Including builder ms2 -- Including builder androidcpufeatures -- Including builder gsm -- Including builder opus -- Including builder speex -- Including builder bcg729 -- Including builder turbojpeg -- Including builder zxing -- Including builder vpx -- Including builder yuv -- Including builder matroska2 -- Including builder srtp -- Including builder bzrtp -- Including builder sqlite3 -- Including builder xml2 -- Including builder ms2plugins -- Including builder mswebrtc -- Including builder msandroidcamera2 -- Including builder belr -- Including builder soci -- Including builder xerces -- Including builder belcard -- Including builder lime CMake Warning at configs/config-android.cmake:109 (message): Only static build is available for Android Call Stack (most recent call first): CMakeLists.txt:65 (include)

CMake Error at configs/config-android.cmake:141 (file): file COPY cannot copy file "/Users/greg/Tools/android-ndk-r21d/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so" to "/usr/local/android-x86/lib//libc++_shared.so": No such file or directory. Call Stack (most recent call first): CMakeLists.txt:65 (include)

-- Configuring done -- Generating done -- Build files have been written to: /Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build/android-x86/Autotools -- Enabled features:

-- Disabled features:

-- Configuring incomplete, errors occurred! See also "/Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build/android-x86/CMakeFiles/CMakeOutput.log". make[2]: [android-x86-prefix/src/android-x86-stamp/android-x86-configure] Error 1 make[1]: [CMakeFiles/android-x86.dir/all] Error 2 make: *** [all] Error 2

Viish commented 3 years ago

Seems your CMAKE_INSTALL_PREFIX is wrong, maybe because of the first wrong cmake command. Clear your build dir and start again. If issue persists, try to add the following to the cmake command line: -DCMAKE_INSTALL_PREFIX=/linphone-sdk/

gregperezz commented 3 years ago

I cleaned the build file and started all over again I also added -DCMAKE_INSTALL_PREFIX=/linphone-sdk/ to the configuration. Still the same error.

Bakis-MacBook-Pro:build greg$ cmake .. -DCMAKE_INSTALL_PREFIX=/linphone-sdk/ -DLINPHONESDK_PLATFORM=Android -DLINPHONESDK_ANDROID_ARCHS="arm64, armv7, x86_64, x86" -DENABLE_G729=ON -DENABLE_G729B_CNG=ON -DENABLE_VIDEO=ON -DENABLE_ADVANCED_IM=ON -DENABLE_DB_STORAGE=ON -- Found PythonInterp: /usr/bin/python (found version "2.7.16") -- Enabled features:

-- Disabled features:

-- Setting build type to 'RelWithDebInfo' as none was specified



Linphone SDK without third party GPL software If you acquired a proprietary license from Belledonne Communications, this SDK can be used to create a proprietary Linphone-based application.



-- Configuring done -- Generating done -- Build files have been written to: /Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build Bakis-MacBook-Pro:build greg$ cmake --build . Scanning dependencies of target gradle-clean Starting a Gradle Daemon (subsequent builds will be faster)

Configure project : Old java wrapper detected, adding it to sources and removing some incompatible classes

Task :clean UP-TO-DATE

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 7s 1 actionable task: 1 up-to-date [ 0%] Built target gradle-clean Scanning dependencies of target android-arm64 [ 2%] Creating directories for 'android-arm64' [ 5%] No download step for 'android-arm64' [ 7%] No update step for 'android-arm64' [ 10%] No patch step for 'android-arm64' [ 13%] Performing configure step for 'android-arm64' loading initial cache file /Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build/android-arm64-prefix/tmp/android-arm64-cache-RelWithDebInfo.cmake CMake Warning (dev) in CMakeLists.txt: No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as

project(ProjectName)

near the top of the file, but after cmake_minimum_required().

CMake is pretending there is a "project(Project)" command on the first line. This warning is for project developers. Use -Wno-dev to suppress it.

-- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Users/greg/Tools/android-ndk-r21d/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Users/greg/Tools/android-ndk-r21d/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using toolchain file '/Users/greg/Downloads/linphoneSDK041220/linphone-sdk/cmake-builder/toolchains/toolchain-android-arm64.cmake' -- Using configuration file '/Users/greg/Downloads/linphoneSDK041220/linphone-sdk/cmake-builder/configs/config-android.cmake' -- Found PythonInterp: /usr/bin/python (found version "2.7.16") -- Including builder linphone -- Including builder bctoolbox -- Including builder mbedtls -- Including builder decaf -- Including builder bellesip -- Including builder ortp -- Including builder ms2 -- Including builder androidcpufeatures -- Including builder gsm -- Including builder opus -- Including builder speex -- Including builder bcg729 -- Including builder turbojpeg -- Including builder zxing -- Including builder vpx -- Including builder yuv -- Including builder matroska2 -- Including builder srtp -- Including builder bzrtp -- Including builder sqlite3 -- Including builder xml2 -- Including builder ms2plugins -- Including builder mswebrtc -- Including builder msandroidcamera2 -- Including builder belr -- Including builder soci -- Including builder xerces -- Including builder belcard -- Including builder lime CMake Warning at configs/config-android.cmake:109 (message): Only static build is available for Android Call Stack (most recent call first): CMakeLists.txt:65 (include)

CMake Error at configs/config-android.cmake:141 (file): file COPY cannot copy file "/Users/greg/Tools/android-ndk-r21d/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so" to "/linphone-sdk/android-arm64/lib//libc++_shared.so": No such file or directory. Call Stack (most recent call first): CMakeLists.txt:65 (include)

-- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Users/greg/Tools/android-ndk-r21d/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Users/greg/Tools/android-ndk-r21d/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build/android-arm64/Autotools -- Enabled features:

-- Disabled features:

-- Configuring incomplete, errors occurred! See also "/Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build/android-arm64/CMakeFiles/CMakeOutput.log". make[2]: [android-arm64-prefix/src/android-arm64-stamp/android-arm64-configure] Error 1 make[1]: [CMakeFiles/android-arm64.dir/all] Error 2 make: *** [all] Error 2

Viish commented 3 years ago

This time it's normal as the path you've set in CMAKE_INSTALL_PREFIX is wrong. It should be like /Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build/linphone-sdk/ But I realize now it's my fault as my previous comment misses that part, sorry.

gregperezz commented 3 years ago

Since it is already in /Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build directory isn't it ok to just type -DCMAKE_INSTALL_PREFIX=/linphone-sdk/ ?

Viish commented 3 years ago

Not with the leading /, no.

gregperezz commented 3 years ago

To make it clear you mean it should be like this, right?

cmake .. -DCMAKE_INSTALL_PREFIX=/Users/greg/Downloads/linphoneSDK041220/linphone-sdk/build/linphone-sdk/ -DLINPHONESDK_PLATFORM=Android -DLINPHONESDK_ANDROID_ARCHS="arm64, armv7, x86_64, x86" -DENABLE_G729=ON -DENABLE_G729B_CNG=ON -DENABLE_VIDEO=ON -DENABLE_ADVANCED_IM=ON -DENABLE_DB_STORAGE=ON

This generates the same error

Viish commented 3 years ago

Can you check the file at /Users/greg/Tools/android-ndk-r21d/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so exists ?

gregperezz commented 3 years ago

Yes it does. I can also build the older sdk version with the same ndk path.

gregperezz commented 3 years ago

Hi @Viish has there been any progress in this issue?

PatrykCzarnota commented 3 years ago

I had same issue. I didn't have folders: "/usr/local/android-arm64/lib/". I had to create 'android-arm64' folder and 'lib' inside it. Then I changed permission with: 'sudo chown -R user:user /usr/local/android-arm64'. I don't think it is proper solution but temporary works for me.