Subject: honod 8.4 in sgi

From: Gustavo Mercier <[email-masked]>
Date: Tue, 23 Nov 1993 19:09:14 -0500 (EST)

Hi, Netters!

I have included an attachment about my experience porting hondo 8.4
as provided in Chem-Station into a INDIGO R4000 running IRIX 4.0.5F.

I hope this is useful!

I am able to reproduce the examples as reported in the documentation.

good luck
gus mercier
[email-masked]
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 O0) 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
[email-masked]
9/6/93