[gmx-users] Re: Opening .o files - in response to Erik's question.
Erik Marklund
erikm at xray.bmc.uu.se
Mon Jan 11 12:52:27 CET 2010
Justin A. Lemkul skrev:
>
>
> On 1/9/10 1:27 PM, Lum Nforbi wrote:
>> Thanks to Tsjerk, David and Erik for replying.
>> This is in response to Erik's question on what is it I intend to do
>> exactly.
>> I would like to view the source code for g_energy so that I can see what
>> formula was used to calculate Cp as well as viscosity (obtained when the
>> -vis option is used). I opened gmx_energy.c using
>> gromacs-4.0.5/src/tools$ more gmx_energy.c and found a code which I
>> think is the source code, but it is quite difficult to comprehend. I
>> guess this code is written in the c++ language, which I am unfamiliar
>> with, so I wanted to see if there was something else that had an
>> easier-to-understand code and that's why I tried opening the g_energy.o
>> file. This may be dumb but I am not quite used to the files and I will
>> eventually get it.
>>
>
> The source is written in C, and probably the .o file will be less
> useful. Since it is binary, it will certainly be almost
> unintelligible :)
>
>> If the gmx_energy.c file is the source code, is there a way convert it
>> into, for example, fortran?
>>
>
> There may be utilities to do so (I know f2c can go the other way), but
> reading the C code directly is probably the easiest way to do it.
Agreed. If you know your fortran well, C should not be too hard to
understand. I find that C is often - but not always - rather
straightforward and explicit. But then again, I'm quite used to it.
/Erik
>
> -Justin
>
>> Thank you,
>> Lum
>>
>>
>> > Lum Nforbi wrote:
>> >> Dear all,
>> >>
>> >> I am having problems opening the g_energy.o file in the
>> >> gromacs-4.0.5 folder. Can someone tell me how to open this file?
>> What
>> >> is the general way of opening .o files?
>> >>
>> >> Thank you,
>> >> Lum
>> >>
>> > this is an intermediate file from the compiler. You do not need to
>> > open it at any time.
>> >
>> That's not entirely true. I've inspected .o-files at times to find the
>> reason for certain linker problems. 'objdump', 'readelf' and 'nm' are
>> examples of linux tools that can extract information form .o-files.
>> Nevertheless, inspecting such files is only useful in very special
>> situations. What is it that you intend to do exactly?
>>
>
--
-----------------------------------------------
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-users
mailing list