Re: [AMBER-Developers] Compiling problem with a fresh checkout

From: Ben Roberts <>
Date: Wed, 21 Oct 2009 16:05:16 -0400

Wu, Xiongwu (NIH/NHLBI) [E] wrote:
> I just checkout a fresh copy of AMBER11 but see the following error
> when compiling it.
> ./configure gnu make -f Makefile_at clean make -f Makefile_at make
> clean make serial
> ...... ../netcdf/lib/libnetcdf.a(netcdf.o): In function
> `__netcdf__nf90_rename_var':
> /v/bigbox6/home/wxw/ambers/amber11/src/netcdf/src/f90/netcdf_variables.f90:86:
> undefined reference to `nf_rename_var_' collect2: ld returned 1 exit
> status make[1]: *** [sander] Error 1 make[1]: Leaving directory
> `/v/bigbox6/home/wxw/ambers/amber11/src/sander' make: *** [serial]
> Error 2
> Is my compiling procedure right?

Hi Xiongwu,

This may be my fault. I tweaked the configure script so it would use the
"-DpgiFortran" option when configuring netcdf; this was because using
the "-Df2cFortran" option - which is what it seemed to get by default,
but only if using gcc -m32 (gcc by itself was OK, as was Intel with or
without -m32) - would cause this kind of error, though with different

It's possible I broke something, though if you're not using a Mac I'd
wonder why, since I thought I had changed the configure script so that
the change I've described would only be done if working on a Mac.

The general problem is that there are a number of possible compiler
flags that can be passed to netCDF, and by changing the compiler flag
one can produce function names with different numbers of leading and
trailing underscores. If you get the wrong flag, your netCDF will not
compile. This caused me a good deal of pain over the last few days.

You can check whether your netCDF is compiling OK by doing a "make
check" in $AMBERHOME/src/netcdf/src.

If make check fails, you can try configuring netCDF with different
flags. For example, you could try using "-DpgiFortran", or
"-Df2cFortran". There may be other options as well. I found out about
those on the netCDF website; I forget what that is at the moment.

I can put the configure script back to how it was easily enough, though
that will break compilation on Snow Leopard (and possibly other forms of
Mac OS). But so I'm not too hasty (and so I don't create new problems
even as I fix existing ones), it would be helpful for me to know what
systems netCDF is breaking on, and whether the breakages have anything
to do with my changes.

Apologies for any inconvenience to Xiongwu and others.


AMBER-Developers mailing list
Received on Wed Oct 21 2009 - 13:30:09 PDT
Custom Search