[gmx-users] Re: Opening .o files - in response to Erik's question.

Justin A. Lemkul jalemkul at vt.edu
Sat Jan 9 19:35:09 CET 2010



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.

-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?
>

-- 
========================================

Justin A. Lemkul
Ph.D. Candidate
ICTAS Doctoral Scholar
MILES-IGERT Trainee
Department of Biochemistry
Virginia Tech
Blacksburg, VA
jalemkul[at]vt.edu | (540) 231-9080
http://www.bevanlab.biochem.vt.edu/Pages/Personal/justin

========================================



More information about the gromacs.org_gmx-users mailing list