ccl icon indicating copy to clipboard operation
ccl copied to clipboard

wx86cl64 give correct results, but wx86cl not...

Open jszhao opened this issue 4 years ago • 7 comments

The problem could be replicated by following steps:

  1. download the Maxima 5.45.0
  2. use wx86cl and wx86cl64 to compile maxima by following the INSTALL.lisp
  3. even there are lots of warnings, wx86cl64 could compile maxima, however, wx86cl give the following error:
> Error: Unknown vinsn: CCL::SPILL-COMPLEX-DOUBLE-FLOAT
> While executing: CCL::NEED-VINSN-TEMPLATE, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.

I can not figure out what's the problem.

I use the latest release of CCL on Windows 10.

jszhao avatar Jun 03 '21 15:06 jszhao

The "unknown vinsn" message means there is a compiler bug.

xrme avatar Jun 03 '21 17:06 xrme

This appears to be a casualty of the new register allocator that was added in 2015. That code is supposed to do nothing on 32-bit implementations, but it appears you've found an exception. In any case I don't even have a machine that will run the 32-bit implementation any more so I can't test your example. Is it absolutely necessary to use the 32-bit implementation?

One thing you might try is (setf ccl::*force-legacy-backend* t)

prior to compiling Maxima. That's a slightly bigger hammer to tell the compiler not to use the new register allocator, but it still might not cover this particular case.

svspire avatar Jun 03 '21 22:06 svspire

Thanks a lot for the explanation.

This appears to be a casualty of the new register allocator that was added in 2015. That code is supposed to do nothing on 32-bit implementations, but it appears you've found an exception. In any case I don't even have a machine that will run the 32-bit implementation any more so I can't test your example. Is it absolutely necessary to use the 32-bit implementation?

does it mean I need a 32-bit machine to run the 32-bit implementation? Can I run it on a 64-bit system, e.g., 64-bit Windows 10? There is no necessary to use the 32-bit implementation. I just want to test a batch script for 32-bit Maxima.

One thing you might try is (setf ccl::*force-legacy-backend* t)

prior to compiling Maxima. That's a slightly bigger hammer to tell the compiler not to use the new register allocator, but it still might not cover this particular case.

I try the code, however, I get the same error.

jszhao avatar Jun 04 '21 02:06 jszhao

Thanks a lot for the explanation.

This appears to be a casualty of the new register allocator that was added in 2015. That code is supposed to do nothing on 32-bit implementations, but it appears you've found an exception. In any case I don't even have a machine that will run the 32-bit implementation any more so I can't test your example. Is it absolutely necessary to use the 32-bit implementation?

does it mean I need a 32-bit machine to run the 32-bit implementation? Can I run it on a 64-bit system, e.g., 64-bit Windows 10? There is no necessary to use the 32-bit implementation. I just want to test a batch script for 32-bit Maxima.

One thing you might try is (setf ccl::*force-legacy-backend* t)

prior to compiling Maxima. That's a slightly bigger hammer to tell the compiler not to use the new register allocator, but it still might not cover this particular case.

I try the code, however, I get the same error.

jszhao avatar Jun 04 '21 03:06 jszhao

You need a 32-bit operating system to run the 32-bit implementation (which I no longer have), but it appears that you already have that since you wouldn't have been able to run wx86cl at all otherwise.

The problem appears to be that the most recent versions of 32-bit CCL have a bug that Maxima exploits. If you can get a version of CCL prior to 2015 you might be able to make Maxima work in 32-bit mode. If you use git you might be able to check out an old version and rebuild CCL from there.

Again, this only affects 32-bit CCL which doesn't get much attention either from its users or developers these days because it's close to being obsolete. If you only target 64-bit CCL this problem apparently goes away.

Everything above is a guess because I use a Mac -- not Windows -- and I cannot test the code in question.

svspire avatar Jun 04 '21 17:06 svspire

You need a 32-bit operating system to run the 32-bit implementation (which I no longer have), but it appears that you already have that since you wouldn't have been able to run wx86cl at all otherwise.

Huh?

┌─[phoe][machine][~/.local/bin/clozure-cl]
└─▪ uname -a
Linux helix 5.10.0-1-amd64 #1 SMP Debian 5.10.4-1 (2020-12-31) x86_64 GNU/Linux
┌─[phoe][machine][~/.local/bin/clozure-cl]
└─▪ ./lx86cl
Clozure Common Lisp Version 1.12 (v1.12) LinuxX8632

For more information about CCL, please see http://ccl.clozure.com.

CCL is free software.  It is distributed under the terms of the Apache
Licence, Version 2.0.
? 

I am a Linux user and I don't think this is any different for Windows - I remember it being able to run 32-bit executables just fine on a 64-bit operating system. (Macs, obviously, get a different treatment, but that's just because Apple scrapped their 32-bit support.)

phoe avatar Jun 04 '21 17:06 phoe

That's what I meant; I should have said you need a 32-bit capable operating system. Newer versions of MacOS like mine are no longer capable of running 32-bit applications at all. Thanks for the Windows info; I'm ignorant about the Windows world.

svspire avatar Jun 04 '21 17:06 svspire