Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!crdgw1!rpi!uupsi!sunic!ugle.unit.no!hanche From: hanche@imf.unit.no (Harald Hanche-Olsen) Newsgroups: comp.sys.apollo Subject: Re: Problems with Fortran-Compiler Message-ID: Date: 24 Feb 91 13:32:49 GMT References: <250@mailgzrz.tu-berlin.de> <4ff9d7df.3593b@digital.sps.mot.com> Sender: news@ugle.unit.no Organization: The Norwegian Institute of Technology, Trondheim, Norway. Lines: 24 In-Reply-To: chen@digital.sps.mot.com's message of 23 Feb 91 01:00:31 GMT In article <4ff9d7df.3593b@digital.sps.mot.com> chen@digital.sps.mot.com (Jinfu Chen) writes: In article <250@mailgzrz.tu-berlin.de> jaenicke@w414zrz.zrz.tu-berlin.de (Lutz Jaenicke) writes: > [ Description of large FORTRAN arrays filling up the executable ] I noticed similar situation with cc6.7. It turns out when a large size of static variable is declared (large array), the executable is filled. Then I found out a compiler switch -compress in /com/cc (-W0,-compress in /bin/cc) which works quite well. Checking over ftn.hlp and man f77 I couldn't find similar switch. Maybe someone knows FORTRAN could help? One common way to deal with large arrays in FORTRAN is the following: Make your FORTRAN main program a subroutine, then write a tiny C routine main() that allocates the array using malloc() and then passes the resulting pointer to the FORTRAN program. This has the added advantage that you could specify the amount of storage on the command line. - Harald Hanche-Olsen Division of Mathematical Sciences The Norwegian Institute of Technology N-7034 Trondheim, NORWAY Brought to you by Super Global Mega Corp .com