CompuServe Thread

#Lattice C 4.0 Error

9 messages in this thread
#977From: CHIP MATTSONJul 18, 1988 1:38 AM
I'm getting a strange error during compilation with Lattice C 4.0…I get a "can't execute LC2" error, using LC to compile. I've found there isn't a big enough chunk of memory to hold LC2. There is usually over 200K of free memory but the biggest chunk is only about 80K. Rebooting doesn't help and the manual doesn't explain what to do. The error happens sometimes when I've made simple changes to the source file, but without making it much larger. I think LC1 is allocating a big chunk of memory (for large symbol table due to strange code?) and leaves memory too segmented for LC2 to have a large enough chunk to be loaded into. Also, I found (on page 7-3) the manual suggests using the -B (big compiler) option for LC (not documented in the manual under LC, page C-8) for a "Not enough memory" error, and LC says it's not a valid option. I'd appreciate whatever help anyone could give. Thanks, Chip
#1040From: Doug WingerJul 18, 1988 3:07 PM
Chip, That's only hapened once to me. I got around it by doing the compile in two steps, storing the quad file after lc1, and then finishing it off with lc2 afterwards. I _think_ it's because it's looking to allocate space for lc2 in a single chunk, and the available chunk size is just not big enough. I think (!) that using lc doesn't totally deallocate areas of ram that lc1 has grabbed. It only happened to me when doing a multiple file compile. Doug
#1192From: CHIP MATTSONJul 19, 1988 1:29 AM
Doug, Using lc1 and lc2 separately does the trick for the "can't execute LC2" error. Is there an advantage to using LC? (speed, convenience?) I tried narrowing down the location of the error by commenting out parts of the code and compiling with LC, and the error comes and goes. I made it go away (for now) by just putting some blank lines in the code, without changing the code itself. Strange Huh? Anyway, until I ask Lattice about it, I guess I'll just use lc1 and lc2 separately. Thanks, Chip
#1231From: Doug WingerJul 19, 1988 3:57 AM
Chip, Looks like you might have run into a bug. I use lc when I'm recompiling a bunch of files all at once using wildcards, or when I've 'put the final touches' on a file. Normally, I use lc1 as a checker to find out what I've misspelled or forgotten to put in. In fact, I usually force an error by referencing something that's not defined early in the code so I don't have to wait for it to make the quad file. When all is neat and tidy, then the lc gets used to churn out the finished product and allows me the sublime pleasure of trying to figure out what I did wrong. 8) For short things, you might want to use LC. I even use that for larger projects, as you're left with a link file you can edit for later use. Doug
#1456From: Rick StevensJul 20, 1988 2:08 AM
LC traps out some of the switches for LC1 and LC2. The documentation doesn't spell out these problems. I know, because I bitched at them about it. Set up a script to invoke LC1 and LC2 with the switches you want. Put your QUAD: on RAM: and make sure that LC2 expects its input from RAM: Lattice runs a BBS for just this sort of problem, and they're fairly responsive. Lattice BBS is at (312) 916-1200, 300/1200/2400 baud, 8N1. Good Luck! [O O] Rick Stevens ? V
#1174From: Dean BrownJul 19, 1988 12:41 AM
Chip, Redirect the QUAD file to disk instead of RAM: where it defaults to. The problem (That I've seen), is that the .q file in RAM: eats too much memory for lc2 to load. The only other time I've seen this kind of problem, is after running the machine for several hours, doing many edit/compile cycles, causing fragmentation. -Dean
#1198From: CHIP MATTSONJul 19, 1988 1:52 AM
Dean, This is a strange error. Rebooting doesn't help the fragmented memory, but using lc1 and lc2 separately helps. It appears that LC doesn't release all of the memory it uses for lc1. It appears to be something in the code which is strange. I tried commenting out part of the code to narrow down the section which it doesn't like, and found it to disappear after just adding blank lines (after taking all the debugging comments out). Your QUAD suggestion sounds like it will do the trick. Do you think Lattice could help? Thanks, Chip
#1443From: Dean BrownJul 20, 1988 12:04 AM
Chip, Using LC1 and LC2 seperately probably works because LC is a program that loads and then executes LC 1&2. This takes up more memory than just running seperately. Since LC is a 26K load module, not having it there probably frees enough memory for it to work. Lattice should be able to help, although they may want to see the source code causing the problem. If nothing else you can be the one to report a obscure bug. -Dean
#1645From: Dale SchlottJul 21, 1988 12:53 AM
Dean, What's ya doin these days. I know you must have something on the burner. Jan's getting worried. Send me some EMail or give me a call. Dale