Hello,
i am new to program applications for the i.MX6SL. I have a c++ application which needs boost. I have compiled boost for a different board. On this board works android 2.3 and it works fine. For that i could find a howto. But on the i.MX6SL board is a different operating system. If i test it with
cat /proc/version
i get
Linux version 3.0.15-ts-armv7l (andrew@gumshoe) (gcc version 4.6.3 (Timesys 20120611) ) #11 SMP PREEMPT Wed Aug 15 15:54:17 EDT 2012
I tried to compile boost in the way i have done it for the android board but that doesn't work. So maybe there is someone who has experiences in compiling boost for that os.
I have done it in the following way.
First i prepared the ubuntu computer with the cross compiler.
Then i downloaded the NDK from the android homepage and installed it.
I downloaded the boost ( version (1.49) and installed it. I changed the following files:
tools/build/v2/user-config.jam
user-config.jam
--------------------------
import os ;
if [ os.name ] = CYGWIN || [ os.name ] = NT
{
androidPlatform = windows ;
}
else if [ os.name ] = LINUX
{
androidPlatform = linux-x86 ;
}
else if [ os.name ] = MACOSX
{
androidPlatform = darwin-x86 ;
}
modules.poke : NO_BZIP2 : 1 ;
ANDROID_NDK = ../.. ;
using gcc : android4.4.3 :
/home/markus-delpy/android_ndk/android-ndk-r8c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ :
<compileflags>--sysroot=/home/markus-delpy/android_ndk/android-ndk-r8c/platforms/android-9/arch-arm
<compileflags>-mthumb
<compileflags>-Os
<compileflags>-fno-strict-aliasing
<compileflags>-O2
<compileflags>-DNDEBUG
<compileflags>-g
<compileflags>-lstdc++
<compileflags>-I/home/markus-delpy/android_ndk/android-ndk-r8c/sources/cxx-stl/gnu-libstdc++/4.4.3/include
<compileflags>-I/home/markus-delpy/android_ndk/android-ndk-r8c/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include
<compileflags>-D__GLIBC__
<compileflags>-DBOOST_NO_INTRINSIC_WCHAR_T
<compileflags>-DBOOST_FILESYSTEM_VERSION=2
<archiver>/home/markus-delpy/android_ndk/android-ndk-r8c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar
<ranlib>/home/markus-delpy/android_ndk/android-ndk-r8c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ranlib
Then i changed the file libs/filesystem/v2/src/v2_operations.cpp
# if !defined(__APPLE__) && !defined(__OpenBSD__) # include <sys/statvfs.h> # define BOOST_STATVFS statvfs # define BOOST_STATVFS_F_FRSIZE vfs.f_frsize # else #ifdef __OpenBSD__ # include <sys/param.h> #endif
in the following:
# if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__ANDROID__) # include <sys/statvfs.h> # define BOOST_STATVFS statvfs # define BOOST_STATVFS_F_FRSIZE vfs.f_frsize # else #ifdef __OpenBSD__ # include <sys/param.h> #elif defined(__ANDROID__) # include <sys/vfs.h> #endif
I tried to compile it then with
./bjam --without-python --disable-filesystem3 toolset=gcc-android4.4.3 link=static runtime-link=static target-os=linux --stagedir=android
But during the compilation the following error occurs:
sh: 1: /home/markus-delpy/android_ndk/android-ndk-r8c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: not found
sh: 1: /home/markus-delpy/android_ndk/android-ndk-r8c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: not found
sh: 1: /home/markus-delpy/android_ndk/android-ndk-r8c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: not found
sh: 1: /home/markus-delpy/android_ndk/android-ndk-r8c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: not found
I have controlled the PATH variable and all other environment variables but i can't find the mistake.
Thanks for your help
markus
Solved! Go to Solution.
Not sure you'll have fully compatible binaries but if it works, good. Pay attention to license complience for your project due changes in GPL and LGPL projects....
Do you need it to be Android or it can be in Linux? In the case it can be in Linux you might be interested in learn more about Yocto project as boost is already packaged and ready for us in it.
It doesn't have support to SoloLite but it is not hard to add (I can work on this if you wish) but it has Quad already supported and except by the changes in the BSP for SoloLite the right is full compatible.
Hello Otavio,
thank you for your help. I don't know the Yocto project and will inform me about it. Unfortunately it is not possible for me to change the os. I have to work with the os which is on the system.
I found two solutions for my problem. In the first it is possible to compile boost with an crosscompiler.
You have only to follow the instructions given here:
http://www.cnx-software.com/2011/10/03/cross-compiling-boost-c-libraries-for-arm/
The only thing i have to change is the last command. With
./bjam install toolset=gcc-arm -sNO_ZLIB=1 -sNO_BZIP2=1
it works for me.
The second solution is much shorter i found the following rpm.
libboost-1.45.0-1mamba.src.rpm
On the webside
openmamba - Ready to use GNU/Linux
I have no difficulties to install the libs. Now i am trying to work with the libs.
Best Regards
markus
Not sure you'll have fully compatible binaries but if it works, good. Pay attention to license complience for your project due changes in GPL and LGPL projects....