Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list failed targets after building boost?

I am building boost on my windows using mingw-4.8.1 and have a few targets which failed. My Problem is that, I do not know which specific targets failed and which were skipped.

Is there a way to list the failed/skipped targets after the build is completed?

Here the console output:

...failed updating 20 targets...
...skipped 28 targets...
...updated 5789 targets...

Commands used after downloading a unzipping boost:

bootstrap

once b2.exe is built. I execute the following command in cmd

b2 -j4 --build-dir=build toolset=gcc --build-type=complete --stagedir=C:\SW\Boost -sNO_BZIP2=1

System: Windows 7 ( intel i5 vPro)
Compiler: gcc (mingw 4.8.1)
Boost: boost 1.61.0

like image 841
Tomar Avatar asked Jun 14 '16 12:06

Tomar


2 Answers

So, a little bit of more research resulted in the following.

One can get the build configuration and other build output using b2 [options]
b2 --help reveals the options that can be used. I used the following approaches to diagnose exactly which targets were failing or getting skipped.

Approach 1
As suggested by @JanHenke in comments, I ran the same command

b2 -j4 --build-dir=build toolset=gcc --build-type=complete --stagedir=C:\SW\Boost -sNO_BZIP2=1

(as mentioned in question) again.
Result: All tragets that are already built are skipped and only failed ones are shown.
Problem: If there are many targets which failed then this just floods the console and it is difficult to find out what is going on.

Approach 2
Run the command (see 1) and select all from the command prompt using right mouse click, and then click gain to copy and paste it in a text editor so that is searchable.
Result: Usable insights can be drawn by searching for failed or error keywords
Problem: Still not the optimal way as not all the info is vailable on the current cmd window.

Approach 3 Not Done as for me 2. worked, but should surely work
Create a batchfile where in, the command is written and all that is printed on the cmd window, gets logged in a text file using the > or >> operators.

Result: Will be the best way (known to me till now) to know which exact targets are getting failed and a proper diagnostic action can be taken.

PS: I found that the there is a bug when trying to build serialization library with MinGW. Below the error I am facing and a link to boost forum which talks about the same error.

gcc.compile.c++ build\boost\bin.v2\libs\serialization\build\gcc-mingw-4.8.1\debug\xml_woarchive.o
In file included from ./boost/archive/detail/utf8_codecvt_facet.hpp:23:0,
                 from ./boost/archive/impl/xml_woarchive_impl.ipp:34,
                 from libs\serialization\src\xml_woarchive.cpp:28:
./boost/detail/utf8_codecvt_facet.hpp:116:30: error:  
 function 'boost::archive::detail::utf8_codecvt_facet::utf8_codecvt_facet(std::size_t)'
definition is marked dllimport  

More info Reference1 and Reference2.
Sadly have not found a solution for it yet. Also, it is not the scope of this question.

like image 111
Tomar Avatar answered Oct 17 '22 04:10

Tomar


I had the same problem. After some research, I found this is the best way to see where it got failed.

My error messages (depends on your machine, you may see different ones):

...failed updating 6 targets...
...skipped 6 targets...
...updated 1092 targets...

I run ./b2 -q

This will stop at your first errors, in my case:

gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.8.3/release/threading-multi/bzip2.o
libs/iostreams/src/bzip2.cpp:20:56: fatal error: bzlib.h: No such file or directory
 #include "bzlib.h"  // Julian Seward's "bzip.h" header.
                                                        ^
compilation terminated.

    "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -m64  -DBOOST_ALL_NO_LIB=1 -DBOOST_IOSTREAMS_DYN_LINK=1 -DBOOST_IOSTREAMS_USE_DEPRECATED -DNDEBUG  -I"." -c -o "bin.v2/libs/iostreams/build/gcc-4.8.3/release/threading-multi/bzip2.o" "libs/iostreams/src/bzip2.cpp"

...failed gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.8.3/release/threading-multi/bzip2.o...
...failed updating 1 target...

Then you can install the missing dependencies, and see your second missing ones. To see every single one of your errors, you need to install dependencies on after another. This is good, if you are determined to make a full boost build. In my case, I compiled bzip library http://www.bzip.org/downloads.html. This library is tricky to make. Boost needs the dynamic version on Linux.

make -f Makefile-libbz2_so

You have to manually copy the libbz2.so.1.0.6 file to /usr/local/lib The make two symbolic links

libbz2.so.1 -> libbz2.so.1.0.6
libbz2.so -> libbz2.so.1

After this my boost can be made and I saw:

The Boost C++ Libraries were successfully built!

Or try ./b2 -s NO_BZIP2=1 to skip

like image 24
Kemin Zhou Avatar answered Oct 17 '22 03:10

Kemin Zhou