Boost logo

Boost :

Subject: Re: [boost] Failing to build Boost.Test library using Clang 3.1 on Netbeans
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2012-11-20 11:53:29


> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Paul A.
> Bristow
> Sent: Saturday, November 17, 2012 9:16 AM
> To: boost_at_[hidden]
> Subject: Re: [boost] Failing to build Boost.Test library using Clang 3.1 on Netbeans
>
> > -----Original Message-----
> > From: boost-bounces_at_[hidden]
> > [mailto:boost-bounces_at_[hidden]] On Behalf Of Jürgen Hunold
> > Sent: Friday, November 16, 2012 7:53 PM
> > To: boost_at_[hidden]
> > Subject: Re: [boost] Failing to build Boost.Test library using Clang
> > 3.1 on Netbeans
> >
> > Hi Paul.
> >
> > On Friday, 16. November 2012 19:48:18 Jürgen Hunold wrote:
> > > I think both older versions from Ruben, too. I set up those machine
> > > at least half a year ago, so I don't remember details.
> > >
> > > I'll do a new setup and report again.
> >
> > Working setup is:
> >
> > e:\Home\hunold\src\test\graph>clang++ -v clang version 3.1
> > (tags/RELEASE_31/final 161181) (llvm/tags/RELEASE_31/final
> > 161243)
> > Target: i686-w64-mingw32
> > Thread model: posix
> >
> > e:\Home\hunold\src\test\graph>g++ -v
> > Using built-in specs.
> > COLLECT_GCC=g++
> > COLLECT_LTO_WRAPPER=e:/dev/apps/mingw32-dw2/bin/../libexec/gcc/i686-w6
> > 4-
> > mingw32/4.6.3/lto-wrapper.exe
> > Target: i686-w64-mingw32
> > Configured with: /home/ruben/mingw-w64/src/gcc/configure
> > --host=i686-w64-
> > mingw32 --build=x86_64-linux-gnu --target=i686-w64-mingw32 --with-
> > sysroot=/home/ruben/m
> > ingw-w64/mingw32mingw32-dw2/mingw32-dw2 --prefix=/home/ruben/mingw-
> > w64/mingw32mingw32-dw2/mingw32-dw2 --with-gmp=/home/ruben/mingw-
> > w64/prereq/i686-w64- mingw32-d w2/install
> > --with-mpfr=/home/ruben/mingw-w64/prereq/i686-w64-mingw32-
> > dw2/install --with-mpc=/home/ruben/mingw-w64/prereq/i686-w64-mingw32-
> > dw2/install --with-ppl
> > =/home/ruben/mingw-w64/prereq/i686-w64-mingw32-dw2/install --with-
> > cloog=/home/ruben/mingw- w64/prereq/i686-w64-mingw32-dw2/install
> > --enable- cloog-backend=isl --w
> ith-host-libstdcxx='-static -
> > lstdc++ -lm' --enable-shared --enable-static --
> > enable-threads=win32 --enable-plugins --disable-multilib --enable-
> > languages=c,lto,c+
> > +,objc,obj-c++,fortran,java --enable-libgomp --enable-dw2-exceptions
> > +--
> > disable-sjlj-exceptions --enable-fully-dynamic-string
> > --enable-libstdcxx-time --disable-n ls
> --disable-werror
> > --enable-checking=release --with-gnu-as --with-gnu-ld --
> > disable-win32-registry --disable-rpath
> --disable-
> > werror --with-libiconv- prefix=/home
> > /ruben/mingw-w64/prereq/i686-w64-mingw32-dw2/install
> > CFLAGS='-O2 - march=nocona -mtune=core2 -fomit-frame-pointer
> > -momit-leaf-frame-pointer -
> fgraphite-
> > identity - floop-interchange -floop-block -floop-parallelize-all'
> > LDFLAGS= Thread model: win32 gcc
> version
> > 4.6.3 (GCC)
> >
> >
> > Extracted from:
> > i686-w64-mingw32-gcc-dw2-4.6.3-1-release-win32_rubenvb.7z
> > i686-w64-mingw32-clang-3.1-release-win32_rubenvb.7z
> >
> > Those are the 32bit dw2 compilers from "Home / Toolchains targetting
> > Win32 / Personal Builds / rubenvb / gcc-dw2-4.6- release" and "Home /
> > Toolchains targetting Win32 / Personal Builds / rubenvb / clang-3.1-
> > release"
> >
> > No special setup for clang needed.
> > It seems the 64bit version of clang on windows is broken. These are
> > gcc/clang/mingww64 issues.
> >
> > The notes for clang on the download pages especially state "I also
> > provide 64- bit builds, but these are only useful for C." so I consider that "known bug".
> >
> > Using gcc-4.7.2 also fails.
> >
>
> Very many thanks for all your work on this.
>
> I am using 32 bit windows, so should work.
> I'll try your change to clang tool definition to see if I can reproduce this.

I have finally got this work using

# Clang tool configuration based on as used by Jurgen Hunold 16 Nov 2012

using clang
        : #version
        3.1
        : # compiler
        "C:/mingw32-dw2/bin/clang++.exe"
        : # options (header path)
        <cxxflags>-v # verbose for testing.
        <cxxflags>-IC:/mingw32-dw2/include/c++/4.6.3 # for stdlib?
        <cxxflags>-IC:/mingw32-dw2/i686-w64-mingw32/include
        :
        ;

but it failed to link because these two files were not found

        "C:/mingw32-dw2/bin/ar.exe"
        "C:/mingw32-dw2/bin/ranlib.exe"

adding

  <root>"C:/mingw32-dw2/bin"

didn't work, so I hacked it by adding

  set PATH=c:/mingw32-dw2/bin;%PATH%

to my command file calling bjam ...

(I've asked on the Boost Build list for suggestion on how this *should* be done).

This general the expected libraries

I:/boost-trunk/stage/lib/libbost_unit_test_framework-clang31-mt-sd-1_53.lib

I:/boost-trunk/stage/lib/libbost_unit_test_framework-clang31-mt-s-1_53.lib

and, after some difficulty getting NetBeans to find this file, I finally got a simple program using
Boost.Test to work.

Many thanks for your invaluable help.

Paul

> ---
> Paul A. Bristow,
> Prizet Farmhouse, Kendal LA8 8AB UK
> +44 1539 561830 07714330204
> pbristow_at_[hidden]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk