Code Comments
Programming Forum and web based access to our favorite programming groups.I am trying to compile a fortran program that consist of 48 separate .for files (subroutines). My OS is Win98 and my compiler is Microsoft Optimizing Compiler 5.0 and I am running it from the MS Dos Prompt. I created .obj files with only a couple of minor errors. The problem comes when I link the .obj files to create the exe. I am getting error L1049 "too many segments". I tried increasing the segment size using the /SE: option but this didn't help. Also, I am doing this for a friend of mine and he told me that due to the nature of the code it was necessary to save the local variables during compilation and too make sure this option was set or an infinite loop is created. I have compiled much larger programs in the past and never encountered these problems before and haven't worked with fortran for about 10 or 15 years so I hope someone can help me with the following 2 questions: 1. How can I correct the "too many segments" error? 2. By using the /4Ya, will this take care of the local variables issue? 3. Do I need to use a different compiler? Any help is appreciated. Thanks, -Bob
Post Follow-up to this messageOn 25 Sep 2004 15:13:33 -0700, bobandmell@yahoo.com (Bob Lang) wrote: >1. How can I correct the "too many segments" error? The way you've been doing it - with the SEG option. That will work up to 16384, or until you run out of memory. >2. By using the /4Ya, will this take care of the local variables >issue? I don't understand what your colleague is saying about an infinite loop. If you need local variables to be saved, then you'd use the SAVE command in each subroutine. But you don't need to do that with MSF 5.x - it implicitly SAVEs by default. Don't know anythig about 4Ya, other than the manual saying it's an extension to support OS/2 multithreading. I wonder if invoking that is causing the other problem. >3. Do I need to use a different compiler? If the executable is too big (bigger than 580 to 600 K - run "mem" at the DOS prompt to see how much room you've got), or if you have any HUGE arrays, I'd recommend getting a 32 bit compiler. Ken Plotkin
Post Follow-up to this message> I am trying to compile a fortran program that consist of 48 separate > ..for files (subroutines). My OS is Win98 and my compiler is Microsoft > Optimizing Compiler 5.0 How old is that compiler now - twenty years? Even g77 very likely is a bette r solution, for all of _its_ age. Alternatively, get one of the free (for private use) F90 compilers, or buy one (if for company use). Jan
Post Follow-up to this messageexamnotes <jvorbrueggen-not@mediasec.de> wrote: > >How old is that compiler now - twenty years? Even g77 very likely is a bett er >solution, for all of _its_ age. The OP should also consider OpenWatcom at http://www.openwatcom.org/product/f...es_content.html , with associated newsgroup openwatcom.users.fortran . ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==-- -- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 News groups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption = ---
Post Follow-up to this messageOn Mon, 27 Sep 2004 09:14:35 +0200, Jan Vorbrüggen <jvorbrueggen-not@mediasec.de> wrote: >How old is that compiler now - twenty years? Even g77 very likely is a bett er >solution, for all of _its_ age. How old are any of us? ;-) That's actually a very good compiler. I used it for years. IMHO, there are just two issues with it. The first is that it's 16 bit DOS oriented, so program size is limited. The second is that they never did fix the 4Yb bug. On the other hand, it has a lot of F90 features: allocatable arrays, stuctures, enddo. Even some F2.03K features, like command line arguments. If his program is too big for it, though, he should definitely switch to a newer 32 bit compiler. Ken Plotkin
Post Follow-up to this messageKen Plotkin <kplotkin@nospam-cox.net> wrote in message news:<cb5gl0lsik4kvousa634ad2f6ilt7l vql5@4ax.com>... > On Mon, 27 Sep 2004 09:14:35 +0200, Jan Vorbrüggen > <jvorbrueggen-not@mediasec.de> wrote: > > > > How old are any of us? ;-) > > That's actually a very good compiler. I used it for years. IMHO, > there are just two issues with it. The first is that it's 16 bit DOS > oriented, so program size is limited. The second is that they never > did fix the 4Yb bug. > > On the other hand, it has a lot of F90 features: allocatable arrays, > stuctures, enddo. Even some F2.03K features, like command line > arguments. > > If his program is too big for it, though, he should definitely switch > to a newer 32 bit compiler. > > Ken Plotkin Ken, I agree, this compiler did everything I needed it to do at the time. I've sort of been out of Fortran for a long while now but am thinking of upgrading some of my old programs. I will probably get a different compiler soon. Also, thanks for your help with my original question about the Segment Option. I did as you suggested and the program compiled fine. I do have a couple of questions though: 1. Is there any way to know what segment size your program requires before compiling? 2. You had indicated in your post that the maximum size was about 16384 or until you run out of memory but the manual says 3072. Is the size addressed elsewhere in the manual? 3. I created the .exe by typing Link at the command line prompt and added the + sign when necessary and just about ran out of room on the command line. What do you need to do if there are too many .obj file names to type out on the command line? Thanks, -Bob
Post Follow-up to this messageOn 29 Sep 2004 19:06:06 -0700, bobandmell@yahoo.com (Bob Lang) wrote: >1. Is there any way to know what segment size your program requires >before compiling? Not that I know of. The only time I had to use the seg command was when linking with the PLOT88 library, and the docs for that said what to do. >2. You had indicated in your post that the maximum size was about >16384 or until you run out of memory but the manual says 3072. Is the >size addressed elsewhere in the manual? My manual says 16384. Might be that I've got 5.1, and I think you said you had 5.0. >3. I created the .exe by typing Link at the command line prompt and >added the + sign when necessary and just about ran out of room on the >command line. What do you need to do if there are too many .obj file >names to type out on the command line? At last! One I can answer!! You use a response file. Make a file with everything you need, breaking lines as necessary, and using a + at the end of the broken lines. For example, if you have objects fee, fie, foe, foo, you can make a file fee fie foe + foo Call this "plugh", and you can then link via link @plugh Whatever you'd put on the command line (switches, library specifications, etc.) can go into a response file. Ken Plotkin
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.