For cross compiling MPICH2 for Android.
I found the reference here
http://hex.ro/wp/projects/personal-cloud-computing/compiling-mpich2-for-android-and-running-on-two-phones/
and here
www.scientificbulletin.upb.ro/rev_docs_arhiva/fullffc_583765.
I did following
BuildRoot
Used Build Root (buildroot-2016.02) for cross compiling ARM toolchain
Target options :
Target Architecture as ARM little endian
Target binary format as ELF
Selected Toolchain as Buildroot toolchain (Internal)
Kernel headers as 3.12.x
C library as uClibc
After this make command was run.
MPICH2
mpich-3.2.tar.gz was extracted and following commands were executed
1. $ export PATH=/home/mpiuser/CrossBuild/buildroot-2016.02/output/host/usr/bin:$PATH
2. $ sudo ./configure --prefix=/home/mpiuser/CrossBuild/arm-mpich-install --disable-fortran CC=/home/mpiuser/CrossBuild/buildroot-2016.02/output/host/usr/bin/arm-linux-gcc --host=arm-linux
After this make was run for mpich-3.2, and during compilation following error was thrown :
GEN lib/libmpi.la
CXX src/binding/cxx/initcxx.lo
CXXLD lib/libmpicxx.la
lib/.libs/libmpi.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libmpicxx.la] Error 1
make[2]: Leaving directory `/home/mpiuser/CrossBuild/mpich-3.2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mpiuser/CrossBuild/mpich-3.2'
make: *** [all] Error 2
Request to please help. Thanks
Related
The build environment is ubuntu 16.04 with latest gcc 5.4.0 and GNU Make 3.82. My target is an am335x custom board which can run android 4.4. I am going to support it for android 7.1.1.
The project is fetched from google android manifest tag android-7.1.1_r46 and the kernel is from msm tag android-7.1.1_r0.63. The cross compiler I am using is from prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin.
That is the environment information. I haven't installed the NDK or SDK yet because I saw the api level for android 7.1.1 is 25 while the newest NDK only support up to 24, so I get a bit confused what to do.
If I run the command: m -j8 uboot linux
The uboot compiles fine, but there are a lot of errors when compiling the linux kernel.
/media/yangjiel/disk2/android/kernel/arch/arm/mach-omap2/prm_common.c: In function 'omap_prcm_register_chain_handler':
/media/yangjiel/disk2/android/kernel/arch/arm/mach-omap2/prm_common.c:293:2: warning: passing argument 2 of 'irq_set_chained_handler' from incompatible pointer type [enabled by default]
error, forbidden warning: prm_common.c:293
make[2]: *** [arch/arm/mach-omap2/prm_common.o] Error 1
make[1]: *** [arch/arm/mach-omap2] Error 2
make[1]: *** Waiting for unfinished jobs....
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:141:13: error: 'KERN_BOOT_REASON' undeclared here (not in a function)
{ CTL_INT, KERN_BOOT_REASON, "boot_reason" },
^
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:528:13: error: 'NET_IPV6_ACCEPT_RA_PREFIX_ROUTE' undeclared here (not in a function)
{ CTL_INT, NET_IPV6_ACCEPT_RA_PREFIX_ROUTE, "accept_ra_prefix_route" },
^
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:528:2: error: initializer element is not constant
{ CTL_INT, NET_IPV6_ACCEPT_RA_PREFIX_ROUTE, "accept_ra_prefix_route" },
^
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:528:2: error: (near initialization for 'bin_net_ipv6_conf_var_table[24].ctl_name')
make[2]: *** [kernel/sysctl_binary.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [kernel] Error 2
make: *** [sub-make] Error 2
make: Leaving directory `/media/yangjiel/disk2/android/kernel'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/media/yangjiel/disk2/android'
If I drop the lines in that file which causing this error, the error above is resolved but I would get another
/media/yangjiel/disk2/android/kernel/kernel/cgroup.c: In function 'subsys_cgroup_allow_attach':
/media/yangjiel/disk2/android/kernel/kernel/cgroup.c:2138:37: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
if (current != task && cred->euid != tcred->uid &&
^
/media/yangjiel/disk2/android/kernel/kernel/cgroup.c:2139:18: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
cred->euid != tcred->suid)
^
make[2]: *** [kernel/cgroup.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CC kernel/trace/power-traces.o
CC kernel/trace/rpm-traces.o
CC kernel/trace/trace_probe.o
LD kernel/trace/libftrace.o
LD kernel/trace/built-in.o
make[1]: *** [kernel] Error 2
make: *** [sub-make] Error 2
make: Leaving directory `/media/yangjiel/disk2/android/kernel'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/media/yangjiel/disk2/android'
There are more errors behind.
I have googled around and most of the people say this is a tool chain problem. But I don't find a lot of instruction about how to install the tool chain properly especially for 7.1.1. There seems to be no tool chain needed for the android 4.4 kernel. I fetch the custom android 4.4 kernel and it compiles fine.
The problem above is because I downloaded a wrong version of Android kernel. What I downloaded is https://android.googlesource.com/kernel/msm/+/android-7.1.1_r0.63, and this is kernel v3.10.
Obviously this is not for Android 7.1.1 (which should be using kernel v4.4). So when I am trying to compile "old" kernel with the "new" cross compiler from the prebuilt, it generated whole bunch errors that the "old" compiler won't. I end up using the kernel from https://android.googlesource.com/kernel/common/+/upstream-linux-4.4.y upstream-linux-4.4.y branch, it is compatible with Android 7.0 to 7.1.2.
I have no idea why google name it as android-7.1.1_r0.63, but that definitely not for Android 7.1.1 to use. Hope nobody has the same problem as I did.
Not able to find the problem:
make PLATFORM=android
make[2]: Entering directory `/home/debian/Downloads/nonemaioq3'
CC code/client/cl_cgame.c
/prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: 4: /prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Syntax error: Unterminated quoted string
make[2]: *** [build/release-android-arm/client/cl_cgame.o] Error 2
make[2]: Leaving directory `/home/debian/Downloads/nonemaioq3'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/home/debian/Downloads/nonemaioq3'
make: *** [release] Error 2
and this is the Makefile I got:
http://pastebin.com/QYZYVvTn
I don't find any problem there :S Help please.
The line
CC code/client/cl_cgame.c
starts the compiler (C Compiler or CC). The error message is after the CC and doesn't start with make, so it relates to the compiler, not the Makefile.
/prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: 4: /prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Syntax error: Unterminated quoted string
gcc is the GNU C compiler. The error is in the file /prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc, on line 4.
In view of your comment, "arm-linux" means that version of GCC is meant to run on ARM processors. If you are running this on a PC, you want a gcc with "x86" or "x64" in place of "arm." That would be a cross-compiling situation; see here for links on how to set that up.
I'm pretty new to cmake and i'm trying to cross-compile libftdi for ARM Linux (Android).
Why cmake adds "-compatibility_version" to gcc command-line which leads to error:
/softdev/arm-toolchain/bin/arm-linux-androideabi-gcc -O2 -g -DNDEBUG -dynamiclib -Wl,-headerpad_max_install_names -L/softdev/arm-libs/lib -compatibility_version 2.0.0 -current_version 2.0.0 -o libftdi1.2.0.0.dylib -install_name /Users/asmirnov/Documents/dev/src/libftdi-1.0/src/libftdi1.2.dylib CMakeFiles/ftdi1.dir/ftdi.c.o CMakeFiles/ftdi1.dir/ftdi_stream.c.o /usr/local/lib/libusb-1.0.dylib
arm-linux-androideabi-gcc: error: 2.0.0: No such file or directory
arm-linux-androideabi-gcc: error: 2.0.0: No such file or directory
arm-linux-androideabi-gcc: error: /Users/asmirnov/Documents/dev/src/libftdi-1.0/src/libftdi1.2.dylib: No such file or directory
arm-linux-androideabi-gcc: error: unrecognized option '-compatibility_version'
arm-linux-androideabi-gcc: error: unrecognized option '-current_version'
make[2]: *** [src/libftdi1.2.0.0.dylib] Error 1
make[1]: *** [src/CMakeFiles/ftdi1.dir/all] Error 2
make: *** [all] Error 2
Since i can't find "compatibility_version" command-line parameter in supported by gcc parameters list is it cmake error or cmake configuration problem?
UPDATE: problem #1 solved (hacked)
i've solved the problem by commenting the next lines in ../Modules/Platforms/Darwin.cmake:
# 4ntoine (fix for libftdi compilation using cmake)
#set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
#set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
#set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
#set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
# ...
# 4ntoine (fix for libftdi build using cmake)
#if(NOT XCODE)
# Enable shared library versioning. This flag is not actually referenced
# but the fact that the setting exists will cause the generators to support
# soname computation.
# set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
#endif()
I know it's not good especially when you are not sure what you're doing ;)
Now i have another problem #2:
cd /Users/asmirnov/Documents/dev/src/libftdi-1.0/build/src && /usr/local/Cellar/cmake/2.8.11.1/bin/cmake -E cmake_link_script CMakeFiles/ftdi1.dir/link.txt --verbose=1
/softdev/arm-toolchain/bin/arm-linux-androideabi-gcc -O2 -g -DNDEBUG -dynamiclib -Wl,-headerpad_max_install_names -L/softdev/arm-libs/lib -o libftdi1.dylib CMakeFiles/ftdi1.dir/ftdi.c.o CMakeFiles/ftdi1.dir/ftdi_stream.c.o /softdev/arm-libs/lib/libusb-1.0.so
/softdev/arm-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /softdev/arm-toolchain/bin/../sysroot/usr/lib/crtbegin_dynamic.o: in function _start:crtbrand.c(.text+0x78): error: undefined reference to 'main'
collect2: ld returned 1 exit status
make[2]: *** [src/libftdi1.dylib] Error 1
make[1]: *** [src/CMakeFiles/ftdi1.dir/all] Error 2
make: *** [all] Error 2
I need to implement speech to text offline functionality for my android apps, I found library sphinxbase i tried to installed in ubuntu but something went wrong and the error occured.
I have download the both package of sphinxbase and pockectsphinx and placed in same directory , As document says i ran ./autogen.sh file successfuly after this one message occur to run make command to compile packages after make command there is some error occur
libtool: install: /usr/bin/install -c .libs/libsphinxbase.a /usr/local/lib/libsphinxbase.a
libtool: install: chmod 644 /usr/local/lib/libsphinxbase.a
libtool: install: ranlib /usr/local/lib/libsphinxbase.a/bin/bash: /home/speech: No such file or directory
make[4]: *** [install-libLTLIBRARIES] Error 127
make[4]: Leaving directory `/home/speech to text/Untitled Folder/sphinxbase/src/libsphinxbase'
make[3]: *** [install-am] Error 2
make[3]: Leaving directory `/home/speech to text/Untitled Folder/sphinxbase/src/libsphinxbase'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/speech to text/Untitled Folder/sphinxbase/src/libsphinxbase'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/speech to text/Untitled Folder/sphinxbase/src'
make: *** [install-recursive] Error 1
Strip off the space in the directory name.
Try renaming "speech to text" to "speechtotext".
I try to build the rt73.ko linux driver for android using cross complile. I have download the android NDK and the Kernel sources of the the target system (Rockchip RK3066) and when I build the driver I am getting the following error:
root#slax:~/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module# make
CROSS_COMPILE=arm-linux-androideabi- make -C /root/kernel
SUBDIRS=/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module mod-ules
make[1]: Entering directory /root/kernel' CC [M]
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.o
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c: In
function 'usb_rtusb_probe':
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c:1152:3:
warning: return makes integer from pointer without a cast [enabled by
default] /root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c:
In function 'usb_rtusb_disconnect':
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c:1315:2:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c: In
function 'usb_rtusb_close':
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c:655:1:
warning: the frame size of 2128 bytes is larger than 1024 bytes
[-Wframe-larger-than=]
/root/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/as:
/usr/lib/libz.so.1: no version information available (required by
/root/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/as)
/bin/sh: scripts/basic/fixdep: cannot execute binary file make[2]: ***
[/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.o] Error
126 make[1]: ***
[_module_/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module] Error 2
make[1]: Leaving directory/root/kernel' make: * [all] Error 2
Could you please help me to overcome the above error?
Although you cross compile, only the kernel can be compiled. scripts/basic/fixdep is userland program.
To overcome this, you need to use http://crosstool-ng.org/ for example.