Trying to build Native C Code on Raspberry Pi3 with Gradle 4.3.1 fails


(Lokesh H K) #1

Hi,
I’m trying to build a sample C code on my Raspberry Pi 3 with Gradle build 4.3.1 resulting in below pasted error message:

:assemble FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:assemble’.

No buildable binaries found:
- executable ‘main:executable’: No tool chain is available to build for platform ‘linux_arm-v7’:
- Tool chain ‘visualCpp’ (Visual Studio): Visual Studio is not available on this operating system.
- Tool chain ‘gcc’ (GNU GCC): Don’t know how to build for platform ‘linux_arm-v7’.
- Tool chain ‘clang’ (Clang): Don’t know how to build for platform ‘linux_arm-v7’.

Here is the contents of build.gradle file:

apply plugin : ‘c’

model {
components {
main(NativeExecutableSpec)
}
}

Here is the output from gcc -v:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: …/src/configure -v --with-pkgversion=‘Raspbian 6.3.0-18+rpi1’ --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 6.3.0 20170516 (Raspbian 6.3.0-18+rpi1)

I wanted to use Gradle on Raspberry Pi3 for building native code c/c++. Please let me know if any one has already tried this and any resolution for my issue.

Thank you,
Lokesh