[gmx-users] Installing topolbuild

Bruce D. Ray brucedray at yahoo.com
Fri Mar 6 14:33:36 CET 2009

From: vivek sharma <viveksharma.iitb at gmail.com>
To: Discussion list for GROMACS users <gmx-users at gromacs.org>
Subject: Re: [gmx-users] Installing topolbuild

On Friday, March 6, 2009 2:29:32 AM,
vivek sharma <viveksharma.iitb at gmail.com> wrote:
> Thanks for your reply. I am workin on RHEL with architecture x86_64. 
> when i searched for libm.* I got a few location, I tried "make: again after
> exporting these location in LD_LIBRARY_PATH. but i am getting the
> same error again.

I am not familiar with RHEL nor with x86_64 bit architecture.  I believe
that 64 bit *nixes have both 32 bit and 64 bit libraries.  Thus, one needs
to select the correct libm.* for the compilation options.  It is probably best
to use 32 bit compilation options for topolbuild, but I don't know what
those would be for the compiler you are using.

> I think, i didn't downloaded the appropriate files for
> installation. Can you tell me the appropriate location to download the
> topolbuild.

topolbuild 1.2.1 (does gromacs ua and amber forcefields) is at:

topolbuild 1.1.2 (does amber forcefields only) is at:

> And some precise installation instruction can help me more, as I am not
> comfortable with linux env. 

Because I do not know every system and in particular have absolutely
no knowledge of RHEL in general or RHEL with architecture x86_64
in particular, the only instructions I can give you are:

1. Set appropriate environmental parameters for your system.
2. Edit one of the two Makefiles (Makefile and Makefile.G4OsX) 
   supplied to set such parameters as compiler, compilation options,
   library selections, and needed libraries appropriate for your system.
3. make -f <your Makefile>

Both Makefile and Makefile.G4OsX specify the compiler with
the line
      CC = cc
This might need to be changed either by passing the option
when invoking make or by editing the appropriate file.

Compiler options are the only line that differs between Makefile
and Makefile.G4OsX and are specified on a line that reads for
      CFLAGS = -O
or for Makefile.G4OsX:
      CFLAGS = -O2 -mcpu=7450 -mtune=970

The compilation instruction reads:
    \t$(CC) -o $(PROGRAM) $(CFLAGS) $(SOURCES) -lm
where I am denoting the tab at the start of the line with "\t"
because this composer seems to replace the tab with spaces
and I want this to be absolutely clear.  Pointers to special
libraries can be added to this line as -L/<path-to-library>.
Libraries are selected with -l<name-stripped-of-lib-and-.*>.

All of the systems to which I have ever had access have always
had exp and sqrt functions located in /usr/lib/libm.so (SUN),
/usr/lib32/libm.so (SGI), or /usr/lib/libm.dylib (Os X).  You should
check your systems documentation to be sure that the correct library
and correct library options are selected.

I do not have access to very many systems.  This has compiled on Mac
G4 ppc simply by typing -f Makefile.G4OsX
I am told that it compiles on intel based Mac's running OsX and on at
least some versions of 32 bit Linux.

As I look at your error message, it appears to me as if there might have
been some prior warning messages that could shed more light on this.
In particular, where is math.h located?

> 2009/3/5 Bruce D. Ray <brucedray at yahoo.com>
> On Thursday, March 5, 2009 1:47:28 AM,

> vivek sharma <viveksharma.iitb at gmail.com> wrote:
>> I am trying to Install topolbuild on my system, while doing so with
>> the make file given in the topolbuild folder. but I end up with a list
>> of error mentioned below:
>> ......
>> .
>> .
>> .
>> .compare_FF.c:(.text+0x1285): undefined reference to `exp'
compare_FF.c:(.text+0x12cc): undefined reference to `sqrt'
>> collect2: ld returned 1 exit status
>> make: *** [topolbuild] Error 1
>> If somebody has tried this. please help me in figuring out the problem.
> The errors mean that ld cannot locate the math library ( the -lm in the
> compilation instruction in Makefile which tells it to link against libm.*
> that is usually found in /usr/lib .  On most *nix's, this is libm.so but
its libm.dylib on Mac OS X.)  If libm.* is not present in either the
> standard location, or in someplace pointed to by LD_LIBRARY_PATH
> then it will not be found.
> What is the system on which you are trying to build, where is libm.*
located, and what is LD_LIBRARY_PATH set to?  If libm.* is in
> some unusual place, then the easiest way to go is to add that location
> As a side note, an early version of topolbuild was missing the -lm
in the compilation instruction in Makefile.  I checked what I've
> submitted since then and the makefiles all have the -lm as the last
> item in the compilation instruction.


Bruce D. Ray, Ph.D.
Associate Scientist
Physics Dept.
402 N. Blackford St.
Indianapolis, IN  46202-3273

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20090306/5e638a1f/attachment.html>

More information about the gromacs.org_gmx-users mailing list