Well, it's inelegant. But as my post-doc advisor, Cy Levinthal, once said,
"Elegance is for tailors".

Cheers,
-P.

On Wed, Mar 16, 2016 at 10:38 AM, Yingfeng Wang <ywang...@gmail.com> wrote:

> Peter,
>
> Thanks. This is a PERFECT general solution to all of this kind of
> headaches!
>
> Best,
> Yingfeng
>
> On Wed, Mar 16, 2016 at 10:27 AM, Peter S. Shenkin <shen...@gmail.com>
> wrote:
>
>> Yes, that's exactly what I meant. I'm not sure whether this sort of thing
>> still works in our troubled times, but it's easy enough to try.
>>
>> -P.
>>
>> On Wed, Mar 16, 2016 at 8:46 AM, Yingfeng Wang <ywang...@gmail.com>
>> wrote:
>>
>>> Peter,
>>>
>>> Thanks. Do you mean
>>>
>>> -lLibA_static -lLibB_static -lLibC_static -lLibA_static -lLibB_static
>>> -lLibC_static
>>>
>>> ?
>>>
>>> So, by this way, we don't need to worry about the order of these three
>>> libraries.
>>>
>>> Best,
>>> Yingfeng
>>>
>>> On Wed, Mar 16, 2016 at 12:36 AM, Peter S. Shenkin <shen...@gmail.com>
>>> wrote:
>>>
>>>> I'm not sure how this works with modern linkers, but "back in the old
>>>> days", you could kludge it by putting all libraries on the link line twice,
>>>> This also resolved circular references.
>>>>
>>>> -P.
>>>>
>>>> On Wed, Mar 16, 2016 at 12:05 AM, Greg Landrum <greg.land...@gmail.com>
>>>> wrote:
>>>>
>>>>> Though that would be useful information, I'm afraid that's not
>>>>> something I've ever put together.
>>>>>
>>>>> -greg
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Mar 15, 2016 at 6:26 PM, Yingfeng Wang <ywang...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Greg,
>>>>>>
>>>>>> Could you please give me an order of all libraries? Say, I want to
>>>>>> link all RDKit static libraries. I know most of which could be 
>>>>>> unnecessary,
>>>>>> but I just want to make my situation easy.  So, if I cannot figure out a
>>>>>> better plan, this way at least works.
>>>>>>
>>>>>> Thanks.
>>>>>> Yingfeng
>>>>>>
>>>>>> On Mon, Mar 14, 2016 at 8:16 AM, Greg Landrum <greg.land...@gmail.com
>>>>>> > wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Mar 12, 2016 at 5:00 AM, Yingfeng Wang <ywang...@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Greg,
>>>>>>>>
>>>>>>>> Thanks. Your suggestion solves my problem. I add the following part
>>>>>>>> in my compiling command.
>>>>>>>>
>>>>>>>> -L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib
>>>>>>>> -lRDInchiLib  -lInChi -lGraphMol -lRDGeneral
>>>>>>>>
>>>>>>>> and the complete compiling command is
>>>>>>>>
>>>>>>>> g++ -Wall -O2 -std=c++11  -I
>>>>>>>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code -I
>>>>>>>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External -I
>>>>>>>> /usr/local/Cellar/boost/1.60.0_1/include
>>>>>>>> -L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib 
>>>>>>>> -lRDInchiLib
>>>>>>>> -lInChi -lGraphMol -lRDGeneral  -o MYTEST main.cpp
>>>>>>>>
>>>>>>>> Is there a way to figure out which library I should link? Actually,
>>>>>>>> my backup plan is to link all libraries in
>>>>>>>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib
>>>>>>>>
>>>>>>>
>>>>>>> That's one approach, but it's kind of overkill. :-)
>>>>>>> The big thing is to know which library the functionality you are
>>>>>>> calling comes from. You can generally tell this from the header files 
>>>>>>> (i.e.
>>>>>>> if you include something from "DataStructs", then you need to include 
>>>>>>> the
>>>>>>> DataStructs library). this isn't perfect because some libraries have
>>>>>>> dependencies on others, but it often works The other approach is to 
>>>>>>> look in
>>>>>>> the RDKit source code at the CMakeLists.txt file for the libraries you 
>>>>>>> are
>>>>>>> using and look to see which extra libraries they include when building 
>>>>>>> the
>>>>>>> tests.
>>>>>>>
>>>>>>> This isn't very well documented. I think this kind of documentation
>>>>>>> is tricky to generate, so I don't want to do it unless it's going to 
>>>>>>> help a
>>>>>>> large number of people, and it's not at all clear to me how many C++ 
>>>>>>> RDKit
>>>>>>> users there are.
>>>>>>>
>>>>>>> By the way, is there a way to guarantee that users using my binary
>>>>>>>> file (e.g. MYTEST in this case) do not need to install RDKit? I tried
>>>>>>>> -static, but it didn't work. For example, I hope a user can run MYTEST 
>>>>>>>> on
>>>>>>>> another Mac without RDKit.
>>>>>>>>
>>>>>>>
>>>>>>> If you link against the _static version of the libraries (i.e.
>>>>>>> -lGraphMol_static instead of -lGraphMol), then you should end up with a
>>>>>>> version that doesn't require an RDKit install to run. It can be 
>>>>>>> trickier to
>>>>>>> get these commands right because on many (all?) systems, there is an 
>>>>>>> order
>>>>>>> dependency to static linkage. So since SmilesParse_static depends on
>>>>>>> GraphMol_static, GraphMol_static needs to appear *after* 
>>>>>>> SmilesParse_static
>>>>>>> in the link line.
>>>>>>>
>>>>>>> I hope this helps,
>>>>>>> -greg
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Transform Data into Opportunity.
>>>>> Accelerate data analysis in your applications with
>>>>> Intel Data Analytics Acceleration Library.
>>>>> Click to learn more.
>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
>>>>> _______________________________________________
>>>>> Rdkit-discuss mailing list
>>>>> Rdkit-discuss@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>>>
>>>>>
>>>>
>>>
>>
>
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to