Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* G77 dynamic memory allocation
@ 1998-07-01  9:49 Larry Zimmerman
  1998-07-02  1:36 ` Weiping Hu
  0 siblings, 1 reply; 4+ messages in thread
From: Larry Zimmerman @ 1998-07-01  9:49 UTC (permalink / raw)
  To: axp-list


This is sort of a followup to the thread "malloc oddity ?"

I am interested in this subject because I'm trying to port
some FORTRAN code to Linux that uses structures and dynamic
memory allocation. AFAIK, egcs/g77 does not directly support
dynamic memory allocation, but Mike Tripicco let me look at
their code for dynamic array sizing. I tried a slight modification
of Mike's code, then managed to get "real" dynamic memory
allocation working!

This is not as clean as using compiler-supported functions,
but it seems to work for me in my test program. If you're
interested, you can get the details at:
http://walleye.gonefishing.sk.ca/laz/linux/falloc.html

My test program, etc. are accessible through this web page.

Thanks to Mike and others who commented on Linux-Alpha memory
allocation for helping to solve one of my key porting problems.

Now if the g77 guys would just move structures higher up the priority
list!!

Larry Z.



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

* Re: G77 dynamic memory allocation
  1998-07-01  9:49 Larry Zimmerman
@ 1998-07-02  1:36 ` Weiping Hu
  0 siblings, 0 replies; 4+ messages in thread
From: Weiping Hu @ 1998-07-02  1:36 UTC (permalink / raw)
  To: axp-list

Larry,

I just tried this, and got the following result.  There is a segmentation fault.  I run egcs-1.0.2-8 on RH5.1, i386.  Was the test for Alpha only?

Regards,
Weiping


[huw@venus Test]$ make
egcs -g -static -Wall -DUSE_FALLOC -DHAVE_64BIT_ADDR -c falloc.c
g77 -fintrin-case-any -fmatch-case-any -DUSE_FALLOC -DHAVE_64BIT_ADDR -c mysubs.F
g77 -fintrin-case-any -fmatch-case-any -DUSE_FALLOC -DHAVE_64BIT_ADDR lzmemtest.F falloc.o mysubs.o -static -lc -o lzmemtest
[huw@venus Test]$ ./lzmemtest
 lzmemtest: Started

  lzmemtest: nreal  300 nint  300 kint  150
 fmalloc: trying to allocate 2400 bytes
  Address of real*8 array is  4429655688
  realinit: Initializing Real Array
  realinit: Start of array address is  134688392
 fmalloc: trying to allocate 2400 bytes
  Address of integer array is  578379606387013616
  intinit: Initializing Integer Array
  intinit: Start of array address is  134690800
  End of 2nd array is  578379606387016016
  Start of K subarray is  578379606387014816
  Mysub: Checking values in arrays
Segmentation fault (core dumped)         

Larry Zimmerman <laz@walleye.gonefishing.sk.ca> writes:

> This is sort of a followup to the thread "malloc oddity ?"
> 
> I am interested in this subject because I'm trying to port
> some FORTRAN code to Linux that uses structures and dynamic
> memory allocation. AFAIK, egcs/g77 does not directly support
> dynamic memory allocation, but Mike Tripicco let me look at
> their code for dynamic array sizing. I tried a slight modification
> of Mike's code, then managed to get "real" dynamic memory
> allocation working!
> 
> This is not as clean as using compiler-supported functions,
> but it seems to work for me in my test program. If you're
> interested, you can get the details at:
> http://walleye.gonefishing.sk.ca/laz/linux/falloc.html
> 
> My test program, etc. are accessible through this web page.
> 
> Thanks to Mike and others who commented on Linux-Alpha memory
> allocation for helping to solve one of my key porting problems.
> 
> Now if the g77 guys would just move structures higher up the priority
> list!!
> 
> Larry Z.
> 
> 
> -- 
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com


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

* Re: G77 dynamic memory allocation
       [not found] <Hu.Weiping@dsto.defence.gov.au>
@ 1998-07-02  5:10 ` Larry Zimmerman
  0 siblings, 0 replies; 4+ messages in thread
From: Larry Zimmerman @ 1998-07-02  5:10 UTC (permalink / raw)
  To: axp-list

	Message 5:
	From axp-list-request@redhat.com  Wed Jul  1 19:32:23 1998
	Return-Path: <axp-list-request@redhat.com>
	Received: from mail2.redhat.com (mail2.redhat.com [199.183.24.247])
		by walleye.gonefishing.sk.ca (8.8.5/8.8.5) with SMTP id TAA20423
		for <laz@walleye.gonefishing.sk.ca>; Wed, 1 Jul 1998 19:32:22 -0600
	Received: (qmail 17477 invoked by uid 501); 2 Jul 1998 01:38:25 -0000
	Resent-Date: 2 Jul 1998 01:38:24 -0000
	Resent-Cc: recipient list not shown: ;
	MBOX-Line: From axp-list-request@redhat.com  Wed Jul  1 21:38:24 1998
	To: axp-list@redhat.com
	Subject: Re: G77 dynamic memory allocation
	References: <199807010949.DAA18686@walleye.gonefishing.sk.ca>
	From: Weiping Hu <Hu.Weiping@dsto.defence.gov.au>
	Date: 02 Jul 1998 03:36:51 +0200
	In-Reply-To: Larry Zimmerman's message of "Wed, 1 Jul 1998 03:49:44 -0600"
	Message-ID: <m3u3516nkc.fsf@venus.dsto.defence.gov.au>
	Lines: 60
	X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald"
	Resent-Message-ID: <"FPOOC3.0.bG4.GIkcr"@mail2.redhat.com>
	Resent-From: axp-list@redhat.com
	Reply-To: axp-list@redhat.com
	X-Mailing-List: <axp-list@redhat.com> archive/latest/34
	X-Loop: axp-list@redhat.com
	Precedence: list
	Resent-Sender: axp-list-request@redhat.com
	X-URL: http://www.redhat.com
	Status: R
	

From: Weiping Hu <Hu.Weiping@dsto.defence.gov.au> 02 Jul 1998

	Larry,
	
	I just tried this, and got the following result.  There is a segmentation fault.  I run egcs-1.0.2-8 on RH5.1, i386.  Was the test for Alpha only?
	
	[huw@venus Test]$ make
	egcs -g -static -Wall -DUSE_FALLOC -DHAVE_64BIT_ADDR -c falloc.c
                                             ^^^^^^^^^^^^^^^
If you're using an i386 I doubt you have 64BIT Addresses. Take this out
and try again. Let me know what happens.

Larry Z.



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

* Re: G77 Dynamic Memory Allocation
@ 1998-07-02  5:55 Larry Zimmerman
  0 siblings, 0 replies; 4+ messages in thread
From: Larry Zimmerman @ 1998-07-02  5:55 UTC (permalink / raw)
  To: axp-list


From: Weiping Hu <Hu.Weiping@dsto.defence.gov.au> 02 Jul 1998

        Larry,

        I just tried this, and got the following result.  There is a
segmentation fault.  I run egcs-1.0.2-8 on RH5.1, i386.  Was the test for
Alpha only?

        [huw@venus Test]$ make
        egcs -g -static -Wall -DUSE_FALLOC -DHAVE_64BIT_ADDR -c falloc.c
                                             ^^^^^^^^^^^^^^^
If you're using an i386 I doubt you have 64BIT Addresses. Take this out
and try again. I haven't tried it on x86. Let me know what happens.

Larry Z.



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

end of thread, other threads:[~1998-07-02  6:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-07-02  5:55 G77 Dynamic Memory Allocation Larry Zimmerman
     [not found] <Hu.Weiping@dsto.defence.gov.au>
1998-07-02  5:10 ` G77 dynamic memory allocation Larry Zimmerman
  -- strict thread matches above, loose matches on Subject: below --
1998-07-01  9:49 Larry Zimmerman
1998-07-02  1:36 ` Weiping Hu

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