
Hi, In boost 1.33.1, I can compile static libraries with -fPIC using command: bjam -j4 --prefix=/usr "-sBUILD=release <runtime-link>static <cxxflags>-fPIC" --with-serialization --with-iostreams install but -s no longer works for bjam/cvs. Can anyone show me the equivalence of the above command? Many thanks in advance. Bo

bjam -j4 --prefix=/usr "-sBUILD=release <runtime-link>static <cxxflags>-fPIC" --with-serialization --with-iostreams install
I spent another fruitless day on this seemingly trivial task. I have tried bjam --v2 --toolset=gcc cxxflags=-fPIC --with-serialization --with-iostreams link=static --prefix=/usr -j6 -d+2 install according to http://mail.python.org/pipermail/c++-sig/2006-October/011520.html but -fPIC is not added to the commands, e.g. "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -DBOOST_ALL_NO_LIB=1 -I"." -c -o "bin.v2/libs/serialization/build/gcc-3.4.6/debug/link-static/utf8_codecvt_facet.o" "libs/serialization/src/utf8_codecvt_facet.cpp" Is this a bjam bug? Can anyone show me the correct command? Many thanks in advance. Bo

Bo Peng wrote:
bjam -j4 --prefix=/usr "-sBUILD=release <runtime-link>static <cxxflags>-fPIC" --with-serialization --with-iostreams install
I spent another fruitless day on this seemingly trivial task. I have tried
bjam --v2 --toolset=gcc cxxflags=-fPIC --with-serialization --with-iostreams link=static --prefix=/usr -j6 -d+2 install
1) You are not using bjam features, but Boost.Build (a language written in bjam). 2) According to the The Boost.Build (draft) doc (from boost more) I would try: bjam toolset=gcc/cxxflags=-fPIC --with-serialization (and so on ...) Roland

1) You are not using bjam features, but Boost.Build (a language written in bjam).
A bit confused, but I guess this does not matter. Just to make sure, I get boost/cvs, go to tools/jam/src, run build.sh, and copy bin.linux/bjam to the top source directory...
2) According to the The Boost.Build (draft) doc (from boost more) I would try:
bjam toolset=gcc/cxxflags=-fPIC --with-serialization (and so on ...)
I have actually tried this, using bjam toolset=gcc/cxxflags=-fPIC --with-serialization --with-iostreams link=static --prefix=/usr -j6 -d+2 install I get commands like: "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -DBOOST_ALL_NO_LIB=1 -I"." -c -o "bin.v2/libs/serialization/build/gcc-3.4.6/debug/link-static/xml_wgrammar.o" "libs/serialization/src/xml_wgrammar.cpp" No -fPIC. Bo

I have actually tried this, using
bjam toolset=gcc/cxxflags=-fPIC --with-serialization --with-iostreams link=static --prefix=/usr -j6 -d+2 install
no -fPIC is added.
Dear all, After numerous attempts, I find that link=static somehow disables the addition of cxxflags=-fPIC. I mean, I am able to get static libraries built with -fPIC using, bjam toolset=gcc/cxxflags=-fPIC --with-serialization --with-iostreams --with-mpi -j6 -d+2 --prefix=/usr install but *not* with bjam toolset=gcc/cxxflags=-fPIC --with-serialization --with-iostreams --with-mpi -j6 -d+2 --prefix=/usr link=static install Is this a bjam bug? Bo

Bo - I'm hardly a boost build expert, but I've jut gotten done converting all of my builds to use it. It was a little rocky at first but well worth the pain. First off, what you are dealing with is a Boost.Build issue. You can find out more about Boost.Build here: http://www.boost.org/tools/build/v2/ I highly recommend reading the the "Documentation" link. It was very useful for me at least. As for the issue you are seeing... the gcc.jam file calls out that when link is shared that -fPIC will be added for gcc (non-NT and non-CYGWIN builds). I do not see an explicit callout for -fPIC and static libraries, which means you will need to add it it. Boost.Build v1 and v2 have two different ways to specify arguments. What I think you are looking for is: Boost.Build v2 bjam --v2 toolset=gcc cxxflags=-fPIC --with-serialization --with-iostreams --with-mpi -j6 -d+2 --prefix=/usr link=static install Also, let me point out that there is a Boost.Build mail group. You can find a link on the same web page referenced above. Best Regards - Michael -- ---------------------------------- Michael Caisse Object Modeling Designs www.objectmodelingdesigns.com Bo Peng wrote:
Dear all,
After numerous attempts, I find that link=static somehow disables the addition of cxxflags=-fPIC. I mean, I am able to get static libraries built with -fPIC using,
bjam toolset=gcc/cxxflags=-fPIC --with-serialization --with-iostreams --with-mpi -j6 -d+2 --prefix=/usr install
but *not* with
bjam toolset=gcc/cxxflags=-fPIC --with-serialization --with-iostreams --with-mpi -j6 -d+2 --prefix=/usr link=static install
Is this a bjam bug?
Bo _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
Bo Peng
-
Michael Caisse
-
Roland Schwarz