Need some help with compiling boost-dependent program
Dmitry Sivachenko
demon at FreeBSD.org
Tue Sep 2 13:46:41 UTC 2014
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 авг. 2014 г., at 20:39, Dmitry Sivachenko <demon at FreeBSD.org> wrote:
> Hello Boost maintainers!
>
> 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.
>
> On some stage it fails to link with reasons unknown to me.
>
> 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.
>
> The error is the following:
>
> moses/bin/clang-linux-3.4.1/release/debug-symbols-on/threading-multi/libmoses.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/libmoses.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/libmoses.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
> )
>
> though linking command includes -lRandLM explicitly.
>
> You can get tarball for unfinished port so you can easily reproduce this here:
> http://people.freebsd.org/~demon/mosesdecoder.tar.gz
>
> Any help would be greatly appreciated.
> Build log is redirected to ${WRKSRC}/build.log to simplify analysis.
>
> Thanks in advance!
>
More information about the freebsd-office
mailing list