From mercie@med.cornell.edu  Wed Nov 24 13:51:25 1993
Received: from cumc.cornell.edu  for mercie@med.cornell.edu
	by www.ccl.net (8.6.4/930601.1506) id NAA23378; Wed, 24 Nov 1993 13:14:13 -0500
Received: from localhost (mercie@localhost) by cumc.cornell.edu (8.6.4/ECH1.13) id NAA22111; Wed, 24 Nov 1993 13:12:47 -0500
Date: Wed, 24 Nov 1993 12:56:28 -0500 (EST)
From: Gustavo Mercier <mercie@med.cornell.edu>
Subject: hondo in sgi, repeat
To: chemistry@ccl.net
Message-ID: <Pine.3.87.9311241228.A21611-0100000@med.cornell.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII



Hi, Netters!

Sorry! Apparently my previous message containing an attachment that described
the steps to implement HONDO 8.4 in a INDIGO R4000 IRIX 4.0.5F got corrupted
in some systems.

Given the interest in this subject, the message is reproduced below.
I would encourage people who port software to different systems
to keep tabs of the changes. Simple files like the one below can help developersto make programs more compatible, and end-users can implement programs without
rediscovering the wheel!


Michel Dupuis can be reached at: michel@kgnvmt.vnet.ibm.com

good luck
mercie@cumc.cornell.edu

****************************************************************************
           READ THE WHOLE MESSAGE FIRST!
modification 1:
ISINGL = 2 for 32 bit machine
VECTOR = .FALSE.
	files affected
ctl.f
comment: see documentation
####
modification 2:
excluded file from loading phase:
	files affected:
vec.f
comment: see documentation
####
modification 3:
applied "1,$s/@PROCESS/c @PROCESS/g" to comment out the lines using vi editor

	files affected with number of instances that the change applied:
ctl.f:6
ci1.f:3
ci2.f:3
der.f:2
hss.f:5
int.f:3
mp2.f:15
mp4.f:6
ntn.f:2
scf.f:8
####
modification 3:
renamed the call and entry point function SECNDS to SECND since
in SGI f77 SECNDS is an intrinsic function
	files affected
ctl.f
####
modification 4:
commented out subroutines SYSDAT, SYSTIM, SYSCLK
	files affected:
ctl.f
comment: notice that these remain defined in file aix.f
	the change was made to eliminate undefined subroutines:
	CPUTIME, CLOCKX, and DATIMX called by the above
####
modification 5:
change the name of subroutine aixclk to aixclk_
	files affected:
clkaix.c
comment: this is a requirement of SGI fortran/c interface
####
modification 6:
introduced EXTERNAL EXPNRG statement to correct warning message
	files affected:
dr2.f   subroutine search
####
modification 7:
sample 2 in the suite of samples bombs with an error due to error in 
formt 9996 in SUBROUTINE TRFMCX (line # 77736). 

The line reads as follows:
	2	,'-- IN CORE ...
it should read
	2        '-- IN CORE ...

the comma has already been included in the previous continuation line!

	file affected
ntn.f
####
modification 8:
samples 14 and 15 fail with error in SUBROUTINE DDSPDS when using
optimization level O2 (but not with O0a or O1) as described below.
The error yields a core dump due to segmentation fault!

Hence, separate hss.f into hss1.f and hss2.f, with the latter containing
the above subroutine. Then compile the subroutine using optimization level
O1 as indicated below. Remember to comment out the subroutine from hss1.f or
delete it.

####
comments on compilation and loading:

TO COMPILE AND LOAD PROPERLY DO THE FOLLOWING:

Avoid using the make command! For reasons that are not clear to me the
default options cause errors in compiling certain files. I don't have
an answer to this, but the steps below work.

First generate the object codes:

cc -c clkaix.c
f77 -w -c -G 3 -O2 -Olimit 1500 -Nl300 -mips2 *.f

make sure that you have split ci1.f into ci1a.f and ci1b.f and
prp.f into prp1.f and prp2.f. These files are too big as delivered.
Also, in file hss.f you must compile SUBROUTINE DDSPDS using
optimization level 1. We do this by spliting the file into hss1.f
and hss2.f. The latter contains the SUBROUTINE DDSPDS, and the former
contains the rest of hss.f.

f77 -w -c -G3 -O1 -Olimit 1500 -Nl300 -mips2 hss2.f

Remember to exclude vec.f, it is not needed in scalar machine.

You can eliminate optimization by changing O2 to O0.
In this case you can omit the mips2 instruction set. Obviously,
the program will run slower by about at least a factor of 2.

Finally, generate the executable by linking the object codes.

f77 -o hondo -w -G3 -static -Nl300 -mips2 *.o

the executable will have the name hondo.

So, in summary:

If you have made the above modifications, the sequence of commands is:

cc -c clkaix.c
f77 -w -c -G3 -static -O2 -Olimit 1500 -Nl300 -mips2 *.f
f77 -w -c -G3 -static -O1 -Olimit 1500 -Nl300 -mips2 hss2.f
f77 -o hondo -w -G3 -static -Nl300 -mips2 *.o 

Note: Attempts at optimization using the default -O -Olimits 1500 failed!
Also, simple attempts at using the make command also failed! The reason
is not clear, but may have to do with the default settings.

COMMENT: Using the mips2 instruction set can be confusing!

The mips2 instruction set is designed to take advantage
of the 64bit word size in INDIGO R4000 machines
and the newer Silicon Graphics machines. Unfortunately, the defaults sizes
for integer and real numbers are i*4 and r*4 (32 bits!). According to customer
support this default persists even when using the -mips2 option! Therefore,
your default integers and reals are half-words and you must keep ISINGL as
if you were running in a 32 bit machine, unless you change the default sizes!

This is a little bit crazy, but I have already encountered a similar problem
with another code (Amsterdam Density Functional Package v. 1.0.1).

gus mercier
mercie@cumc.cornell.edu
9/6/93




