[Boost-users] 1.53, Bjam fails when adding arguments [Beginner]

38 views
Skip to first unread message

wespaugh

unread,
Mar 5, 2013, 8:48:05 AM3/5/13
to boost...@lists.boost.org
I'm trying to build 1.53 for use with an android platform, using some
configuration code provided kindly provided by one of the community.
(Android shouldn't be relevant to the problem, but it seemed noteworthy).

My user-config.jam is:

import os ;

if [ os.name ] = CYGWIN || [ os.name ] = NT
{
androidPlatform = windows ;
}

androidNDKRoot = /cygdrive/c/Android/android-ndk-r8d ;

using
gcc:android:$(androidNDKRoot)/toolchains/arm-linux-androideabi/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-g++
<compileflags>--sysroot=$(androidNDKRoot)/platforms/android-8/arch-arm/
<compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/include

<compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi/include

<archiver>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi/ar

<ranlib>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ranlib
;



And I am trying to build with the following command:

b2 release --with-serialization --with-thread --with-date_time --with-system
--with-filesystem --layout=system threading=multi link=static
runtime-link=static toolset=gcc-android target-os=linux threadapi=pthread
stage


When I try to run, however, I get
.../user-config.jam:109: in modules.load
*** argument error
* rule using ( toolset-module : * )
* called with: (
gcc:android:/cygdrive/c/Android/android-ndk-r8d/toolchains/arm-linux-androideabi/prebuilt/windows/bin/arm-linux-androideabi
<compileflags>--sysroot=/cygdrive/c...{Rest of my compiler flags go here}
* extra argument
<compileflags>--sysroot=/cygdrive/c/Android/android-ndk-r8d/...{Rest of my
compiler flags go here}
/{...}/build/project.jam:886: see definition of rule 'using' being called
/{...}/build-system.jam:257: in load-config
/{...}/build-system.jam:399: in load-configuration-files
/{...}/build-system.jam:555: in load
/{...}/kernel/modules.jam:284: in import
/{...}/kernel/bootstrap.jam:142: in boost-build
/{...}/boost-build.jam:8: in module scope

From what I can tell, it doesn't like something about how my compile flags
are passed in. I found some documentation on boost.org suggesting that the
proper way to define them is like this:

compileflags="--sysroot=/cygdrive/c/Android/{...}/
-I$(androidNDKRoot)/toolchains/{...} etc"

But that gave me the same error.

There's a strong chance that this is in TFM somewhere I just need to R. If
so, I apologize, because I cannot find the manual. I would greatly
appreciate any assistance in finding where to learn what I need to know
about these config files. I would even more greatly appreciate some
assistance with this specific problem.



--
View this message in context: http://boost.2283326.n4.nabble.com/1-53-Bjam-fails-when-adding-arguments-Beginner-tp4643814.html
Sent from the Boost - Users mailing list archive at Nabble.com.
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Steven Watanabe

unread,
Mar 5, 2013, 9:56:10 AM3/5/13
to boost...@lists.boost.org
AMDG

On 03/05/2013 05:48 AM, wespaugh wrote:
> <snip>
>
> using
> gcc:android:$(androidNDKRoot)/...
> <compileflags>...
> <compileflags>...
>
> <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi/include
>
> <archiver>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi/ar
>
> <ranlib>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ranlib
> ;
>

You're missing spaces. Try

using gcc : android : $(androidNDKRoot)/...
;

Otherwise, bjam parses it as a single string.

In Christ,
Steven Watanabe

wespaugh

unread,
Mar 6, 2013, 8:20:42 AM3/6/13
to boost...@lists.boost.org
Thank you very much for the assistance. It got my through that error, but
I've smacked headlong into another one.

My user-config.jam now specifies the compiler with the following line

using gcc : android :
$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-g++
compileflags="--sysroot=$(androidNDKRoot)/platforms/android-8/arch-arm/
-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/include
-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi/include"
;

I've played around with adding spaces before and after the equal sign in
compileflags="--sysroot...", but in all cases I got an error similar to:

arm-linux-androideabi-g++.exe: error:
compileflags=--sysroot=/cygdrive/c/Android/android-ndk-r8d/platforms/android-8/arch-arm/:
No such file or directory

If I leave that compile flag out, the error recurs for the next -I compile
flag. I have verified that directories exist at each of those paths.

When trying the alternate format I came across for compile flags, which
changes the compiler line to this:

using gcc : android :
$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-g++
<compileflags>--sysroot=$(androidNDKRoot)/platforms/android-8/arch-arm/
<compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/include
<compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi/include
;

I get a four instances of the following error when I attempt to run b2:
/bin/sh: compileflags: No such file or directory

I've also tried with a space between <compileflags> and the flag, but I get
the very same errors.


I really do appreciate your initial help. It would help me immensely if you
could offer any advice on this next problem as well, or could point me to
somewhere that I could learn to work through these problems for myself. The
particulars about how things need to be formatted / spaced aren't obvious to
me, and I haven't had luck finding relevant documentation.

Thanks!



--
View this message in context: http://boost.2283326.n4.nabble.com/1-53-Bjam-fails-when-adding-arguments-Beginner-tp4643814p4643863.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Steven Watanabe

unread,
Mar 6, 2013, 9:14:37 AM3/6/13
to boost...@lists.boost.org
AMDG

On 03/06/2013 05:20 AM, wespaugh wrote:
> <snip>
>
> When trying the alternate format I came across for compile flags, which
> changes the compiler line to this:
>
> using gcc : android :
> $(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-g++
> <compileflags>--sysroot=$(androidNDKRoot)/platforms/android-8/arch-arm/
> <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/include
> <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi/include
> ;
>

This is almost correct. You need a ":" between
the compiler and the <compileflags>.

> I get a four instances of the following error when I attempt to run b2:
> /bin/sh: compileflags: No such file or directory
>
> I've also tried with a space between <compileflags> and the flag, but I get
> the very same errors.
>
>
> I really do appreciate your initial help. It would help me immensely if you
> could offer any advice on this next problem as well, or could point me to
> somewhere that I could learn to work through these problems for myself. The
> particulars about how things need to be formatted / spaced aren't obvious to
> me, and I haven't had luck finding relevant documentation.
>

http://www.boost.org/boost-build2/doc/html/jam/language.html

In Christ,
Steven Watanabe
Reply all
Reply to author
Forward
0 new messages