From owner-nwchem-users@emsl.pnl.gov Wed Jun  6 12:51:18 2007
Received: from odyssey.emsl.pnl.gov (localhost [127.0.0.1])
	by odyssey.emsl.pnl.gov (8.13.8/8.13.8) with ESMTP id l56JpHuF028851
	for <nwchem-users-outgoing-0915@odyssey.emsl.pnl.gov>; Wed, 6 Jun 2007 12:51:18 -0700 (PDT)
Received: (from majordom@localhost)
	by odyssey.emsl.pnl.gov (8.13.8/8.13.8/Submit) id l56JpHlC028850
	for nwchem-users-outgoing-0915; Wed, 6 Jun 2007 12:51:17 -0700 (PDT)
X-Authentication-Warning: odyssey.emsl.pnl.gov: majordom set sender to owner-nwchem-users@emsl.pnl.gov using -f
X-Ironport-SG: OK_Domains
X-Ironport-SBRS: 4.6
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AgAAAMasZkab0gEykmdsb2JhbACPXQIBAQcIBg0f
X-IronPort-AV: E=Sophos;i="4.16,390,1175497200"; 
   d="scan'208";a="34190288"
Mime-Version: 1.0
Message-Id: <a06240803c28cb2aaf928@[155.210.88.109]>
Date: Wed, 6 Jun 2007 21:51:06 +0200
To: nwchem-users@emsl.pnl.gov
From: "Fco. Javier Modrego" <modrego@unizar.es>
Subject: [NWCHEM] nwchem 5.0 compilation problems
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
X-Mail-Scanned: Criba 2.0 + Clamd & Bogofilter
Sender: owner-nwchem-users@emsl.pnl.gov
Precedence: bulk

Hello,
  I am trying to compile NwChem with PGF for a small cluster of mixed 
32 bit and 64 bit Dual Xeon nodes. The Portland fortran compiler is 
installed in a 64 bit node and the rest have installed the 
portability libraries provided by Portland Group. I have built the 64 
bit executables without trouble (TARGET=LINUX64) but the 
cross-compiling to the 32 bit machines (TARGET=LINUX)  is something 
harder.
I have done it for other codes such as G03 and GAMESS. You just need 
to convince the makefiles that your CPU it is not what it says to be, 
and add a couple of switches for the fortran  compiler (-tp p7) and 
the gcc compiler (-march=i686 -m32). It has been enough...
With NwChem I am not getting through it.
I have sligthly modified makefile.h but is seems that it is not enough.
I have tried to override calls to machine -m and setting the 32 bit 
target switches for the compilers
just at the beggining of the LINUX section

   LINUXCPU = x86
   CFLAGS += -march=i686 -m32
   COPTIONS += -march=i686 -m32
   FFLAGS += -tp p7
   FOPTIONS += -tp p7
   FC = pgf77
#  _CPU = $(shell uname -m  )
    _CPU = i786

It seems that I am missing something or somewhere those options are 
overrided because my first (and single at the moment...there will be 
more I guess...) fatal error  in make.log reads:

Blah, Blah, Blah...
  echo "" > LINUX-TCG-N.stamp

  *** Building Parallel Tools ****

  >>> making Memory Allocator (MA) library <<<
(cd ./ma; make)
if [ -f *.stamp ]; then\
                  make cleanstamp;\
         fi
cp macommon.h matypes.h macdecls.h scope.h error.h memcpy.h 
string-util.h table.
h mafdecls.fh typesf2c.h winutil.h winf2c.h ../include
echo "" > LINUX.stamp
gcc -DLINUX -DVERIFY -DSTATS -O2 -funroll-loops -malign-double   -c 
-o error.o e
rror.c
error.c:1: error: -malign-double makes no sense in the 64bit mode
make[2]: *** [error.o] Error 1
make[1]: *** [tools] Error 2
make: *** [libraries] Error 1

As can be seen the gcc compiler does not receive the intended -m32 
-march=i686 options...
Somewhere in the forest of GNUmakefiles are lost...
As a test I have tried to set as a environment variable in the shell: 
export CFLAGS="-m32 -march=i686" which according to the gnu make 
variable should be taken by make and it is unset after the failed 
compilation.

Any help will be wellcome,

	F.J. Modrego