I'm trying to compile boringssl libraries so that I could use it in an Android project (building on Ubuntu 18.04). I'm following the build steps from this link.
amy@test-ubuntu18:~/android_test/boringssl/build$ cmake -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=21 -GNinja ..
CMake Error at CMakeLists.txt:14 (enable_language):
The CMAKE_C_COMPILER:
/home/amy/android_test/android-ndk-r21-beta2/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
is not a full path to an existing compiler tool.
Here's my env set up:
amy@test-ubuntu18:~/android_test/boringssl/build$ echo $ANDROID_NDK
/home/amy/android_test/android-ndk-r21-beta2
amy@test-ubuntu18:~/android_test/boringssl/build$ echo $CC
/usr/bin/gcc
amy@test-ubuntu18:~/android_test/boringssl/build$ echo $CXX
/usr/bin/g++
And the tools do exist in my /usr/bin
amy@test-ubuntu18:~/android_test/boringssl/build$ ls -l /usr/bin/*g{cc,++}*
-rwxr-xr-x 1 root root 428 May 7 2006 /usr/bin/c89-gcc
-rwxr-xr-x 1 root root 454 Apr 11 2011 /usr/bin/c99-gcc
lrwxrwxrwx 1 root root 27 May 16 2018 /usr/bin/clang++ -> ../lib/llvm-6.0/bin/clang++
lrwxrwxrwx 1 root root 27 Apr 5 2018 /usr/bin/clang++-6.0 -> ../lib/llvm-6.0/bin/clang++
lrwxrwxrwx 1 root root 25 Apr 10 2019 /usr/bin/clang++-8 -> ../lib/llvm-8/bin/clang++
lrwxrwxrwx 1 root root 5 May 20 2019 /usr/bin/g++ -> g++-7
lrwxrwxrwx 1 root root 22 May 8 2019 /usr/bin/g++-7 -> x86_64-linux-gnu-g++-7
lrwxrwxrwx 1 root root 5 May 20 2019 /usr/bin/gcc -> gcc-7
lrwxrwxrwx 1 root root 22 May 8 2019 /usr/bin/gcc-7 -> x86_64-linux-gnu-gcc-7
lrwxrwxrwx 1 root root 8 May 20 2019 /usr/bin/gcc-ar -> gcc-ar-7
lrwxrwxrwx 1 root root 25 May 8 2019 /usr/bin/gcc-ar-7 -> x86_64-linux-gnu-gcc-ar-7
lrwxrwxrwx 1 root root 8 May 20 2019 /usr/bin/gcc-nm -> gcc-nm-7
lrwxrwxrwx 1 root root 25 May 8 2019 /usr/bin/gcc-nm-7 -> x86_64-linux-gnu-gcc-nm-7
lrwxrwxrwx 1 root root 12 May 20 2019 /usr/bin/gcc-ranlib -> gcc-ranlib-7
lrwxrwxrwx 1 root root 29 May 8 2019 /usr/bin/gcc-ranlib-7 -> x86_64-linux-gnu-gcc-ranlib-7
lrwxrwxrwx 1 root root 5 May 20 2019 /usr/bin/x86_64-linux-gnu-g++ -> g++-7
-rwxr-xr-x 1 root root 1010624 May 8 2019 /usr/bin/x86_64-linux-gnu-g++-7
lrwxrwxrwx 1 root root 5 May 20 2019 /usr/bin/x86_64-linux-gnu-gcc -> gcc-7
-rwxr-xr-x 1 root root 1010624 May 8 2019 /usr/bin/x86_64-linux-gnu-gcc-7
lrwxrwxrwx 1 root root 8 May 20 2019 /usr/bin/x86_64-linux-gnu-gcc-ar -> gcc-ar-7
-rwxr-xr-x 1 root root 27104 May 8 2019 /usr/bin/x86_64-linux-gnu-gcc-ar-7
lrwxrwxrwx 1 root root 8 May 20 2019 /usr/bin/x86_64-linux-gnu-gcc-nm -> gcc-nm-7
-rwxr-xr-x 1 root root 27104 May 8 2019 /usr/bin/x86_64-linux-gnu-gcc-nm-7
lrwxrwxrwx 1 root root 12 May 20 2019 /usr/bin/x86_64-linux-gnu-gcc-ranlib -> gcc-ranlib-7
-rwxr-xr-x 1 root root 27104 May 8 2019 /usr/bin/x86_64-linux-gnu-gcc-ranlib-7
Versions of tools are listed below:
amy@test-ubuntu18:~/android_test/boringssl/build$ ninja --version
1.8.2
amy@test-ubuntu18:~/android_test/boringssl/build$ cmake --version
cmake version 3.15.2
Tried the suggestions mentioned in this issue, but of no use.
The error says "/home/amy/android_test/android-ndk-r21-beta2/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" is not full path, so I checked what's in the path (I don't see the "linux-x86_64" listed in there):
$ls -l /home/amy/android_test/android-ndk-r21-beta2/toolchains/llvm/prebuilt/
drwxrwxr-x 13 amy amy 4096 Jan 3 15:35 windows-x86_64