From: gina AT se-38 DOT wpa DOT wtb DOT tue DOT nl (Gina Fabian) Newsgroups: sci.math.num-analysis,comp.lang.fortran,gnu.gcc.help,comp.os.msdos.djgpp Subject: FORTRAN code with DJGPP Date: 11 Aug 1997 09:37:31 GMT Organization: Eindhoven University of Technology, The Netherlands Lines: 104 Distribution: inet Message-ID: <5smmgr$fcj@tuegate.tue.nl> NNTP-Posting-Host: se-38.wpa.wtb.tue.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi everybody, I am asking your help to solve the following problem: I develop a software in C++ for DOS and Linux. I use a well known and fairly well debugged FORTAN code: DDASRT. The problem started when I added an other FORTRAN routine: NLEQ. After renaming some routines in the two FORTRAN codes, so they do not shadow each other, I could compile the code under Linux with gcc 2.7.2.1 I could compile it as well under DOS, using the EMX port of gcc. What I did, is that I compiled the FORTRAN routines using g77, and I used the headers generated by f2c to declare the routines for the rest of the code. Now, it is important for me to be able to compile the code with DJGPP, the other DOS port of gnu gcc. I could not succeed. The executable breaks with Arithmetic Error. Since I am not the author of these codes, I would not like to debug them. So my question: Are there any general guidelines to treat FORTRAN codes in DJGPP? Has anyone seen the same problem, and got a solution? Thanks for any reply, Georgina Fabian (Detailed description of my setup comes below) =============================================================================== Georgina Fabian Eindhoven University of Technology Department Mechanical Engineering Section Systems Engineering P.O.Box 513, 5600 MB Eindhoven Tel: +31 40 2474155 Fax: +31 40 2452505 E-mail:gina AT se-43 DOT wpa DOT wtb DOT tue DOT nl =============================================================================== I have checked the machine dependent codes in : d1mach, i1mach, r1mach. They are set to the IEEE standards, what I do use. I have renamed all routines. Now DDASRT routines are: ddasrt_, drcheck_, droots_, xerrwv_ ddassl_, ddawts_, ddaini_, ddatrp_, ddastp_, ddajac_, ddaslv_, xermsg_, xeerhlt_, xerprn_, xgetua_, xsetua_ NLEQ1 (NLEQ version1) routines: nleq1_ n1pchk_ n1int_ n1scal_ n1scrf_ n1scrb_ n1fact_ n1solv_ n1lvls_ n1jac_ n1 jacb_ n1jcf_ n1jcfb_ n1prv1_ n1prv2_ n1sout_ wnorm1_ dgefanl_ dgeslnl_ dgbfanl_ dgbslnl_ daxpy_ dscalnl_ idamaxnl_ ddot_ __g77_masterfun_montor montor_ monini_ mondef_ monsrt_ monon_ monoff_ monend_ secondnl_ d1machnl_ NLEQ2 (NLEQ version2) routines: nleq2_ n2pchk_ n2int_ n2scal_ n2scrf_ n2fact_ n2solv_ n2lvls_ n2jac_ n2jcf_ n2p rjn_ n2prv1_ n2prv2_ n2sout_ wnorm_ deccon_ solcon_ __g77_masterfun_montor2 mont or2_ monini2_ mondef2_ monsrt2_ monon2_ monoff2_ monend2_ secondnl2_ d1machnl2_ About DJGPP: all devices are loaded in high memory, virtual memory: 20Mb, smartdrive: 2Mb ramdrive: 8Mb I guess this is O.K. since I can compile well. I enlarged the stacksize with stubedit to 1Mb. The version I am using is: gcc 2.7.2.1.f.1 Compiling my library: g77 -c $(SOURCE) (Source files are of type .f .c .cc) Creating my library: ar -r mylib.a $(OBJS) Creating an executable: gcc -c -Ipath_to_mylib file.cc g77 file.o -Lpath_to_mylib -lmylib -lstdcx -lgpp -lf2c -lm -s -o file.exe Output: Exiting due to signal SIGFPE Floating Point exception at eip=0003471b eax=000f45a3 ebx=00000004 ecx=00000001 edx=000f0540 esi=000f0548 edi=00000004 ebp=000ee6bc esp=000ee64c cs=00af ds=00b7 es=00b7 fs=008f gs=00c7 ss=00b7 Call frame traceback EIPs: 0x0003471b 0x000326b4 0x000246ab 0x0000d614 0x0000294f 0x00094867 I am sorry I can not supply gdb output, because it can't find symbols, although I have compiled everything with -g. In any case it says, that my code breaks with arithmetic error.