Re: [AMBER-Developers] Flags for intel v12 compilers

From: Ben Roberts <ben.roberts.geek.nz>
Date: Thu, 3 Feb 2011 14:11:22 -0500

Hi Dan,

On 2/2/2011, at 6:49 p.m., Daniel Roe wrote:

> This brought up another minor issue with flags in general. There are a
> lot of flags now in config.h, and it appears that not all of the
> Makefiles have been updated to make use of these flags properly. For
> example, in 'reduce' there are a bunch of rules that look like:
>
> $(CXX) -c $(CFLAGS) $(AMBERCXXFLAGS) -o $. $<
>
> where CFLAGS is mixed with AMBERCXXFLAGS for c++ compilation (which
> seems bad if not outright wrong). Maybe there should be a discussion
> at the amber meeting about making the overall build more uniform in
> terms of what flags are used in what cases?

I'm in favour of sorting this out. Since I'm the one who put many of these flags in, I'll take the opportunity now to explain my reasoning, since it will probably have a bearing on discussions.

The initial reason was to provide a way of compiling with warnings. But Amber contains a lot of code that we aren't responsible for, and so warnings concerning, say, blas wouldn't be particularly helpful (since we aren't responsible for fixing those). So I wanted a general way to pass some compiler flags to everything (that became CFLAGS, CXXFLAGS and FFLAGS) and other compiler flags only to those parts of the code that we maintain (AMBERCFLAGS, AMBERCXXFLAGS and AMBERFFLAGS). Still other flags are selected based on optimisation (COPTFLAGS, CXXOPTFLAGS and FOPTFLAGS) or lack of the same (CNOOPTFLAGS, CXXNOOPTFLAGS and FNOOPTFLAGS).

As you yourself say, standardisation is a good thing, and that was part of what I was aiming for.

Thus, it should be OK (and, indeed, expected) to use e.g. CFLAGS and AMBERCFLAGS together. My understanding is that AMBERCFLAGS will override CFLAGS if mutually exclusive options are used.

As for why CFLAGS is used for reduce: Most likely because that was what was there already. If I were writing the Makefile from scratch, I would have used CXXFLAGS instead, but I figured that CFLAGS had been used for a reason, even if that reason was unclear to me, so I left it alone. Others may be better placed to advise here.

Ben
-- 
For greater security, I support S/MIME encryption.



_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers

Received on Thu Feb 03 2011 - 11:30:05 PST
Custom Search