From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1e11857ea4f39dd6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!bcklog2.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 16 Apr 2007 18:15:03 -0500 Date: Mon, 16 Apr 2007 18:46:44 -0400 From: Jeffrey Creem User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Trig Function Linking Problems References: <1176755562.190964.167640@w1g2000hsg.googlegroups.com> In-Reply-To: <1176755562.190964.167640@w1g2000hsg.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.74.171 X-Trace: sv3-4QRqD9ctGXqYLWj4nRl09eEeJ0YW9ZzjH/QM21Rk7CxITXprKSykcSueJnspWA66OEsoBV2mYZ1ItxZ!P837D1JdfY0/Wnhoa77nihwXK8y1qQHy1SpBuOVMKKY18ENTI9MGvBXiFEJSXkNIXJ4rHLnwkauY!N5vNuBrD+DHvdd5UC4LLDA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.34 Xref: g2news1.google.com comp.lang.ada:15066 Date: 2007-04-16T18:46:44-04:00 List-Id: AJAskey wrote: > Hi. We are moving some software from and ancient workstation to a > newer one. The environment is still several years old but newer than > the old-timer we are leaving. We cannot get the TRIG functions to > work as there appears to be a problem interfacing to the library. The > following test code works on the old-time system, but fails on two > separate newer systems. Any help would be greatly appreciated. > > with ada.text_io; > use ada.text_io; > with ada.numerics.elementary_functions; > procedure TRIG is > a,b,c,d : float; > begin > a := 3.1415/4.0; > b := ada.numerics.elementary_functions.sin(x=>a); > c := ada.numerics.elementary_functions.cos(x=>a); > d := ada.numerics.elementary_functions.tan(x=>a); > put_line("sin(a)" & float'image(b)); > put_line("cos(a)" & float'image(c)); > put_line("tan(a)" & float'image(d)); > put_line("a " & float'image(a)); > end TRIG; > >>>From system with : GNATMAKE 3.13p (20000509) Copyright 1995-2000 > Free Software Foundation, Inc. > gcc 2.96 > Linux Red Hat 7.1 2.96-98 > > > [I don't need to do anything special except a gnatmake.] > >>> gnatmake trig > gnatgcc -c trig.adb > gnatbind -x trig.ali > gnatlink trig.ali > >>> trig > sin(a) 7.07090E-01 > cos(a) 7.07123E-01 > tan(a) 9.99954E-01 > a 7.85375E-01 > > --------------------------------------------- > >>>From new system with : GNATMAKE 3.2.3-13 (20030502) Copyright > 1995-2000 Free Software Foundation, Inc. > gcc 3.2.3 > Linux Red Hat 3.2.3-53 > >>> gnatmake trig > gcc -c trig.adb > gnatbind -x trig.ali > gnatlink trig.ali > >>> trig > > raised CONSTRAINT_ERROR : s-imgrea.adb:236 > > > [I tried linking in the -lm library which is required in the "c" > version of this test. I also tried linking a few others, but > continued to get the run-time error. > > On another similar system, the program ran but returned NaN in the > debugger for b,c,d after the sin,cos,tan calls. I assume it really > isn't finding the library.] > >>> gnatmake -c trig.adb >>> gnatbind -x trig >>> gnatlink -lm -lc -lgnat trig > >>> trig > > raised CONSTRAINT_ERROR : s-imgrea.adb:236 > > > Any ideas what I should be linking in? > > Thanks much. > Andy > I don't think the problem is not finding the library as this generally gives a much more specific error. I would guess it is more fundamentally broken than just a library issue. Can you update to a GNATPro version or a later GCC version?