From owner-freebsd-office@FreeBSD.ORG Tue Sep 2 13:46:41 2014 Return-Path: Delivered-To: office@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 157C4170 for ; Tue, 2 Sep 2014 13:46:41 +0000 (UTC) Received: from mail-lb0-x235.google.com (mail-lb0-x235.google.com [IPv6:2a00:1450:4010:c04::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8ED2A194B for ; Tue, 2 Sep 2014 13:46:40 +0000 (UTC) Received: by mail-lb0-f181.google.com with SMTP id n15so7432365lbi.26 for ; Tue, 02 Sep 2014 06:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=mKc0lpMARd53LGQ5Gxxt5bJqfBoCHPiicOzWNR4TTNI=; b=l/6uHFtz6P7by+ue8OH7fIOAGiSsoozK5R4c4F6FI2RzWUNPQ5HF7KXZm5zmYl8dkd rr8xdjHllJZFHLFPR64BHV0lrHphdzkWj8FPIMWS8j8mMghf839hCMOqXQ7mirqNhFmV RQGVKmRH1UymfKjntlCQtWaXFNfy5ZAyYk5FjoL6UgHAETrc8Sv9pdh26nLWRjzaosOQ 6HU1rS8XUszrBm1+vpUBl4iOC/F1n+Z9BXIDoaqAF5hdTjGx7s+qdP+O3vYyAdWH9DN4 SdnQWZSXJr/0K8A/wPZj4VEzLA2+TVCC4qIT/9fsIaD4H+u4gjsCs237Tt5FCCI8WbzK 9TjQ== X-Received: by 10.152.7.177 with SMTP id k17mr35776885laa.10.1409665598287; Tue, 02 Sep 2014 06:46:38 -0700 (PDT) Received: from ?IPv6:2a02:6b8::408:80c7:492f:a1e5:5c44? ([2a02:6b8:0:408:80c7:492f:a1e5:5c44]) by mx.google.com with ESMTPSA id yr17sm5489206lbb.46.2014.09.02.06.46.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Sep 2014 06:46:37 -0700 (PDT) Sender: Dmitry Sivachenko Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Need some help with compiling boost-dependent program From: Dmitry Sivachenko In-Reply-To: <9AB609D1-F643-4F77-B2F9-AD32F8988DFD@FreeBSD.org> Date: Tue, 2 Sep 2014 17:46:35 +0400 Content-Transfer-Encoding: quoted-printable Message-Id: <966C148F-9C92-4C41-840E-A767875B2234@FreeBSD.org> References: <9AB609D1-F643-4F77-B2F9-AD32F8988DFD@FreeBSD.org> To: office@FreeBSD.org X-Mailer: Apple Mail (2.1878.6) X-BeenThere: freebsd-office@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Office applications on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 13:46:41 -0000 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 = 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 std::__1::char_traits, std::__1::allocator > 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, std::__1::allocator >, = 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 , std::__1::char_traits, std::__1::allocator > 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