Re: Boost 1.46 and NDK r5

425 views
Skip to first unread message

Sara Brodin

unread,
Jun 23, 2011, 9:18:34 AM6/23/11
to android-ndk
Hi,

A workaround for this issue was to modify the "boost/filesystem/config.hpp"  and the "boost/filesystem.hpp" in the following way:

@@ -21,7 +21,7 @@
 # endif
 
 # if !defined(BOOST_FILESYSTEM_VERSION)
-#   define BOOST_FILESYSTEM_VERSION 3
+#   define BOOST_FILESYSTEM_VERSION 2
 # endif

By using Boost.Filesystem.V2 as default, std::wstring is no longer needed.

If other workarounds exist, please spread the word.

Sara 

2011/6/22 saz <sara....@gmail.com>
Hi,

I am trying to port the filesystem library in Boost 1.46 to Android
with the help of nkd5. I have gotten rid of some compiler warnings,
but one still remains:

gcc.compile.c++ bin.v2/libs/filesystem/build/gcc-android4.4.0/release/
link-static/threading-multi/v3/src/utf8_codecvt_facet.o
In file included from ./boost/filesystem/config.hpp:31,
                from libs/filesystem/v3/src/utf8_codecvt_facet.cpp:
11:
./boost/filesystem/v3/config.hpp:49:5: error: #error Configuration not
supported: Boost.Filesystem V3 and later requires std::wstring support

   "arm-linux-androideabi-g++"  -ftemplate-depth-128 -O3 -finline-
functions -Wno-inline -Wall -DBOOST_NO_INTRINSIC_WCHAR_T -fno-strict-
aliasing -pthread  -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -
DNDEBUG  -I"." -c -o "bin.v2/libs/filesystem/build/gcc-android4.4.0/
release/link-static/threading-multi/v3/src/utf8_codecvt_facet.o" "libs/
filesystem/v3/src/utf8_codecvt_facet.cpp"


I have read a couple of post with people succeeding in building Boost
for Android, but non of them has had problem with this. As I
understand, ndk5 does not support wstring, but boost Filesystemv3 can
not be build without it. What have I missed? Is there a boost
configure option turning V3 off?

The problem in config.hpp:
# if defined( BOOST_NO_STD_WSTRING )
#   error Configuration not supported: Boost.Filesystem V3 and later
requires std::wstring support
# endif

Best regards
Sara

saz

unread,
Jun 22, 2011, 11:46:28 AM6/22/11
to android-ndk

Tim Mensch

unread,
Jun 23, 2011, 4:19:05 PM6/23/11
to andro...@googlegroups.com
On 6/22/2011 9:46 AM, saz wrote:
> I am trying to port the filesystem library in Boost 1.46 to Android
> with the help of nkd5. I have gotten rid of some compiler warnings,
> but one still remains:

Boost is a HUGE set of libraries. My guess is that no one else tried to
build that one. I'm not even familiar with it myself, and I've used
various boost libraries for years.

Tim

Dmytro Gorbunov

unread,
Sep 23, 2011, 8:30:25 AM9/23/11
to andro...@googlegroups.com
Sara Brodin <sara.brodin <at> gmail.com> writes:
>
>
> Hi,
>
> A workaround for this issue was to modify the "boost/filesystem/
config.hpp"  and the "boost/filesystem.hpp" in the following way:
>
>
> <at> <at> -21,7 +21,7 <at> <at>
>  # endif
>  
>  # if !defined(BOOST_FILESYSTEM_VERSION)
> -#   define BOOST_FILESYSTEM_VERSION 3
> +#   define BOOST_FILESYSTEM_VERSION 2
>  # endif
>
> By using Boost.Filesystem.V2 as default, std::wstring is no longer needed.
>
> If other workarounds exist, please spread the word.
>
> Sara 


Thanks for this tip Sara.

Another way to do it is using boost/config/user.hpp .
You have to just add the following line
{code}
#define BOOST_FILESYSTEM_VERSION 2
{code}

I think this method is more boost-native than editing files you suggested.

Kind regards,
Dmytro Gorbunov

Zoran Angelov

unread,
Sep 23, 2011, 1:01:54 PM9/23/11
to andro...@googlegroups.com
Hi,
if you are interested in building boost 1.47.0 with ndkr6, ndkr6-crystax-2 or ndkr6b , i've created patches and successfully build it under cygwin.


The build is for armv6 with vfpu enabled.

The build sequence is:
1. download boost_1_47_0 and unpack it.
2. bootstrap it with sh bootstrap.sh.
3. apply the patch while in boost dir: patch -p0 < path_to_boost_1_47_0.patch
4. the patch will create build script "build.sh" just run it with sh build.sh and it will build and install boost headers and static libraries in ../build directory

Almost all libraries are built, but i have not tested them.

If you need to modify some flags, after the patching edit the boost_1_47_0/tools/build/v2/user-config.jam file.



--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


Zoran Angelov

unread,
Sep 23, 2011, 1:26:00 PM9/23/11
to andro...@googlegroups.com
Sorry for misguiding , filesystem v3 builds only with ndkr6-crystax-2.

Zoran Angelov

unread,
Sep 23, 2011, 3:42:17 PM9/23/11
to andro...@googlegroups.com
But invoking bjam with this parameters, boost.filesystem2 builds successfully with ndkr6b :

./b2 toolset=android-ndkr6_armv6_vfpu threading=multi link=static runtime-link=static target-os=linux -sNO_COMPRESSION=1 --disable-filesystem3 define=BOOST_FILESYSTEM_VERSION=2 -d+2 install

Sorry for disturbing.
Reply all
Reply to author
Forward
0 new messages