Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Sep 2014 17:46:35 +0400
From:      Dmitry Sivachenko <demon@FreeBSD.org>
To:        office@FreeBSD.org
Subject:   Re: Need some help with compiling boost-dependent program
Message-ID:  <966C148F-9C92-4C41-840E-A767875B2234@FreeBSD.org>
In-Reply-To: <9AB609D1-F643-4F77-B2F9-AD32F8988DFD@FreeBSD.org>
References:  <9AB609D1-F643-4F77-B2F9-AD32F8988DFD@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Okay, I figured out the cause: the problem was because boost was =
compiled with clang, and some other libraries were compiled with gcc.  =
And I was linking my program against both of them.
I patched the relevant libraries so everything is compiled with clang.

But what if there is another use-case when library can't be compiled =
with clang and the program needs to link with both that library and =
boost?

Is it possible to provide and OPTION for boost-libs so it can be =
compiled with either clang or gcc?



On 31 =D0=B0=D0=B2=D0=B3. 2014 =D0=B3., at 20:39, Dmitry Sivachenko =
<demon@FreeBSD.org> wrote:

> Hello Boost maintainers!
>=20
> I am trying to port mosesdecoder program =
(http://www.statmt.org/moses/) to FreeBSD-10/stable.
> It uses Boost heavily and depends on other libraries which are built =
using gcc-4.7.
>=20
> On some stage it fails to link with reasons unknown to me.
>=20
> I suspect this may be because Boost is built with clang, I build =
mosesdecoder with clang and other libraries were built using gcc (4.7).  =
May be I am wrong.
>=20
> The error is the following:
>=20
> =
moses/bin/clang-linux-3.4.1/release/debug-symbols-on/threading-multi/libmo=
ses.so
> : undefined reference to =
`randlm::Vocab::getWordID(std::__1::basic_string<char,
> std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
> =
moses/bin/clang-linux-3.4.1/release/debug-symbols-on/threading-multi/libmo=
ses.so
> : undefined reference to =
`lmContainer::CreateLanguageModel(std::__1::basic_strin
> g<char, std::__1::char_traits<char>, std::__1::allocator<char> >, =
float, float)'
> =
moses/bin/clang-linux-3.4.1/release/debug-symbols-on/threading-multi/libmo=
ses.so
> : undefined reference to =
`randlm::RandLM::initRandLM(std::__1::basic_string<char
> , std::__1::char_traits<char>, std::__1::allocator<char> > const&, =
int, int)'
> clang++: error: linker command failed with exit code 1 (use -v to see =
invocation
> )
>=20
> though linking command includes -lRandLM explicitly.
>=20
> You can get tarball for unfinished port so you can easily reproduce =
this here:
> http://people.freebsd.org/~demon/mosesdecoder.tar.gz
>=20
> Any help would be greatly appreciated.
> Build log is redirected to ${WRKSRC}/build.log to simplify analysis.
>=20
> Thanks in advance!
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?966C148F-9C92-4C41-840E-A767875B2234>