[gmx-developers] Circular dependencies makes linker a dull boy

Erik Marklund erikm at xray.bmc.uu.se
Thu Nov 5 15:50:36 CET 2009


Axel Kohlmeyer skrev:
> On Thu, Nov 5, 2009 at 6:21 AM, Erik Marklund <erikm at xray.bmc.uu.se> wrote:
>   
>> Hi,
>>
>> I, along with a few colleagues, am adding a few files to src/kernel/ as part
>> of the implementation of qhop. I do get linker issues though, since force.c
>> in src/mdlib/ uses a few functions found in src/kernel/qhop.c. In the end,
>> this makes the kernel library dependent on the mdlib and vice versa. Moving
>> qhop.c to mdlib does not resolve this issue, as it too needs stuff from
>> kernel. How can I resolve this? Do I need to shuffle around more files,
>> force.c for instance?
>>     
>
> erik,
> are you sure that the function that you need from multiple places is
> properly prototyped and declared as "external"?
>
> cheers,
>     axel.
>   
Yes I believe so.

Luckily, I did manage to resolve this issue by moving the part of 
init_forcerec() that needs kernel stuff from mdlib/force.c to 
kernel/md.c. This is a bit ugly, but fixes my problem.

/Erik
>
>   
>> Here's the error:
>>>> /home/erikm/source/GMX/qhop_git/gromacs/src/mdlib/force.c:1613: undefined
>> reference to `mk_qhoprec'
>> collect2: ld returned 1 exit status
>>>>
>> Cheers,
>>
>> --
>> -----------------------------------------------
>> Erik Marklund, PhD student
>> Laboratory of Molecular Biophysics,
>> Dept. of Cell and Molecular Biology, Uppsala University.
>> Husargatan 3, Box 596,    75124 Uppsala, Sweden
>> phone:    +46 18 471 4537        fax: +46 18 511 755
>> erikm at xray.bmc.uu.se    http://xray.bmc.uu.se/molbiophys
>>
>> _______________________________________________
>> gmx-developers mailing list
>> gmx-developers at gromacs.org
>> http://lists.gromacs.org/mailman/listinfo/gmx-developers
>> Please don't post (un)subscribe requests to the list. Use the www interface
>> or send it to gmx-developers-request at gromacs.org.
>>
>>     
>
>
>
>   


-- 
-----------------------------------------------
Erik Marklund, PhD student
Laboratory of Molecular Biophysics,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,    75124 Uppsala, Sweden
phone:    +46 18 471 4537        fax: +46 18 511 755
erikm at xray.bmc.uu.se    http://xray.bmc.uu.se/molbiophys




More information about the gromacs.org_gmx-developers mailing list