Re: [AMBER-Developers] [AMBER] CUDA install fails due to undefined netcdf definitions

From: Scott Brozell <>
Date: Wed, 12 Jun 2013 05:05:39 -0400


On Tue, Jun 11, 2013 at 10:49:24PM -0400, Jason Swails wrote:
> On Tue, Jun 11, 2013 at 9:27 PM, David A Case <>wrote:
> > On Tue, Jun 11, 2013, Jason Swails wrote:
> > >
> > > This actually makes a lot of sense now. It was definitely pulling the
> > > libnetcdf.a file from /usr/lib
> >
> > If I understand it, this sounds like incorrect behavior. Amber should not
> > be using /usr/lib/libnetcdf.a unless the user explicitly asks for it with
> > the --with-netcdf flag.
> It is certainly not what we _wanted_ to happen (so it is incorrect in that
> sense), but I'm pretty sure it's what _was_ happening (it's the only thing
> that explains the errors and the fix).
> The sander Makefile says:
> >
> > .... -L/home/case/amber12/lib -lnetcdf
> >
> > but I'm thinking this might not be correct -- is the "-L" directory
> > searched
> > before or after places like /usr/lib? (I'm afraid that the "-L" directory
> > comes at the end of LDFLAGS, not at the beginning.)

-L paths are searched before system paths.
/amber12/lib should clearly be the first -L path on the principle that
if we made it then we want to use it.

> It could come at the end, or the linker could be looking to link .so's
> first (and it may find those in /usr/lib before looking for the .a's in
> $AMBERHOME/lib). I'm not sure.

Yes .so has precedence over .a, so to force the principle use the library's
full path on the command line, ie, /amber12/lib/libnetcdf.a

It might be interesting to completely diagnose the source of the user's
problem ( another possibility is that /usr/lib64 actually gets to
/usr/lib/libnetcdf.a ), but the above has all we need to fix this.


---user command line
gfortran -O3 -mtune=native -DCUDA -Duse_SPFP -o pmemd.cuda gbl_constants.o gbl_datatypes.o state_in
fo.o file_io_dat.o mdin_ctrl_dat.o mdin_ewald_dat.o mdin_debugf_dat.o prmtop_dat.o inpcrd_dat.o dynami
cs_dat.o img.o nbips.o parallel_dat.o parallel.o gb_parallel.o pme_direct.o pme_recip_dat.o pme_slab_r
ecip.o pme_blk_recip.o pme_slab_fft.o pme_blk_fft.o pme_fft_dat.o fft1d.o bspline.o pme_force.o pbc.o
nb_pairlist.o nb_exclusions.o cit.o dynamics.o bonds.o angles.o dihedrals.o extra_pnts_nb14.o runmd.o
loadbal.o shake.o prfs.o mol_list.o runmin.o constraints.o axis_optimize.o gb_ene.o veclib.o gb_force.
o timers.o pmemd_lib.o runfiles.o file_io.o bintraj.o binrestart.o pmemd_clib.o pmemd.o random.o degcn
t.o erfcfun.o nmr_calls.o nmr_lib.o get_cmdline.o master_setup.o pme_alltasks_setup.o pme_setup.o ene_
frc_splines.o gb_alltasks_setup.o nextprmtop_section.o angles_ub.o dihedrals_imp.o cmap.o charmm.o cha
rmm_gold.o findmask.o remd.o multipmemd.o remd_exchg.o amd.o gbsa.o \
      ./cuda/cuda.a -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib -lcurand -lcufft -lcudart -L/usr/lib
64 -lstdc++ -L/usr/local/amber12/lib -L/usr/local/amber12/lib -lnetcdf

AMBER-Developers mailing list
Received on Wed Jun 12 2013 - 02:30:03 PDT
Custom Search