[AMBER-Developers] more on netcdf configuration problems on mac

From: case <case.biomaps.rutgers.edu>
Date: Mon, 16 Nov 2009 14:32:33 -0500

Here is some more info on configuring netcdf on Macintosh:

I now have both 10.5 and 10.6 machines, but for me, the cvs configure step
fails for both, giving undefined symbols to netcdf routines when compiling

After hours of hair-pulling, I think the problem boils down to the $march
variable introduced in configure, revision 1.37. What happens is this:
even though $march is empty for macos, the variable passed to the netcdf
configure is CC="$cc $march", which expands to "gcc ". The extra space
interferes with netcdf's ability to recognize the type of compiler, and to
automagically set pgiFortran.

Before this change, netcdf's configure was called with CC="gcc", and
everything worked.

So, here is my proposed change to configure:

RCS file: /home/amber_cvs/cvsroot/amber11/src/configure,v
retrieving revision 1.39
diff -u -r1.39 configure
--- configure 12 Nov 2009 08:38:47 -0000 1.39
+++ configure 16 Nov 2009 19:13:31 -0000
.@ -886,9 +886,9 @@
             ./configure $netcdfflag > ../../netcdf_config.log 2>&1
- env FC="$fc $march" F90="$fc $march" FFLAGS="$ldflags $foptflags" \
- F90FLAGS="$ldflags $foptflags" CC="$cc $march" LDFLAGS="$ldflags"
- CFLAGS="$cflags" CXX="$cplusplus $march" CPPFLAGS="-DNDEBUG"
./configure $netcdfflag \
+ env FC="$fc" F90="$fc" FFLAGS="$ldflags $foptflags" \
+ F90FLAGS="$ldflags $foptflags" CC="$cc" LDFLAGS="$ldflags" \
+ CFLAGS="$cflags" CPPFLAGS="-DNDEBUG" ./configure $netcdfflag \
> ../../netcdf_config.log 2>&1

I'm reluctant to commit this, however, since something might be depending
on passing $march to netcdf. Plus, I don't understand why the CVS version
fails for me but works for other people. So, if Ben and Mengjueh (and
others) could try out the above change, I would appreciate it.

Note: a "good" netcdf configuration will have the following line in

#define pgiFortran 1

It is *not* really necessary to send -DpgiFortran to configure to get this; at
least for me, it comes out naturally if the space at the end of the compiler
is removed. ("Bad" configurations end up with f2cFortran in the #define.)

FWIW: Here are my compilers for Mac 10.5:

gcc (GCC) 4.4.0 20081219 (experimental)
GNU Fortran (GCC) 4.4.0 20081219 (experimental)

For Mac 10.6:

gcc (GCC) 4.5.0 20090910 (experimental)
GNU Fortran (GCC) 4.5.0 20090910 (experimental)


AMBER-Developers mailing list
Received on Mon Nov 16 2009 - 12:00:02 PST
Custom Search