How well does Boost support cross-compilation?
I'm dreaming of compiling MinGW, OS X (Intel and PowerPC) and Linux x86 versions of my program in one go, perhaps on Linux. The program uses little other than several Boost libraries. Is this a possible and reliable usage scenario? This doesn't seem like a particularly original idea, so I'm sure others explored it. Are there any how-to's? I couldn't find any.
n.torrey.pines@gmail.com wrote:
I'm dreaming of compiling MinGW, OS X (Intel and PowerPC) and Linux x86 versions of my program in one go, perhaps on Linux. The program uses little other than several Boost libraries. Is this a possible and reliable usage scenario?
This doesn't seem like a particularly original idea, so I'm sure others explored it. Are there any how-to's? I couldn't find any.
Several folks did Linux->{various embedded systems} compile, and it worked. That's good news. The bad news is that Linix->MinGW compile won't 100% work out of box. You can do cross-compiling by setting up a user-config.jam, where you configure gcc toolset, explicitly specifying a command, which would be like i686-mingw32-g++, or some such. I think the compilation will even work. The problem is that you'll end up with libraries named .a and .so and executables named without any suffix. This is because while Boost.Build has <target-os> feature, the code that determines file extension looks at host os, not target-os. It's not hard to fix, but it need somebody to do that. Patches welcome :-) - Volodya
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Vladimir Prus Sent: 19 October 2007 09:29 To: boost-users@lists.boost.org Subject: Re: [Boost-users] How well does Boost support cross-compilation?
n.torrey.pines@gmail.com wrote:
I'm dreaming of compiling MinGW, OS X (Intel and PowerPC) and Linux x86 versions of my program in one go, perhaps on Linux. The program uses little other than several Boost libraries. Is this a possible and reliable usage scenario?
This doesn't seem like a particularly original idea, so I'm sure others explored it. Are there any how-to's? I couldn't find any.
Several folks did Linux->{various embedded systems} compile, and it worked. That's good news. The bad news is that Linix->MinGW compile won't 100% work out of box.
You can do cross-compiling by setting up a user-config.jam, where you configure gcc toolset, explicitly specifying a command, which would be like i686-mingw32-g++, or some such. I think the compilation will even work. The problem is that you'll end up with libraries named .a and .so and executables named without any suffix. This is because while Boost.Build has <target-os> feature, the code that determines file extension looks at host os, not target-os. It's not hard to fix, but it need somebody to do that. Patches welcome :-)
- Volodya
As an example, here is the command line I use to compile boost for an ARM processor. bjam "-sGCC_ROOT_DIRECTORY=<location of cross compiler>" "-sGCC=iwmmxt_le-gcc" "-sGXX=iwmmxt_le-g++" stage Where the compilers and associated bits and pieces are preceeded with -wmmxt_le-<whatever> Seems to work OK. James This message (including any attachments) contains confidential and/or proprietary information intended only for the addressee. Any unauthorized disclosure, copying, distribution or reliance on the contents of this information is strictly prohibited and may constitute a violation of law. If you are not the intended recipient, please notify the sender immediately by responding to this e-mail, and delete the message from your system. If you have any questions about this e-mail please notify the sender immediately.
Hughes, James wrote:
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Vladimir Prus Sent: 19 October 2007 09:29 To: boost-users@lists.boost.org Subject: Re: [Boost-users] How well does Boost support cross-compilation?
n.torrey.pines@gmail.com wrote:
I'm dreaming of compiling MinGW, OS X (Intel and PowerPC) and Linux x86 versions of my program in one go, perhaps on Linux. The program uses little other than several Boost libraries. Is this a possible and reliable usage scenario?
This doesn't seem like a particularly original idea, so I'm sure others explored it. Are there any how-to's? I couldn't find any.
Several folks did Linux->{various embedded systems} compile, and it worked. That's good news. The bad news is that Linix->MinGW compile won't 100% work out of box.
You can do cross-compiling by setting up a user-config.jam, where you configure gcc toolset, explicitly specifying a command, which would be like i686-mingw32-g++, or some such. I think the compilation will even work. The problem is that you'll end up with libraries named .a and .so and executables named without any suffix. This is because while Boost.Build has <target-os> feature, the code that determines file extension looks at host os, not target-os. It's not hard to fix, but it need somebody to do that. Patches welcome :-)
- Volodya
As an example, here is the command line I use to compile boost for an ARM processor.
bjam "-sGCC_ROOT_DIRECTORY=<location of cross compiler>" "-sGCC=iwmmxt_le-gcc" "-sGXX=iwmmxt_le-g++" stage
For the record, this is Boost.Build V1 syntax. For V2, you'd put this
to user-config.jam:
using gcc : 4.2_arm :
On 10/19/07, Vladimir Prus
Several folks did Linux->{various embedded systems} compile, and it worked. That's good news. The bad news is that Linix->MinGW compile won't 100% work out of box.
What about OS X? Of all cross-compile targets, I'm most interested in that. It's illegal to run OS X in VMWare.
n.torrey.pines@gmail.com wrote:
On 10/19/07, Vladimir Prus
wrote: Several folks did Linux->{various embedded systems} compile, and it worked. That's good news. The bad news is that Linix->MinGW compile won't 100% work out of box.
What about OS X? Of all cross-compile targets, I'm most interested in that. It's illegal to run OS X in VMWare.
I don't know, to be honest. I doubt Apple tools support Linux->OSX compilation and I have no idea how gcc cross works in this case. If it basically works, then you can expect about the same situation -- that compilation works but file extensions might need tweaking. - Volodya
participants (3)
-
Hughes, James
-
n.torrey.pines@gmail.com
-
Vladimir Prus