It is possible to build a static version of boost for the MACOS
Hi I have tried to build the boost libraries on the MacOS as a static library by giving bjam the --buid_type=static but it still built the dynamic version of the libraries. In order to get my application to run, the library load location has to be either in /usr/lib or from the folder where the application started. The problem is that our application is based on xulrunner, and we use a stub application to start xulrunner which is in a different folder. We use the boost libraries in an XPCOM dylib which is loaded from the resources components folder, and for this dylib to be loaded correctly the boost libraries need to placed in the stub application folder. The first time you start the application it will run on but will then fail to run the second time you start it as libraries are being loaded from a location that xulrunner allows it components to run from. So either I need to build the static version of the libraries or change the runtime load path of the libraries. Does anyone know how I do any of these Thanks -- View this message in context: http://www.nabble.com/It-is-possible-to-build-a-static-version-of-boost-for-... Sent from the Boost - Users mailing list archive at Nabble.com.
kittymaguire wrote:
Hi
I have tried to build the boost libraries on the MacOS as a static library by giving bjam the --buid_type=static but it still built the dynamic version of the libraries.
I don't think either "bjam --help" or getting started docs, or Boost.Build docs mention --build_type=static Use link=static, instead. - Volodya
When I put -static into the linker options, I get a lot of linker errors. So I don't think a static version is possible on the MAC. How can I built each library that I need into a framework for the MAC? Vladimir Prus-3 wrote:
kittymaguire wrote:
Hi
I have tried to build the boost libraries on the MacOS as a static library by giving bjam the --buid_type=static but it still built the dynamic version of the libraries.
I don't think either "bjam --help" or getting started docs, or Boost.Build docs mention
--build_type=static
Use link=static, instead.
- Volodya
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://www.nabble.com/It-is-possible-to-build-a-static-version-of-boost-for-... Sent from the Boost - Users mailing list archive at Nabble.com.
kittymaguire wrote:
When I put -static into the linker options,
How exactly? Linker options for what?
I get a lot of linker errors.
What errors?
So I don't think a static version is possible on the MAC.
That would be very strange -- you are the first one to report this.
How can I built each library that I need into a framework for the MAC?
I'm not sure this is possible, and how it will fix your problem. - Volodya
When I put -static into the linker options, I get a lot of linker errors. So I don't think a static version is possible on the MAC. How can I built each library that I need into a framework for the MAC? Vladimir Prus-3 wrote:
kittymaguire wrote:
Hi
I have tried to build the boost libraries on the MacOS as a static library by giving bjam the --buid_type=static but it still built the dynamic version of the libraries.
I don't think either "bjam --help" or getting started docs, or Boost.Build docs mention
--build_type=static
Use link=static, instead.
- Volodya
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://www.nabble.com/It-is-possible-to-build-a-static-version-of-boost-for-... Sent from the Boost - Users mailing list archive at Nabble.com.
passing link=static to bjam is not the same as passing -static to
linked, is this where the confusion is?
On Fri, Oct 3, 2008 at 7:00 PM, kittymaguire
When I put -static into the linker options, I get a lot of linker errors. So I don't think a static version is possible on the MAC.
How can I built each library that I need into a framework for the MAC?
Vladimir Prus-3 wrote:
kittymaguire wrote:
Hi
I have tried to build the boost libraries on the MacOS as a static library by giving bjam the --buid_type=static but it still built the dynamic version of the libraries.
I don't think either "bjam --help" or getting started docs, or Boost.Build docs mention
--build_type=static
Use link=static, instead.
- Volodya
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://www.nabble.com/It-is-possible-to-build-a-static-version-of-boost-for-... Sent from the Boost - Users mailing list archive at Nabble.com.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Oct 3, 2008, at 6:30 AM, kittymaguire wrote:
When I put -static into the linker options, I get a lot of linker errors. So I don't think a static version is possible on the MAC.
How can I built each library that I need into a framework for the MAC?
Vladimir Prus-3 wrote:
kittymaguire wrote:
Hi
I have tried to build the boost libraries on the MacOS as a static library by giving bjam the --buid_type=static but it still built the dynamic version of the libraries.
Here is a bjam command line that builds the 32 bit libraries, debug and release versions, both static and dynamic, targeted to Os X 10.4, with 10.4 as the minimum supported rev. It also installs them. You will need to adjust the path stuff to use it. bjam debug release toolset=darwin address-model=32 architecture=combined threading=multi link=shared,static macosx- version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/ boostbuild_20081003_104356/32 --exec-prefix=/tmp/ boostbuild_20081003_104356/32 --builddir=./../buildProductsMac/boost install Here's the equivalent for 64 bit libaries. bjam debug release toolset=darwin address-model=64 architecture=combined threading=multi link=shared,static macosx- version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/ boostbuild_20081003_104356/64 --exec-prefix=/tmp/ boostbuild_20081003_104356/64 --builddir=./../buildProductsMac/boost install Hope it helps, Rush
On Sat, Oct 4, 2008 at 1:11 AM, Rush Manbert
On Oct 3, 2008, at 6:30 AM, kittymaguire wrote:
When I put -static into the linker options, I get a lot of linker errors. So I don't think a static version is possible on the MAC.
How can I built each library that I need into a framework for the MAC?
Vladimir Prus-3 wrote:
kittymaguire wrote:
Hi
I have tried to build the boost libraries on the MacOS as a static library by giving bjam the --buid_type=static but it still built the dynamic version of the libraries.
Here is a bjam command line that builds the 32 bit libraries, debug and release versions, both static and dynamic, targeted to Os X 10.4, with 10.4 as the minimum supported rev. It also installs them. You will need to adjust the path stuff to use it.
bjam debug release toolset=darwin address-model=32 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/32 --exec-prefix=/tmp/boostbuild_20081003_104356/32 --builddir=./../buildProductsMac/boost install
Here's the equivalent for 64 bit libaries.
bjam debug release toolset=darwin address-model=64 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/64 --exec-prefix=/tmp/boostbuild_20081003_104356/64 --builddir=./../buildProductsMac/boost install
Why the need to specify OsX version? (I am new to OsX development)
On Oct 4, 2008, at 3:08 PM, Sachin Garg wrote:
On Sat, Oct 4, 2008 at 1:11 AM, Rush Manbert
wrote: On Oct 3, 2008, at 6:30 AM, kittymaguire wrote:
When I put -static into the linker options, I get a lot of linker errors. So I don't think a static version is possible on the MAC.
How can I built each library that I need into a framework for the MAC?
Vladimir Prus-3 wrote:
kittymaguire wrote:
Hi
I have tried to build the boost libraries on the MacOS as a static library by giving bjam the --buid_type=static but it still built the dynamic version of the libraries.
Here is a bjam command line that builds the 32 bit libraries, debug and release versions, both static and dynamic, targeted to Os X 10.4, with 10.4 as the minimum supported rev. It also installs them. You will need to adjust the path stuff to use it.
bjam debug release toolset=darwin address-model=32 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/32 --exec-prefix=/tmp/boostbuild_20081003_104356/32 --builddir=./../buildProductsMac/boost install
Here's the equivalent for 64 bit libaries.
bjam debug release toolset=darwin address-model=64 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/64 --exec-prefix=/tmp/boostbuild_20081003_104356/64 --builddir=./../buildProductsMac/boost install
Why the need to specify OsX version? (I am new to OsX development) _______________________________________________
By default, you get targeted to the current version, which is 10.5. If you need to be compatible with previous versions, you need to specify. I honestly don't quite know what the difference is between macosx- version and macosx-version-min, because I'm not the one who worked out what command line we needed. If you use Xcode, you will see that you can specify which SDK version you target there as well, to support backward compatibility. - Rush
On Mon, Oct 6, 2008 at 10:17 PM, Rush Manbert
On Oct 4, 2008, at 3:08 PM, Sachin Garg wrote:
On Sat, Oct 4, 2008 at 1:11 AM, Rush Manbert
wrote: On Oct 3, 2008, at 6:30 AM, kittymaguire wrote:
When I put -static into the linker options, I get a lot of linker errors. So I don't think a static version is possible on the MAC.
How can I built each library that I need into a framework for the MAC?
Vladimir Prus-3 wrote:
kittymaguire wrote:
Hi
I have tried to build the boost libraries on the MacOS as a static library by giving bjam the --buid_type=static but it still built the dynamic version of the libraries.
Here is a bjam command line that builds the 32 bit libraries, debug and release versions, both static and dynamic, targeted to Os X 10.4, with 10.4 as the minimum supported rev. It also installs them. You will need to adjust the path stuff to use it.
bjam debug release toolset=darwin address-model=32 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/32 --exec-prefix=/tmp/boostbuild_20081003_104356/32 --builddir=./../buildProductsMac/boost install
Here's the equivalent for 64 bit libaries.
bjam debug release toolset=darwin address-model=64 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/64 --exec-prefix=/tmp/boostbuild_20081003_104356/64 --builddir=./../buildProductsMac/boost install
Why the need to specify OsX version? (I am new to OsX development) _______________________________________________
By default, you get targeted to the current version, which is 10.5. If you need to be compatible with previous versions, you need to specify. I honestly don't quite know what the difference is between macosx-version and macosx-version-min, because I'm not the one who worked out what command line we needed. If you use Xcode, you will see that you can specify which SDK version you target there as well, to support backward compatibility.
Thanks, looks like I will need to find out more about this.
On Mon, Oct 6, 2008 at 9:47 AM, Rush Manbert
On Oct 4, 2008, at 3:08 PM, Sachin Garg wrote:
On Sat, Oct 4, 2008 at 1:11 AM, Rush Manbert
wrote: On Oct 3, 2008, at 6:30 AM, kittymaguire wrote:
When I put -static into the linker options, I get a lot of linker errors. So I don't think a static version is possible on the MAC.
How can I built each library that I need into a framework for the MAC?
Vladimir Prus-3 wrote:
kittymaguire wrote:
Hi
I have tried to build the boost libraries on the MacOS as a static library by giving bjam the --buid_type=static but it still built the dynamic version of the libraries.
Here is a bjam command line that builds the 32 bit libraries, debug and release versions, both static and dynamic, targeted to Os X 10.4, with 10.4 as the minimum supported rev. It also installs them. You will need to adjust the path stuff to use it.
bjam debug release toolset=darwin address-model=32 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/32 --exec-prefix=/tmp/boostbuild_20081003_104356/32 --builddir=./../buildProductsMac/boost install
Here's the equivalent for 64 bit libaries.
bjam debug release toolset=darwin address-model=64 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/64 --exec-prefix=/tmp/boostbuild_20081003_104356/64 --builddir=./../buildProductsMac/boost install
Why the need to specify OsX version? (I am new to OsX development) _______________________________________________
By default, you get targeted to the current version, which is 10.5. If you need to be compatible with previous versions, you need to specify. I honestly don't quite know what the difference is between macosx-version and macosx-version-min, because I'm not the one who worked out what command line we needed. If you use Xcode, you will see that you can specify which SDK version you target there as well, to support backward compatibility.
macosx-version: which version of the SDK to use macosx-version-min: oldest OS version on which executables will be deployed I'm not sure why the suggestion was made to set prefix and exec-prefix - Mat
On Oct 6, 2008, at 12:07 PM, Mat Marcus wrote:
On Mon, Oct 6, 2008 at 9:47 AM, Rush Manbert
wrote: On Oct 4, 2008, at 3:08 PM, Sachin Garg wrote:
On Sat, Oct 4, 2008 at 1:11 AM, Rush Manbert
wrote: On Oct 3, 2008, at 6:30 AM, kittymaguire wrote:
When I put -static into the linker options, I get a lot of linker errors. So I don't think a static version is possible on the MAC.
How can I built each library that I need into a framework for the MAC?
Vladimir Prus-3 wrote:
kittymaguire wrote:
> > Hi > > I have tried to build the boost libraries on the MacOS as a > static > library > by giving bjam the --buid_type=static but it still built the > dynamic > version > of the libraries.
Here is a bjam command line that builds the 32 bit libraries, debug and release versions, both static and dynamic, targeted to Os X 10.4, with 10.4 as the minimum supported rev. It also installs them. You will need to adjust the path stuff to use it.
bjam debug release toolset=darwin address-model=32 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/32 --exec-prefix=/tmp/boostbuild_20081003_104356/32 --builddir=./../buildProductsMac/boost install
Here's the equivalent for 64 bit libaries.
bjam debug release toolset=darwin address-model=64 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/64 --exec-prefix=/tmp/boostbuild_20081003_104356/64 --builddir=./../buildProductsMac/boost install
Why the need to specify OsX version? (I am new to OsX development) _______________________________________________
By default, you get targeted to the current version, which is 10.5. If you need to be compatible with previous versions, you need to specify. I honestly don't quite know what the difference is between macosx- version and macosx-version-min, because I'm not the one who worked out what command line we needed. If you use Xcode, you will see that you can specify which SDK version you target there as well, to support backward compatibility.
macosx-version: which version of the SDK to use macosx-version-min: oldest OS version on which executables will be deployed
I'm not sure why the suggestion was made to set prefix and exec-prefix
Thanks, and sorry, I just threw out the entire command line that we use, expecting interested parties to edit for their circumstances. Note that this command line also builds dynamic and static libs, so you need to change that too if static is all you want. You also might not want --layout=system... - Rush
I'm inserting the same key-value pair twice.
And I'm getting a different type.
The following code does not compile due to the assertion firing:
#include
CMyMap;
typedef boost::mpl::insert< CMyMap, boost::mpl::pair< boost::mpl::int_<2>, boost::mpl::int_<2> >
CNewMap;
int main(int, char**) { CMyMap s; CNewMap s1; BOOST_MPL_ASSERT((boost::is_same< boost::mpl::insert< CNewMap, boost::mpl::pair< boost::mpl::int_<2>, boost::mpl::int_<2> > >, CNewMap > )); return 0; }
AMDG peter_foelsche@agilent.com wrote:
I'm inserting the same key-value pair twice. And I'm getting a different type. The following code does not compile due to the assertion firing:
<snip>
You're missing the ::type on insert. In Christ, Steven Watanabe
peter_foelsche@agilent.com wrote:
I'm inserting the same key-value pair twice. And I'm getting a different type. The following code does not compile due to the assertion firing:
Please do not ask new question by replying to an unrelated message. It makes things hard for those who have threading-capable mail/news clients and are not interested in every single message. Thanks, Volodya
Hi There seems to be bug with boost 1.36.0 and the bjam 03.1.16, as if you use link=static,shared then the shared libraries overwrite the static versions. When I include libboost_thread-mt.a in my project build with the above command, my application requires the libboost_thread-mt.dylib. But if I only use link=static and include libboost_thread-mt.a, then it no longer requires libboost_thread-mt.dylib. Should bjam not produce libraries that have different names for the static and shared libraries? Regards Katherine Maguire Photographic Galleries
From: rush@manbert.com To: boost-users@lists.boost.org Date: Mon, 6 Oct 2008 12:52:15 -0700 CC: sent-mail@emarcus.org Subject: Re: [Boost-users] It is possible to build a static version of boost for the MACOS
On Oct 6, 2008, at 12:07 PM, Mat Marcus wrote:
On Mon, Oct 6, 2008 at 9:47 AM, Rush Manbert
wrote: On Oct 4, 2008, at 3:08 PM, Sachin Garg wrote:
On Sat, Oct 4, 2008 at 1:11 AM, Rush Manbert
wrote: On Oct 3, 2008, at 6:30 AM, kittymaguire wrote:
When I put -static into the linker options, I get a lot of linker errors. So I don't think a static version is possible on the MAC.
How can I built each library that I need into a framework for the MAC?
Vladimir Prus-3 wrote: > > kittymaguire wrote: > >> >> Hi >> >> I have tried to build the boost libraries on the MacOS as a >> static >> library >> by giving bjam the --buid_type=static but it still built the >> dynamic >> version >> of the libraries. >
Here is a bjam command line that builds the 32 bit libraries, debug and release versions, both static and dynamic, targeted to Os X 10.4, with 10.4 as the minimum supported rev. It also installs them. You will need to adjust the path stuff to use it.
bjam debug release toolset=darwin address-model=32 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/32 --exec-prefix=/tmp/boostbuild_20081003_104356/32 --builddir=./../buildProductsMac/boost install
Here's the equivalent for 64 bit libaries.
bjam debug release toolset=darwin address-model=64 architecture=combined threading=multi link=shared,static macosx-version=10.4 macosx-version-min=10.4 --layout=system --prefix=/tmp/boostbuild_20081003_104356/64 --exec-prefix=/tmp/boostbuild_20081003_104356/64 --builddir=./../buildProductsMac/boost install
Why the need to specify OsX version? (I am new to OsX development) _______________________________________________
By default, you get targeted to the current version, which is 10.5. If you need to be compatible with previous versions, you need to specify. I honestly don't quite know what the difference is between macosx- version and macosx-version-min, because I'm not the one who worked out what command line we needed. If you use Xcode, you will see that you can specify which SDK version you target there as well, to support backward compatibility.
macosx-version: which version of the SDK to use macosx-version-min: oldest OS version on which executables will be deployed
I'm not sure why the suggestion was made to set prefix and exec-prefix
Thanks, and sorry, I just threw out the entire command line that we use, expecting interested parties to edit for their circumstances. Note that this command line also builds dynamic and static libs, so you need to change that too if static is all you want. You also might not want --layout=system...
- Rush
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
katherine Maguire wrote:
Hi
There seems to be bug with boost 1.36.0 and the bjam 03.1.16, as if you use link=static,shared then the shared libraries overwrite the static versions.
How could it be, given that they have different names?
When I include libboost_thread-mt.a in my project build with the above command, my application requires the libboost_thread-mt.dylib.
What is the output of 'file libboost_thread-mt.a'?
But if I only use link=static and include libboost_thread-mt.a, then it no longer requires libboost_thread-mt.dylib.
Should bjam not produce libraries that have different names for the static and shared libraries?
It should not, and I cannot see how this can happen. Can you do go tools/build/v2/example/libraries, run "bjam link=static,shared -n" there and post the output? - Volodya
On Oct 7, 2008, at 5:37 AM, katherine Maguire wrote:
Hi
There seems to be bug with boost 1.36.0 and the bjam 03.1.16, as if you use link=static,shared then the shared libraries overwrite the static versions.
When I include libboost_thread-mt.a in my project build with the above command, my application requires the libboost_thread-mt.dylib.
Hi Katherine, I should have mentioned this before... When we build both library variants, we always copy the dylibs out to a separate directory. When we link our apps, we only provide the directory that contains the static libs as a library search path. The problem is that on the Mac the linker preferentially links libfoo.dylib over libfoo.a when you specify the linker command -lfoo and both libraries are on the library search path. The easiest way around that problem is to either rename your dylibs, something like libfoo.a and libfoo_d.dylib, or to segregate them in a different directory. (I think that there is also another linker option that you can use to force linking against the static libs, but I opted for the brute force "move the dylibs" approach. You might search the Apple Xcode Users mailing list for information about that approach.) - Rush <snip>
participants (8)
-
katherine Maguire
-
kittymaguire
-
Mat Marcus
-
peter_foelsche@agilent.com
-
Rush Manbert
-
Sachin Garg
-
Steven Watanabe
-
Vladimir Prus