Newsgroups: comp.os.msdos.djgpp From: "Graham Rangel-Sharp" Subject: Re: Win2000 DJGPP Problem Report Calculations still there X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-Mimeole: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: usenet AT leeds DOT ac DOT uk (Usenet admin) Organization: University of Leeds Message-ID: X-Msmail-Priority: Normal References: X-Priority: 3 X-Nntp-Posting-Host: eenpc028.leeds.ac.uk Date: Fri, 23 Nov 2001 10:50:50 GMT Lines: 82 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Thankyou for the swift reply. As you quite rightly assumed, the -lm switch is included in the linking process, but that is the only one. I tried including the following lines: #include - into the top of main.c int _crt0_startup_flags = _CRT0_FLAG_FILL_SBRK_MEMORY; - at the top of main() However the problem still persists. I did try using the Cygwin port of the utilities but the software crashes very early on saying "segmentation fault, core dumped.", this appears to happen at the line: Calc_elec_jacobian(&F2v,&F2n,F2p); However F2v, F2n and F2p all seem to be valid variables. It seems like the computer is trying to reference memory at an address that is not available. I tried to add the above lines to the cygwin version of the software but crt0.h doesnt exsist on my Cygwin version. At current, im having to run vmware under windows and then running a linux guest OS so that i can compile and run the progs sucessfully. However the programs run a fair bit slower when running through vmware, not surprisingly. I was wondering if the current DJGPP binary package is supposed to be fully W2K compatible and if not, the problems might not occur on the fully W2K compatible version. I would like to thank everyone for their help so far. -- ____________________________________ Graham Rangel-Sharp MEng Institute of Microwaves and Photonics School of Electonic and Electrical Engineering The University of Leeds Leeds LS2 9JT Tel:+44 (0)113 2332078 Fax:+44 (0)113 2332032 "Eli Zaretskii" wrote in message news:Pine DOT SUN DOT 3 DOT 91 DOT 1011122190942 DOT 18209I-100000 AT is... > > On Thu, 22 Nov 2001, Graham Rangel-Sharp wrote: > > > The problem is that im having to compile software written about 5 years ago > > on a sun machine. I can get it to compile and run on win2000 but after some > > time into the program, some of the calcutlations come out with answers of > > NaN. The software runs a simulation of a transister and incorporates many > > iterations, they seem to start of okay, giving sensible answers but about > > 20-30 mins into the running the strange results appear. I dont think its a > > problem with the code since it works fine on a friends linux machine. > > GNU/Linux systems use a different math library, and also a different > setup of the FP processor. So assuming it's a DJGPP problem because the > GNU/Linux binary runs okay is not a recommended approach. > > Let's begin with the basics: what compiler switches were used during > compilation and link of the program? Was libm.a, the math library, > linked in (do you see the -lm switch in the link command line)? > > > I recently tried the win2k djdev204_alpha_win2k.zip which resulted in the > > NaN`s coming very much sooner during the program. > > I suspect uninitialized memory (Unix and GNU/Linux systems initialize > memory allocated off the heap to all zeroes, while DJGPP doesn't do that, > for performance reasons). Try building the program with the > _CRT0_FLAG_FILL_SBRK_MEMORY bit set in the _crt0_startup_flags variable, > and see if the problems go away.