Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* f2c and 4-byte integers
@ 1996-10-29 16:33 Michael J. Donahue
  1996-10-29 21:26 ` Michal Jaegermann
  0 siblings, 1 reply; 6+ messages in thread
From: Michael J. Donahue @ 1996-10-29 16:33 UTC (permalink / raw)


Hi all,

Sorry if I'm overlooking something obvious, but how do I get f2c to
map INTEGER*4 to 4-byte integers on Linux/AXP?

From the f2c man page:

          -I2  Render INTEGER and LOGICAL as short, INTEGER*4 as long
               int.  Assume the default libF77 and libI77:  allow only
               INTEGER*4 (and no LOGICAL) variables in INQUIREs.
               Option `-I4' confirms the default rendering of INTEGER
               as long int.

Also, f2c.h has

   typedef long int integer;
   typedef short int shortint;

Under Linux/AXP, short is 2 bytes, int is 4 bytes, and long is 8
bytes, right?

TIA,

-mike
michael.donahue@nist.gov

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: f2c and 4-byte integers
  1996-10-29 16:33 f2c and 4-byte integers Michael J. Donahue
@ 1996-10-29 21:26 ` Michal Jaegermann
  0 siblings, 0 replies; 6+ messages in thread
From: Michal Jaegermann @ 1996-10-29 21:26 UTC (permalink / raw)


> 
> Sorry if I'm overlooking something obvious, but how do I get f2c to
> map INTEGER*4 to 4-byte integers on Linux/AXP?

This is broken.  I was posting in the past on the topic but without
a trace of a comment from anybody.  It may, or may not, have also
an impact on a performance.  AFAIK nobody was doing testing.

Why exectly you need that?  There are some workarounds.

> 
> >From the f2c man page:

I am afraid that the manpage does not correspond to the current
reality, although obviously it should.

> 
> Also, f2c.h has
> 
>    typedef long int integer;
>    typedef short int shortint;

This was likely done so things will compile under MS-DOS and is definitely
incorrect for Linux/AXP.  Note that if you change that then f2c libraries
will need to be recompiled and if they recompile cleanly and correctly
remains to be seen.  If you have around some other object files/libraries
they will become incompatible with whatever you will compile with a
"new" f2c.  This will make you also out-of-sync with Red Hat rpm system,
which means that the next update will likely clobber your efforts if
you are not careful.

I run into the problem in the past when trying to port 'vg' graphics
library, written in Fortran and C, to Linux/AXP.  I did the port
but it required some hacks.

I did not try to pursue f2c issues as personally for me they are not
really relevant and I do not have an easy access to Linux/AXP at the
moment.  Still this should be fixed but I did not notice any interest
in that in the past.

  Michal

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: f2c and 4-byte integers
@ 1996-10-29 22:31 Michael J. Donahue
  0 siblings, 0 replies; 6+ messages in thread
From: Michael J. Donahue @ 1996-10-29 22:31 UTC (permalink / raw)


>> Sorry if I'm overlooking something obvious, but how do I get f2c to
>> map INTEGER*4 to 4-byte integers on Linux/AXP?
>
>This is broken.  I was posting in the past on the topic but without
>a trace of a comment from anybody.  It may, or may not, have also
>an impact on a performance.  AFAIK nobody was doing testing.
>
>Why exectly you need that?  There are some workarounds.

There are 2 issues:

1) I'm working with mixed C/fortran code across several platforms.  On
the Linux/AXP system the fortran code is being built through f2c, but
elsewhere it is compiled using f77.  When the C code calls the fortran
code, it has to know what size variable to send (call by address).

2) Presumably the fortran code is taking a performance hit when it is
working with 8-byte integers instead of 4-byte.

I guess I could handle the first problem by #define'ing a constant at
compile time specifying whether I'm linking with an f2c or an f77
built object, and adjusting the function calls appropriately.  This is
painful and ugly, and is also dangerous since AFAIK I can't get the
compiler/linker to insure that the C and fortran code are in agreement.

I suspect issue 2 is minor for my particular code, but I haven't
tested it.

-mike
michael.donahue@nist.gov

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: f2c and 4-byte integers
@ 1996-10-30  4:22 ed bristol
  0 siblings, 0 replies; 6+ messages in thread
From: ed bristol @ 1996-10-30  4:22 UTC (permalink / raw)


Michal Jaegermann wrote:
> 
> >
> > Sorry if I'm overlooking something obvious, but how do I get f2c to
> > map INTEGER*4 to 4-byte integers on Linux/AXP?
> 
> This is broken.  I was posting in the past on the topic but without
> a trace of a comment from anybody.  It may, or may not, have also
> an impact on a performance.  AFAIK nobody was doing testing.
> 
> Why exectly you need that?  There are some workarounds.
> 
> >
> > >From the f2c man page:
> 
> I am afraid that the manpage does not correspond to the current
> reality, although obviously it should.
> 
> >
> > Also, f2c.h has
> >
> >    typedef long int integer;
> >    typedef short int shortint;
> 
> This was likely done so things will compile under MS-DOS and is definitely
> incorrect for Linux/AXP.  Note that if you change that then f2c libraries
> will need to be recompiled and if they recompile cleanly and correctly
> remains to be seen.  If you have around some other object files/libraries
> they will become incompatible with whatever you will compile with a
> "new" f2c.  This will make you also out-of-sync with Red Hat rpm system,
> which means that the next update will likely clobber your efforts if
> you are not careful.
> 
> I run into the problem in the past when trying to port 'vg' graphics
> library, written in Fortran and C, to Linux/AXP.  I did the port
> but it required some hacks.
> 
> I did not try to pursue f2c issues as personally for me they are not
> really relevant and I do not have an easy access to Linux/AXP at the
> moment.  Still this should be fixed but I did not notice any interest
> in that in the past.
> 
>   Michal
> 
> --
> To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
unsubscribe

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: f2c and 4-byte integers
@ 1996-10-30 14:19 Matthew X Economou
  0 siblings, 0 replies; 6+ messages in thread
From: Matthew X Economou @ 1996-10-30 14:19 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----

>>>>> "eb" == ed bristol <ebristol@flash.net> writes:

    >> -- To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
    eb> unsubscribe

Ed,

You need to send a message with "unsubscribe" as the subject to
axp-list-request@redhat.com.  You've repeatedly tried sending
unsubscribe to the mailing list itself...didn't you realize that your
unsubscribe messages were being broadcast to 400+ people when (a) you
probably received it yourself and (b) you weren't unsubscribed?

If you don't know how to use mailing lists, I suggest you don't
subscribe to them.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBMndj2Sjh7SVEyfhxAQH0ZQQAjszubKslAUy//En0mNTqvwYU1+oFw0Df
BqCuuhdElLR9hG7RF3vP/chBBxLbjgHl8bcUV6gTwZkcglslCD4N0by/06vsBNls
zIqHKGg3lbxQKoCovNWWQ8UuM17qA1VqLPelSJKQvhIH4iy+ah8dxdXOeOhFMi8N
1WC4NtmacbM=
=ln7j
-----END PGP SIGNATURE-----

-- 
Matthew X. Economou - Finger/WWW for public key. - Geek of Computer Science(!)
econommx@rose-hulman.edu - http://www.rose-hulman.edu/~econommx - Random quote:
"The one good thing about repeating mistakes is you know when to cringe."
 -- D. Joseph Creighton in alt.sysadmin.recovery

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: f2c and 4-byte integers
@ 1996-10-30 16:20 Matthew X Economou
  0 siblings, 0 replies; 6+ messages in thread
From: Matthew X Economou @ 1996-10-30 16:20 UTC (permalink / raw)


>>>>> "MXE" == Matthew X Economou <econommx@Rose-Hulman.Edu> writes:

Sorry everyone.  I didn't mean for that to go out all over the world.
(Fscking "reply-to"...grumble grumble...)

-- 
Matthew X. Economou - Finger/WWW for public key. - Geek of Computer Science(!)
econommx@rose-hulman.edu - http://www.rose-hulman.edu/~econommx - Random quote:
"Vote for Satan!  Why choose the lesser of evils?" --Brad Keryan

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1996-10-30 16:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-10-29 16:33 f2c and 4-byte integers Michael J. Donahue
1996-10-29 21:26 ` Michal Jaegermann
  -- strict thread matches above, loose matches on Subject: below --
1996-10-29 22:31 Michael J. Donahue
1996-10-30  4:22 ed bristol
1996-10-30 14:19 Matthew X Economou
1996-10-30 16:20 Matthew X Economou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox