Re: [AMBER-Developers] netcdff's configure options

From: Timothy J Giese <timothyjgiese.gmail.com>
Date: Wed, 19 Mar 2014 19:27:20 -0400

Just an observational note regarding the compilation of
AmberTools/src/netcdf-fortran-4.2/

If someone has troubles compiling netcdff it may be due, as you surely
already know, to single vs double underscores in the symbols.

These are controlled in
AmberTools/src/netcdf-fortran-4.2/fortran/ncfortran.h

See e.g., the section starting with

/*******************************************************************************
  * The following is for f2c-support only.
  */
#if defined(f2cFortran) && !defined(pgiFortran) && !defined(gFortran)



If the user is compiling with the gcc toolchain, netcdf's configure may
properly determine the use of gcc, but if the name of compiler is funny
e.g., gfortran44,
(or maybe because the compiler is REALLY old - I'm not sure of the
exact reason for the problems I was seeing), problems can occur.

The "fix" (at least what worked for me) is to use
CPPFLAGS="-I$AMBERHOME/include -DgFortran"
when running
AmberTools/src/netcdf-fortran-4.2/configure


This presumably holds true if a funnily-named pgi compiler is used...
in which case, add "-DpgiFortran" to CPPFLAGS


Considering that AmberTools/src/configure2 requires one to specify
gnu/pgi/intel etc, this preprocessor could possibly even be added to
configure2

-Tim

_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Wed Mar 19 2014 - 17:00:02 PDT
Custom Search