Re: AMBER: Problem in compiling sander with MMTSB

From: <luckyang.gmail.com>
Date: Wed, 1 Feb 2006 19:39:04 +0000

Dear Scott,

I added the bugfix 59 at the end of the bugfix.all and I got the following
when I patch it:

patching file src/sander/mmtsb_client.c
Hunk #1 FAILED at 180.
Hunk #2 FAILED at 195.
Hunk #3 FAILED at 301.
3 out of 3 hunks FAILED -- saving rejects to file patch_rejects. The
patch_rejects file is attached in this email.

I also patched the first 58 bugfixs and modified the file mmtsb_client.c
manually. Compile sander give me:

gcc -c -DCLINK_CAPS -DMMTSB -o mmtsb_client.o mmtsb_client.c
mmtsb_client.c:183: error: syntax error before '!' token
mmtsb_client.c:183: error: syntax error at '#' token
mmtsb_client.c:188:3: #else after #else
mmtsb_client.c:1:1: the conditional began here
mmtsb_client.c:191:2: #endif without #if
mmtsb_client.c:193: error: incompatible types in initialization
mmtsb_client.c:193: error: initializer element is not constant
mmtsb_client.c:193: warning: data definition has no type or storage class
mmtsb_client.c:194: error: incompatible types in initialization
mmtsb_client.c:194: error: initializer element is not constant
mmtsb_client.c:194: warning: data definition has no type or storage class
mmtsb_client.c:195: error: incompatible types in initialization
mmtsb_client.c:195: error: initializer element is not constant
mmtsb_client.c:195: warning: data definition has no type or storage class
mmtsb_client.c:196: error: syntax error before '}' token
mmtsb_client.c:198: error: syntax error at '#' token
mmtsb_client.c:202:3: #else without #if
mmtsb_client.c:203: error: syntax error at '#' token
mmtsb_client.c:207:2: #else without #if
mmtsb_client.c:212:2: #endif without #if
mmtsb_client.c:213:2: #endif without #if
mmtsb_client.c:223: error: initializer element is not constant
mmtsb_client.c:236: error: conflicting types for 'buf1'
mmtsb_client.c:231: error: previous declaration of 'buf1' was here
mmtsb_client.c:236: warning: data definition has no type or storage class
mmtsb_client.c:237: error: conflicting types for 'buf2'
mmtsb_client.c:232: error: previous declaration of 'buf2' was here
mmtsb_client.c:237: warning: data definition has no type or storage class
mmtsb_client.c:239: warning: parameter names (without types) in function
declaration
mmtsb_client.c:239: error: conflicting types for 'copyFortranString'
mmtsb_client.c:35: error: previous definition of 'copyFortranString' was
here
mmtsb_client.c:239: warning: data definition has no type or storage class
mmtsb_client.c:240: warning: parameter names (without types) in function
declaration
mmtsb_client.c:240: warning: data definition has no type or storage class
mmtsb_client.c:241: warning: parameter names (without types) in function
declaration
mmtsb_client.c:241: warning: data definition has no type or storage class
mmtsb_client.c:242: warning: parameter names (without types) in function
declaration
mmtsb_client.c:242: warning: data definition has no type or storage class
mmtsb_client.c:244: error: syntax error before "if"
mmtsb_client.c:252: error: redefinition of 'first'
mmtsb_client.c:12: error: previous definition of 'first' was here
mmtsb_client.c:252: warning: data definition has no type or storage class
mmtsb_client.c:253: error: syntax error before '}' token
mmtsb_client.c:258: error: syntax error before string constant
mmtsb_client.c:258: error: conflicting types for 'sendFile'
mmtsb_client.c:143: error: previous definition of 'sendFile' was here
mmtsb_client.c:258: warning: data definition has no type or storage class
mmtsb_client.c:259: error: syntax error before string constant
mmtsb_client.c:259: warning: data definition has no type or storage class
mmtsb_client.c:260: error: syntax error before string constant
mmtsb_client.c:260: warning: data definition has no type or storage class
mmtsb_client.c:272: warning: parameter names (without types) in function
declaration
mmtsb_client.c:272: warning: data definition has no type or storage class
mmtsb_client.c:274: warning: parameter names (without types) in function
declaration
mmtsb_client.c:274: warning: data definition has no type or storage class
mmtsb_client.c:276: error: initializer element is not constant
mmtsb_client.c:276: warning: data definition has no type or storage class
mmtsb_client.c:278: error: conflicting types for 'rgval'
mmtsb_client.c:15: error: previous definition of 'rgval' was here
mmtsb_client.c:278: warning: data definition has no type or storage class
mmtsb_client.c:279: error: conflicting types for 'rgforce'
mmtsb_client.c:16: error: previous definition of 'rgforce' was here
mmtsb_client.c:279: warning: data definition has no type or storage class
mmtsb_client.c:280: error: conflicting types for 'rhoval'
mmtsb_client.c:17: error: previous definition of 'rhoval' was here
mmtsb_client.c:280: warning: data definition has no type or storage class
mmtsb_client.c:281: error: conflicting types for 'rhoforce'
mmtsb_client.c:18: error: previous definition of 'rhoforce' was here
mmtsb_client.c:281: warning: data definition has no type or storage class
mmtsb_client.c:283: error: syntax error before "if"
mmtsb_client.c:290: warning: parameter names (without types) in function
declaration
mmtsb_client.c:290: error: conflicting types for 'free'
/usr/include/stdlib.h:597: error: previous declaration of 'free' was here
mmtsb_client.c:290: error: conflicting types for 'free'
/usr/include/stdlib.h:597: error: previous declaration of 'free' was here
mmtsb_client.c:290: warning: data definition has no type or storage class
mmtsb_client.c:295: error: syntax error before "if"
mmtsb_client.c:297: error: redefinition of 'connection'
mmtsb_client.c:13: error: previous definition of 'connection' was here
mmtsb_client.c:297: warning: data definition has no type or storage class
mmtsb_client.c:298: error: syntax error before "return"
mmtsb_client.c:304: error: syntax error at '#' token
mmtsb_client.c:308:3: #else without #if
mmtsb_client.c:309: error: syntax error at '#' token
mmtsb_client.c:313:2: #else without #if
mmtsb_client.c:317:2: #endif without #if
mmtsb_client.c:318:2: #endif without #if
mmtsb_client.c:328: error: redefinition of 'buffer'
mmtsb_client.c:223: error: previous definition of 'buffer' was here
mmtsb_client.c:328: error: initializer element is not constant
mmtsb_client.c:331: error: conflicting types for 'mode'
mmtsb_client.c:226: error: previous declaration of 'mode' was here
mmtsb_client.c:333: warning: parameter names (without types) in function
declaration
mmtsb_client.c:333: warning: data definition has no type or storage class
mmtsb_client.c:334: warning: parameter names (without types) in function
declaration
mmtsb_client.c:334: warning: data definition has no type or storage class
mmtsb_client.c:335: warning: parameter names (without types) in function
declaration
mmtsb_client.c:335: warning: data definition has no type or storage class
mmtsb_client.c:336: warning: parameter names (without types) in function
declaration
mmtsb_client.c:336: warning: data definition has no type or storage class
mmtsb_client.c:338: error: syntax error before "if"
mmtsb_client.c:346: error: syntax error before string constant
mmtsb_client.c:346: error: conflicting types for 'sprintf'
mmtsb_client.c:346: note: a parameter list with an ellipsis can't match an
empty parameter name list declaration
mmtsb_client.c:346: error: conflicting types for 'sprintf'
mmtsb_client.c:346: note: a parameter list with an ellipsis can't match an
empty parameter name list declaration
mmtsb_client.c:346: warning: data definition has no type or storage class
mmtsb_client.c:347: warning: parameter names (without types) in function
declaration
mmtsb_client.c:347: warning: data definition has no type or storage class
mmtsb_client.c:348: warning: parameter names (without types) in function
declaration
mmtsb_client.c:348: warning: data definition has no type or storage class
mmtsb_client.c:350: error: syntax error before "if"
mmtsb_client.c:352: error: initializer element is not constant
mmtsb_client.c:352: warning: data definition has no type or storage class
mmtsb_client.c:353: warning: parameter names (without types) in function
declaration
mmtsb_client.c:353: warning: data definition has no type or storage class
mmtsb_client.c:354: error: variable-size type declared outside of any
function
mmtsb_client.c:354: error: variable-sized object may not be initialized
mmtsb_client.c:354: error: conflicting types for 'buffer'
mmtsb_client.c:328: error: previous definition of 'buffer' was here
mmtsb_client.c:354: error: conflicting types for 'buffer'
mmtsb_client.c:328: error: previous definition of 'buffer' was here
mmtsb_client.c:354: warning: data definition has no type or storage class
mmtsb_client.c:355: error: syntax error before string constant
mmtsb_client.c:355: warning: data definition has no type or storage class
mmtsb_client.c:356: warning: parameter names (without types) in function
declaration
mmtsb_client.c:356: warning: data definition has no type or storage class
mmtsb_client.c:357: warning: parameter names (without types) in function
declaration
mmtsb_client.c:357: warning: data definition has no type or storage class
mmtsb_client.c:358: error: syntax error before '}' token
mmtsb_client.c:359: warning: parameter names (without types) in function
declaration
mmtsb_client.c:359: warning: data definition has no type or storage class
mmtsb_client.c:360: error: syntax error before '}' token
mmtsb_client.c:362: error: syntax error before string constant
mmtsb_client.c:362: warning: data definition has no type or storage class
mmtsb_client.c:363: warning: parameter names (without types) in function
declaration
mmtsb_client.c:363: warning: data definition has no type or storage class
mmtsb_client.c:365: warning: parameter names (without types) in function
declaration
mmtsb_client.c:365: warning: data definition has no type or storage class
mmtsb_client.c:367: error: syntax error before string constant
mmtsb_client.c:367: error: conflicting types for 'sscanf'
mmtsb_client.c:367: note: a parameter list with an ellipsis can't match an
empty parameter name list declaration
mmtsb_client.c:367: error: conflicting types for 'sscanf'
mmtsb_client.c:367: note: a parameter list with an ellipsis can't match an
empty parameter name list declaration
mmtsb_client.c:367: warning: data definition has no type or storage class
mmtsb_client.c:369: warning: parameter names (without types) in function
declaration
mmtsb_client.c:369: warning: data definition has no type or storage class
mmtsb_client.c:371: error: syntax error before "if"
mmtsb_client.c:373: error: redefinition of 'connection'
mmtsb_client.c:297: error: previous definition of 'connection' was here
mmtsb_client.c:373: error: redefinition of 'connection'
mmtsb_client.c:297: error: previous definition of 'connection' was here
mmtsb_client.c:373: warning: data definition has no type or storage class
mmtsb_client.c:374: error: syntax error before "return"
mmtsb_client.c:379:2: #endif without #if
make: *** [mmtsb_client.o] Error 1

Do you know what's the problem?

Thanks,

Lu Yang
Tulane University

On 2/1/06, Scott Brozell <sbrozell.scripps.edu> wrote:
>
> 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.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.scripps.edu> wrote:
> > >
> > > Hi,
> > >
> > > On Tue, 31 Jan 2006 luckyang.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.scripps.edu
> To unsubscribe, send "unsubscribe amber" to majordomo.scripps.edu
>



-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber.scripps.edu
To unsubscribe, send "unsubscribe amber" to majordomo.scripps.edu

Received on Thu Feb 02 2006 - 06:10:06 PST
Custom Search