From: nancy80 on
I am trying to compile the source code of DRAIN-2DX (an engineering free
software availiable in nisee site).However I am getting 1231 warning
messages of the following type:
Warning: Because of COMMON, the alignment of object is inconsistent with
its type [PKG]
9 FR0(2),CR0(2),FRA(2,2),CRA(2,2),CPIN(2,2),FPIN(2,2),PKG,PKGP,RSum
Can anyone help me with this problem?Although an executable can be created
it does not work.....

From: glen herrmannsfeldt on
nancy80 wrote:

> I am trying to compile the source code of DRAIN-2DX (an engineering free
> software availiable in nisee site).However I am getting 1231 warning
> messages of the following type:
> Warning: Because of COMMON, the alignment of object is inconsistent with
> its type [PKG]
> 9 FR0(2),CR0(2),FRA(2,2),CRA(2,2),CPIN(2,2),FPIN(2,2),PKG,PKGP,RSum
> Can anyone help me with this problem?Although an executable can be created
> it does not work.....

Arrange the variables in COMMON so that all DOUBLE PRECISION come first,
then all default sized variables, then, if you have any, INTEGER*2's,
and finally any *1 variables. CHARACTER variables, if any, should
also be at the end.

If the program uses any tricks related to EQUIVALENCE and COMMON, where
variables overlap in unexpected ways, it will be somewhat harder.

If you find COMMON statements are not consistent between routines, such
as not all being the same length, it will also be a little harder, but
probably the best thing then is to make them all the same.

Which machine are you running on? x86 doesn't require alignment, but
many RISC processors do.

-- glen

From: nancy80 on
Thank you for your reply glen.However, my concern is why a source code
which was supposed to function well (as it is given from an official site)
it does not.Do you think that this has to do with using a newer compiler? I
am finding it quite hard to fix the problem....The variables are so
many.........

From: glen herrmannsfeldt on
nancy80 wrote:

> Thank you for your reply glen.However, my concern is why a source code
> which was supposed to function well (as it is given from an official site)
> it does not.Do you think that this has to do with using a newer compiler? I
> am finding it quite hard to fix the problem....The variables are so
> many.........

Not all machines require variables to be aligned, and people
using such machines aren't always very good about doing it.

What machine are you running on?

Intel x86 processors don't require alignment, though they usually
run much faster on aligned data.

If there are an even number of REAL or INTEGER variables before each
DOUBLE PRECISION variable it should also work. You might also
add dummy variables.

Are the COMMON statements the same in all routines? That will make
it much easier to fix, and remain consistent.

-- glen

From: glen herrmannsfeldt on
nancy80 wrote:

> Thank you for your reply glen.However, my concern is why a source code
> which was supposed to function well (as it is given from an official site)
> it does not.Do you think that this has to do with using a newer compiler? I
> am finding it quite hard to fix the problem....The variables are so
> many.........

Never mind, I looked at the COMMONs.

There are INTEGER*2 variable, not standard but many older programs used
them. There is even a variable indicating the ratio of the size of a
real to the size of an integer, which means it is likely doing many
non-standard tricks with different kinds of variables.

I am not so sure that this is the cause of your problem, especially
if you are on an x86 machine. Is PKG the only one it is warning about?

It might be best to find which machine and compiler they used, and
try to use the same one, at least to see it work once.

-- glen