[ 
https://issues.apache.org/jira/browse/THRIFT-4412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16283209#comment-16283209
 ] 

Mario Emmenlauer commented on THRIFT-4412:
------------------------------------------

Dear James, thanks for the quick response and help! Yes, When adding -L to 
{{LDFLAGS}} before running cmake then the correct libraries are used!

I also tested that the problem happens predominantly on older Linux (despite 
using newest cmake from the 3.9.x or 3.10.x series). I observe this problem on 
Ubuntu 14.04, CentOS 6 and CentOS 7, but not on Ubuntu 16.04 or 17.04.

Please let me re-phrase this issue as a feature request: If somebody knows 
(with little effort) how we could make sure that cmake uses the absolute linker 
path, then this would be a prefered behavior? Its good to have the workaround 
with the {{-L}} / {{-I}}, but standard cmake behavior would be to ensure that 
libs from {{CMAKE_PREFIX_PATH}} are preferred.

> thrift cmake does not use absolute library path, linking system libraries
> -------------------------------------------------------------------------
>
>                 Key: THRIFT-4412
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4412
>             Project: Thrift
>          Issue Type: Question
>          Components: Build Process
>    Affects Versions: 0.10.0, 0.11.0
>            Reporter: Mario Emmenlauer
>            Assignee: James E. King, III
>
> I build thrift using cmake on Linux. It works generally very good on many 
> platforms (I've tested Linux, Windows and MacOSX extensively). But one issue 
> is plaguing me. I have my own custom boost libraries, libevent and others. I 
> set {{CMAKE_PREFIX_PATH}} to their install directory. This generally also 
> works well, and cmake finds the libraries. However in the final Makefile, the 
> linker command uses {{-lxxx}} for library {{xxx}} instead of the usual cmake 
> absolute path {{/a/b/c/libxxx.so}}. This is a problem because {{ld}} suddenly 
> prefers the system libraries over my custom builds. This in turn breaks the 
> build for me.
> I do not have this problem with any other cmake builds. And I tried various 
> workarounds to force cmake to use the absolute path, but failed. Did somebody 
> maybe add this on purpose?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to