AMBER Archive (2006)

Subject: Re: AMBER: Problem in compiling sander with MMTSB

From: Scott Brozell (sbrozell_at_scripps.edu)
Date: Tue Jan 31 2006 - 23:54:56 CST


Hi,

Short version:
This is probably due to Fortran external name mangling.
Apply bugfix 59 which is at the tail.

Long version:
In Amber notation you want CLINK_CAPS for your platform.
This is defined correctly in configure for absoft.
However, the necessary preprocessing in mmtsb_client.c has not been
updated to Amber notation.
I do not have access to an absoft compiler, but have tested the
patch generally.

Background info stolen from quantum chem package COLUMBUS:
/* 04-May-92 written by Ron */

/* Define the external symbols. These must be defined so that */
/* the Fortran interface is portable. This machine-dependency */
/* is localized in this file in order to simplify the C code. */
/* #elif is not recognized by all C preprocessors, so punt. -rls */

/* 11-Feb-2005 updated by Scott */

/* Even after thirteen years, three schemes of external name */
/* generation by Fortran compilers are still commonly used: */
/* the name in lowercase with a trailing underscore, the name in */
/* lowercase, and the name in uppercase */
/* in descending order of popularity. */
/* These schemes are usually beyond the control of the compiler's */
/* user. (Other schemes exist, notably two trailing underscores */
/* by GNU compilers, but compiler options can control that behavior.) */
/* Thus some mechanism to translate external names between Fortran */
/* and C, which usually does no mangling, is still necessary. */
/* Since Ron has already done the leg work, we use his mechanism */
/* with modifications intended to decouple a platform name from the */
/* scheme employed by that platform. Basically we move the */
/* platform--scheme information from this file into the platform */
/* configuration files. To implement the modified mechanism */
/* two new preprocessor names are specified: */
/* CLINK_CAPS should be defined when external names are in uppercase; */
/* CLINK_PLAIN should be defined when external names are in lowercase. */
/* When external names are in lowercase with a trailing underscore, */
/* no special preprocessor name is necessary. In addition, in */
/* configuration files for GNU compilers the no second underscore */
/* option, -fno-second-underscore, should be used. Note that these */
/* preprocessor names are the same as those used by the AMBER */
/* software. Since ANSI C now supports elif, the preprocessing logic */
/* is simplified. */

On Tue, 31 Jan 2006 luckyang_at_gmail.com wrote:

> yes. I followed the instruction in AMBER 8 manual. My fortran compiler is
> from ABSOFT and there is no problem to compile the noraml sander.
>
> Thanks,
>
> Lu Yang
>
> On 1/30/06, Scott Brozell <sbrozell_at_scripps.edu> wrote:
> >
> > Hi,
> >
> > On Tue, 31 Jan 2006 luckyang_at_gmail.com wrote:
> >
> > > Dear AMBER users,
> > >
> > > I am trying to compile sander with support for MMTSB and I get the
> > following
> > > message:
> > >
> > > /usr/bin/ld: Warning: alignment 32 of symbol `_D_in_DECOMP' in decomp.ois
> > > smaller than 64 in runmd.o
> > > mmtsb.o(.text+0x1284): In function `MMTSB_NEWLAMBDA':
> > > : undefined reference to `NEWTEMP'
> > > mmtsb.o(.text+0x12de): In function `MMTSB_NEWLAMBDA':
> > > : undefined reference to `GETBIAS'
> > > mmtsb.o(.text+0x1390): In function `MMTSB_NEWTEMP':
> > > : undefined reference to `NEWTEMP'
> > > collect2: ld returned 1 exit status
> > > link failed.
> > > make: *** [sander] Error 1
> >
> > Did you re-configure to request mmtsb ?
> >
> > cd $AMBERHOME/src
> > ./configure -mmtsb yada yada yada
> > cd sander
> > make ...
> >

<html><body><pre>
********>Bugfix 59:
Author: Scott Brozell
Date: 01/31/2006

Programs: sander

Description: Compilation of sander with MMTSB (configure -mmtsb ...)
             will fail on platforms where Fortran generates external
             names that are not the name in lowercase with a trailing
             underscore.

Fix: apply the following patch to amber8/src/sander/mmtsb_client.c

------------------------------------------------------------------------------
*** mmtsb_client.c 14 Jun 2003 00:39:13 -0000 7.6
--- mmtsb_client.c 1 Feb 2006 06:05:05 -0000
***************
*** 180,189 ****
  }

! #if defined CRAY
  void GETBIAS(double *rg, double *krg, double *rho, double *krho) {
  #else
! #if defined IBM
  void getbias(double *rg, double *krg, double *rho, double *krho) {
  #else
  void getbias_(double *rg, double *krg, double *rho, double *krho) {
--- 180,189 ----
  }

! #if defined CRAY || defined CLINK_CAPS
  void GETBIAS(double *rg, double *krg, double *rho, double *krho) {
  #else
! #if defined IBM || defined CLINK_PLAIN
  void getbias(double *rg, double *krg, double *rho, double *krho) {
  #else
  void getbias_(double *rg, double *krg, double *rho, double *krho) {
***************
*** 195,206 ****
    *krho=rhoforce;
  }

! #if defined CRAY
  double NEWTEMP(char *svname, char *svport, char *svid, char *jid, char *dir,
           double *energy, double *rg, double *rho, int *sendfiles,
           int lensvname, int lensvport, int lensvid, int lenjid, int lendir) {
  #else
! #if defined IBM
  double newtemp(char *svname, char *svport, char *svid, char *jid, char *dir,
           double *energy, double *rg, double *rho, int *sendfiles,
           int lensvname, int lensvport, int lensvid, int lenjid, int lendir) {
--- 195,206 ----
    *krho=rhoforce;
  }

! #if defined CRAY || defined CLINK_CAPS
  double NEWTEMP(char *svname, char *svport, char *svid, char *jid, char *dir,
           double *energy, double *rg, double *rho, int *sendfiles,
           int lensvname, int lensvport, int lensvid, int lenjid, int lendir) {
  #else
! #if defined IBM || defined CLINK_PLAIN
  double newtemp(char *svname, char *svport, char *svid, char *jid, char *dir,
           double *energy, double *rg, double *rho, int *sendfiles,
           int lensvname, int lensvport, int lensvid, int lenjid, int lendir) {
***************
*** 301,312 ****
  }

! #ifdef CRAY
  double NEXTCONF(char *svname, char *svport, char *svid, char *jid, char *dir,
        double *energy, double *ecent, double *etemp, int *sendfiles,
        int lensvname, int lensvport, int lensvid, int lenjid, int lendir) {
  #else
! #if defined IBM
  double nextconf(char *svname, char *svport, char *svid, char *jid, char *dir,
        double *energy, double *ecent, double *etemp, int *sendfiles,
        int lensvname, int lensvport, int lensvid, int lenjid, int lendir) {
--- 301,312 ----
  }

! #if defined CRAY || defined CLINK_CAPS
  double NEXTCONF(char *svname, char *svport, char *svid, char *jid, char *dir,
        double *energy, double *ecent, double *etemp, int *sendfiles,
        int lensvname, int lensvport, int lensvid, int lenjid, int lendir) {
  #else
! #if defined IBM || defined CLINK_PLAIN
  double nextconf(char *svname, char *svport, char *svid, char *jid, char *dir,
        double *energy, double *ecent, double *etemp, int *sendfiles,
        int lensvname, int lensvport, int lensvid, int lenjid, int lendir) {
------------------------------------------------------------------------------

Temporary workarounds: use AMBERBUILDFLAGS to define the appropriate
                       preprocessor name, e.g., make AMBERBUILDFLAGS='-DIBM'

</pre></body></html>
-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber_at_scripps.edu
To unsubscribe, send "unsubscribe amber" to majordomo_at_scripps.edu