Thread: [q-lang-users] q 7.11 tests fail on Mac OS X
Brought to you by:
agraef
From: Ryan S. <rya...@us...> - 2008-06-08 12:01:11
|
I just ran the test suite on Mac OS X 10.4.11 Intel... It's not passing for me... Am I doing something wrong? ---> Testing q DEBUG: Executing org.macports.test (q) DEBUG: Environment: "MACOSX_DEPLOYMENT_TARGET"='10.4' DEBUG: Assembled command: 'cd "/mp/var/macports/build/ _Users_rschmidt_macports_dports_lang_q/work/q-7.11" && nice -n 1 make test' PATH="./src:/mp/bin:/mp/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/ bin" ./src/q -p "./stdlib:./modules/clib:./modules/clib" ./test.q Testing Q 7.11 (i386-apple-darwin8.11.1) TEST: local variables......... passed TEST: arithmetic.............. FAILED expected: (2,-1,4.0,0.5,181.0) got: (2,-1,4.4501477170164897e-308,0.99999999999999956,1.3499596723474909e-15 2) *** TEST FAILED, PLEASE CHECK INSTALLATION *** make: *** [test] Error 1 |
From: Albert G. <Dr....@t-...> - 2008-06-08 12:37:23
|
Is that a 64 bit machine? Maybe the compiler generates 64 bit code by default? Otherwise it's supposed to work. Ryan Schmidt wrote: > I just ran the test suite on Mac OS X 10.4.11 Intel... It's not > passing for me... Am I doing something wrong? -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-06-10 01:01:29
|
"It's not you, it's me." On Jun 8, 2008, at 07:37, Albert Graef wrote: > Ryan Schmidt wrote: > >> I just ran the test suite on Mac OS X 10.4.11 Intel... It's not >> passing for me... Am I doing something wrong? > > > Is that a 64 bit machine? Yes: That was a MacBookPro3,1 with a 2.2-GHz Core 2 Duo and Mac OS X 10.4.11. > Maybe the compiler generates 64 bit code by default? That should not be the case. I'm under the impression you have to use "-arch x86_64" in the LDFLAGS/CFLAGS to get 64-bit Intel code generated. > Otherwise it's supposed to work. I also tried on a MacBookPro2,2 with a 2.16-GHz Core 2 Duo and Mac OS X 10.5.3. All tests passed. I rebooted that machine into Mac OS X 10.4.11 and tried again, and all tests still passed. I also tried on a PowerMac3,4 with a 466-MHz PowerPC G4 and Mac OS X 10.4.11, and all tests passed. I rebooted the 2.2-GHz problem Mac to Mac OS X 10.5.3 and all tests passed there too. So apparently I have a problem with my 10.4.11 installation on my 2.2-GHz Mac. I think I'll go away now and see if I can solve that. I would love to know how the arithmetic test (or maybe q in general) does its math though. I can't get any other app to tell me that 2 * 2 == 4.4501477170164897e-308, and finding out how it's computing that might help me isolate what's wrong with my computer. |
From: Albert G. <Dr....@t-...> - 2008-06-10 05:40:55
|
Ryan Schmidt wrote: > I would love to know how the arithmetic test (or maybe q in general) > does its math though. I can't get any other app to tell me that 2 * 2 > == 4.4501477170164897e-308, and finding out how it's computing that > might help me isolate what's wrong with my computer. You can find all the arithmetic routines in qmfuns.c, look for qmadd et al. Bigint arithmetic is done using the gmp routines, double arithmetic using the C floating point operators. Apart from that, it's just boxing/unboxing, which are just accesses to a C struct, nothing unusual there. The bigint arithmetic seems to work, since the first two results are ok. It's the mixed double/bigint arithmetic that fails there. The bigint -> double promotion is done using another GMP routine, mpz_get_d, I don't see how that could go wrong unless GMP is broken on that machine. You could try whether just plain double arithmetic works. If you can run the interpreter from the command line, try something like '2.0*2.0' instead of '2*2.0', or edit test.q accordingly and run 'make test'. -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-06-11 10:58:33
|
On Jun 10, 2008, at 00:40, Albert Graef wrote: > Ryan Schmidt wrote: > >> I would love to know how the arithmetic test (or maybe q in general) >> does its math though. I can't get any other app to tell me that 2 * 2 >> == 4.4501477170164897e-308, and finding out how it's computing that >> might help me isolate what's wrong with my computer. > > You can find all the arithmetic routines in qmfuns.c, look for > qmadd et > al. Bigint arithmetic is done using the gmp routines, double > arithmetic > using the C floating point operators. Apart from that, it's just > boxing/unboxing, which are just accesses to a C struct, nothing > unusual > there. > > The bigint arithmetic seems to work, since the first two results > are ok. > It's the mixed double/bigint arithmetic that fails there. The > bigint -> > double promotion is done using another GMP routine, mpz_get_d, I don't > see how that could go wrong unless GMP is broken on that machine. > > You could try whether just plain double arithmetic works. If you > can run > the interpreter from the command line, try something like '2.0*2.0' > instead of '2*2.0', or edit test.q accordingly and run 'make test'. Thanks. Turns out my gmp is broken, and I know why [1] and I'm working to fix it. The fun output from q: ==> 1*1 1 ==> 1.0*1.0 1.0 ==> 1*1.0 2.22507385850824e-308 ==> 1.0*1 2.22507385850824e-308 [1] http://gmplib.org/list-archives/gmp-bugs/2008-June/001031.html |
From: Albert G. <Dr....@t-...> - 2008-06-11 20:59:22
|
Ryan Schmidt wrote: > [1] http://gmplib.org/list-archives/gmp-bugs/2008-June/001031.html Nice bug. :) Ok, so the issue isn't with Q. -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |