<div dir="ltr">Thanks Yoshiki, new configuration published.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-12 22:59 GMT+02:00 Yoshiki Ohshima <span dir="ltr"><<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ok, now I'm getting some success!<div><br></div><div>I start over with the VM: Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1044] Squeak Cog Spur 5.0.3248</div><div><br></div><div>and followed Nicolas' instruction in this thread. The image is 32-bit 5.0 image. In this setting all tests passed. Yay. To run the above mentioned example:</div><span class=""><div><br></div><div><span style="color:rgb(0,0,0);font-size:12.8px">-------------------</span><br style="color:rgb(0,0,0);font-size:12.8px"><span style="color:rgb(0,0,0);font-size:12.8px">a := LapackDGEMatrix rows: #(#(3 2 4) #(2 -5 -1) #(1 -2 2)).</span><br style="color:rgb(0,0,0);font-size:12.8px"><span style="color:rgb(0,0,0);font-size:12.8px">b := LapackDGEMatrix rows: #(#(1) (2) (3)).</span><br style="color:rgb(0,0,0);font-size:12.8px"><span style="color:rgb(0,0,0);font-size:12.8px">c := LapackLeastSquareProblem matrix: a rhsMatrix: b.</span><br style="color:rgb(0,0,0);font-size:12.8px"><br style="color:rgb(0,0,0);font-size:12.8px"><span style="color:rgb(0,0,0);font-size:12.8px">c solution.</span><br style="color:rgb(0,0,0);font-size:12.8px"><span style="color:rgb(0,0,0);font-size:12.8px">-------------------</span><br style="color:rgb(0,0,0);font-size:12.8px"></div><div><span style="color:rgb(0,0,0);font-size:12.8px"><br></span></div></span><div><font color="#000000"><span style="font-size:12.8px">I needed to fix the processSVD to make it work. The changes are to change:</span></font></div><div><font color="#000000"><span style="font-size:12.8px"><br></span></font></div><div><font color="#000000"><div><span style="font-size:12.8px"><span style="white-space:pre-wrap">        </span>rank := WordArray new: 1.</span></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">into:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div style="font-size:12.8px"><span style="white-space:pre-wrap">        </span>rank := ExternalLongArray new: 1.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">(otherwise #arrayPointer is not understood by 'rank') and also the return value from gelssWithm: has to be stored in 'info' (otherwise it will be always nil).</div><div style="font-size:12.8px"><br></div><div><br></div></div></font></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Aug 11, 2016 at 6:05 PM, Yoshiki Ohshima <span dir="ltr"><<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I have not reached the conclusion but would like to give some status report.<br>
<br>
My test case is simple:<br>
<br>
-------------------<br>
a := LapackDGEMatrix rows: #(#(3 2 4) #(2 -5 -1) #(1 -2 2)).<br>
b := LapackDGEMatrix rows: #(#(1) (2) (3)).<br>
c := LapackLeastSquareProblem matrix: a rhsMatrix: b.<br>
<br>
c solution.<br>
-------------------<br>
<br>
If I evaluate this, the external call for 'dgesvd_' in<br>
CLapackDLibrary>>xgesvdWithjob<wbr>u:jobvt:m:n:a:lda:s:u:ldu:vt:<wbr>ldvt:work:lwork:info:<br>
fails.<br>
<br>
But if I fix it by rewriting the cdecl line to:<br>
<br>
<cdecl: long 'dgesvd_'( char * char * long * long * double * long *<br>
double * double * long * double * long * double * long * long * )<br>
module: 'libLAPACK'><br>
<br>
from<br>
<br>
<cdecl: long 'dgesvd_'( char * char * long * long * double * long *<br>
double * double * long * double * long * double * long * long * )><br>
<br>
it passes.<br>
<br>
However, the value that gets stored in the 's' instance variable of<br>
LapackSVDecomposition is a LapackDGEMatrix, and when the resulting<br>
value is used in the #defaultTolerance, I get DNU for '*".<br>
<div><div><br>
<br>
<br>
On Tue, Aug 9, 2016 at 3:26 PM, Yoshiki Ohshima <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>> wrote:<br>
> Correction: (sorry)<br>
><br>
> In a 64 bit image, TestCBlas runs fine but the ones listed above fails<br>
> in a 32-bit image.<br>
><br>
> On Tue, Aug 9, 2016 at 3:12 PM, Yoshiki Ohshima <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>> wrote:<br>
>> Thanks!<br>
>><br>
>> I am trying this from a vanilla 5.0 image and I see that<br>
>> ConfigurationOfSmallapack-nice<wbr>.18 is loaded. Now, however, the<br>
>> following tests from Smallapack-SUnitTests category fail:<br>
>><br>
>> #('TestCBlas>>#testCsscal' 'TestCBlas>>#testSaxpy'<br>
>> 'TestCBlas>>#testSgemv' 'TestCBlas>>#testSgemvTrans'<br>
>> 'TestCBlas>>#testSger' 'TestCBlas>>#testSscal' 'TestCBlas>>#testStrsm'<br>
>> 'TestLapackMatrix>>#testMatrix<wbr>Product' 'TestLapackMatrix>>#testSum'<br>
>> 'TestRandMatrix>>#testOperatio<wbr>nTiming')<br>
>><br>
>> As I wrote, TestCBlas used to be all green. I'll check what has<br>
>> changed since -nice.16...<br>
>><br>
>> On Sat, Aug 6, 2016 at 4:56 PM, Nicolas Cellier<br>
>> <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmai<wbr>l.com</a>> wrote:<br>
>>> This should be fixed in ConfigurationOfSmallapack-nice<wbr>.18<br>
>>> BTW, I think you can provide the absolute path to the .dylib instead of<br>
>>> copying in local repository...<br>
>>><br>
>>><br>
>>> 2016-08-06 23:29 GMT+02:00 Nicolas Cellier<br>
>>> <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmai<wbr>l.com</a>>:<br>
>>>><br>
>>>> Hi Yoshiki,<br>
>>>> thanks for reporting, I'll try better...<br>
>>>><br>
>>>><br>
>>>> 2016-08-01 0:48 GMT+02:00 Yoshiki Ohshima <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>>:<br>
>>>>><br>
>>>>> I see you have some changes but it appears that evaluating the<br>
>>>>> Installer do it goes into an infinite loop of #moduleName and<br>
>>>>> #masOsxModuleName.<br>
>>>>><br>
>>>>> (Thanks again!)<br>
>>>>><br>
>>>>> On Sat, Jul 30, 2016 at 8:23 AM, Yoshiki Ohshima<br>
>>>>> <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>> wrote:<br>
>>>>> > But some of TestLapackMatrix tests fail. A few external functions<br>
>>>>> > cannot be found, it looks like.<br>
>>>>> ><br>
>>>>> > On Sat, Jul 30, 2016 at 7:55 AM, Yoshiki Ohshima<br>
>>>>> > <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>> wrote:<br>
>>>>> >> Great!<br>
>>>>> >><br>
>>>>> >> Before (I got into a meeting and then entered the "Friday mode", I was<br>
>>>>> >> going down the path of trying to call the Framework functions but<br>
>>>>> >> copying files anyway was a simpler solution for now.<br>
>>>>> >><br>
>>>>> >> Yes, I got all tests green. Thank you!<br>
>>>>> >><br>
>>>>> >> On Fri, Jul 29, 2016 at 3:24 PM, Nicolas Cellier<br>
>>>>> >> <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmai<wbr>l.com</a>> wrote:<br>
>>>>> >>> OK, what I did on my Mac:<br>
>>>>> >>><br>
>>>>> >>> 1) look under the Squeak app and edit the Contents/Info.plist<br>
>>>>> >>> 2) change value of SqueakPluginsBuiltInOrLocalOnl<wbr>y to "No"<br>
>>>>> >>> otherwise library loading is restricted to the Squeak app bundle<br>
>>>>> >>> 3) copy the veclib framework library files (dylib) in same directory<br>
>>>>> >>> as<br>
>>>>> >>> squeak image<br>
>>>>> >>> 4) launch Squeak<br>
>>>>> >>> 5) install Smallapack<br>
>>>>> >>> follow instruction from<br>
>>>>> >>><br>
>>>>> >>> <a href="https://github.com/nicolas-cellier-aka-nice/smallapack/wiki/SmallapackSqueak" rel="noreferrer" target="_blank">https://github.com/nicolas-cel<wbr>lier-aka-nice/smallapack/wiki/<wbr>SmallapackSqueak</a><br>
>>>>> >>> 6) change CBlasLibrary class>>moduleName 'libcblas.dylib' -><br>
>>>>> >>> 'libBlas.dylib'<br>
>>>>> >>> nowadays, cblas and blas are in the same dylib...<br>
>>>>> >>> 7) change CLapackLibrary class>>moduleName 'libclapack.dylib' -><br>
>>>>> >>> 'libLapack.dylib'<br>
>>>>> >>> idem<br>
>>>>> >>> 8) re-initialize the cache (I know, I know, there are too many...)<br>
>>>>> >>> CBlasLibrary install. CLapackLibrary install. LapackMatrix<br>
>>>>> >>> resetBlasInterfaces; resetLapackInterfaces.<br>
>>>>> >>> 9) run the TestCBlas suite<br>
>>>>> >>><br>
>>>>> >>> It should be green<br>
>>>>> >>> I will commit the changes later, and will probably implement<br>
>>>>> >>> moduleNames as<br>
>>>>> >>> a Preference (pragma oriented).<br>
>>>>> >>> No need to override code anymore :)<br>
>>>>> >>><br>
>>>>> >>> I think step 3) is necessary because of ioLoadModuleRaw() in<br>
>>>>> >>> platforms/iOS/vm/OSX/sqMacUnix<wbr>ExternalPrims.m<br>
>>>>> >>><br>
>>>>> >>> <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/iOS/vm/OSX/sqMacUnixExternalPrims.m" rel="noreferrer" target="_blank">https://github.com/OpenSmallta<wbr>lk/opensmalltalk-vm/blob/Cog/<wbr>platforms/iOS/vm/OSX/<wbr>sqMacUnixExternalPrims.m</a><br>
>>>>> >>> It would only look those frameworks:<br>
>>>>> >>><br>
>>>>> >>> static char *frameworks[]=<br>
>>>>> >>> {<br>
>>>>> >>> "",<br>
>>>>> >>> "/CoreServices.framework/Fram<wbr>eworks",<br>
>>>>> >>> "/ApplicationServices.framewo<wbr>rk/Frameworks",<br>
>>>>> >>> "/Carbon.framework/<wbr>Frameworks",<br>
>>>>> >>> 0<br>
>>>>> >>> };<br>
>>>>> >>><br>
>>>>> >>> But I did step 3) before I tried 1) + 2), adn did not retry, so maybe<br>
>>>>> >>> I'm<br>
>>>>> >>> wrong...<br>
>>>>> >>> Scanning all the frameworks is not a solution. And what if we want a<br>
>>>>> >>> specific version?<br>
>>>>> >>> It would be far better to be able to specify the path to the library<br>
>>>>> >>> from<br>
>>>>> >>> within the image like VW...<br>
>>>>> >>><br>
>>>>> >>><br>
>>>>> >>> 2016-07-29 19:41 GMT+02:00 Nicolas Cellier<br>
>>>>> >>> <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmai<wbr>l.com</a>>:<br>
>>>>> >>>><br>
>>>>> >>>><br>
>>>>> >>>><br>
>>>>> >>>> 2016-07-29 19:28 GMT+02:00 Nicolas Cellier<br>
>>>>> >>>> <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmai<wbr>l.com</a>>:<br>
>>>>> >>>>><br>
>>>>> >>>>><br>
>>>>> >>>>><br>
>>>>> >>>>> 2016-07-29 19:02 GMT+02:00 Yoshiki Ohshima<br>
>>>>> >>>>> <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>>:<br>
>>>>> >>>>>><br>
>>>>> >>>>>> First question:<br>
>>>>> >>>>>><br>
>>>>> >>>>>> The Mac OS comes with Accelerate.Framework and that contains BLAS.<br>
>>>>> >>>>>> But probably I still should compile those libraries, right?<br>
>>>>> >>>>>><br>
>>>>> >>>>><br>
>>>>> >>>>> No, it's better to link to accelerated library.<br>
>>>>> >>>>> I don't have a Mac handy here to verify how to link to it though.<br>
>>>>> >>>>> I'll be able to check latter in the evening<br>
>>>>> >>>>><br>
>>>>> >>>><br>
>>>>> >>>><br>
>>>>> >>>> I've downloaded the code, and I see it now: the library names are<br>
>>>>> >>>> hardcoded (see implementors of moduleName).<br>
>>>>> >>>> For Mac it is libblas.dylib and libcblas.dylib<br>
>>>>> >>>> Also note that there is a preference for switching to cblas (blas<br>
>>>>> >>>> functions with C interface).<br>
>>>>> >>>> This should be faster because we pass some parameters by value<br>
>>>>> >>>> rather than<br>
>>>>> >>>> allocating them and pass reference...<br>
>>>>> >>>><br>
>>>>> >>>> Module names could also be replaced by Preferences eventually, but<br>
>>>>> >>>> by now,<br>
>>>>> >>>> you'll have to override...<br>
>>>>> >>>><br>
>>>>> >>>>>><br>
>>>>> >>>>>><br>
>>>>> >>>>>> On Thu, Jul 28, 2016 at 4:11 PM, Yoshiki Ohshima<br>
>>>>> >>>>>> <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>> wrote:<br>
>>>>> >>>>>> > Thanks!<br>
>>>>> >>>>>> ><br>
>>>>> >>>>>> > On Thu, Jul 28, 2016 at 4:04 PM, Nicolas Cellier<br>
>>>>> >>>>>> > <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmai<wbr>l.com</a>> wrote:<br>
>>>>> >>>>>> >> Hi Yoshiki,<br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >> Thanks for inquiring about Smallapack.<br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >> This problem has been solved in 2011 as the post tells.<br>
>>>>> >>>>>> >> Moreover, it was about alignment of squeak objects that was on<br>
>>>>> >>>>>> >> multiple of 4<br>
>>>>> >>>>>> >> on SqueakV3 memory.<br>
>>>>> >>>>>> >> Spur is 8 byte aligned, so the problem would have also vanished<br>
>>>>> >>>>>> >> without any<br>
>>>>> >>>>>> >> patch for those being patient :)<br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >> For the 15 arguments limit, Smallapack comes with it's own<br>
>>>>> >>>>>> >> compiler,<br>
>>>>> >>>>>> >> so it's<br>
>>>>> >>>>>> >> a non issue.<br>
>>>>> >>>>>> >> Maybe I should make the documentation more clear on<br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >> <a href="https://github.com/nicolas-cellier-aka-nice/smallapack/wiki/SmallapackSqueak" rel="noreferrer" target="_blank">https://github.com/nicolas-cel<wbr>lier-aka-nice/smallapack/wiki/<wbr>SmallapackSqueak</a><br>
>>>>> >>>>>> >> ?<br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >> Unfortunately, there's no Sparse Matrix representation in<br>
>>>>> >>>>>> >> Lapack.<br>
>>>>> >>>>>> >> If you know of a good package for that, it could be integrated.<br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >> If you have other questions, don't hesitate to ask.<br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >> cheers<br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >> Nicolas<br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >> 2016-07-29 0:22 GMT+02:00 Yoshiki Ohshima<br>
>>>>> >>>>>> >> <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>>:<br>
>>>>> >>>>>> >>><br>
>>>>> >>>>>> >>> I am trying to do a bit of linear algebra stuff that involves<br>
>>>>> >>>>>> >>> to<br>
>>>>> >>>>>> >>> solve<br>
>>>>> >>>>>> >>> a sparse 2D matrix (for a variation of doing least square<br>
>>>>> >>>>>> >>> fit).<br>
>>>>> >>>>>> >>><br>
>>>>> >>>>>> >>> There was a message from Nicolas:<br>
>>>>> >>>>>> >>><br>
>>>>> >>>>>> >>><br>
>>>>> >>>>>> >>><br>
>>>>> >>>>>> >>> <a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2011-August/161113.html" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/pipermail/squeak-dev/2011-<wbr>August/161113.html</a><br>
>>>>> >>>>>> >>><br>
>>>>> >>>>>> >>> Is this where it stands today, too? It looks like that arg<br>
>>>>> >>>>>> >>> count<br>
>>>>> >>>>>> >>> problem is still there in 5.0, but is it in a way non-issue as<br>
>>>>> >>>>>> >>> it is<br>
>>>>> >>>>>> >>> still FFI based?<br>
>>>>> >>>>>> >>><br>
>>>>> >>>>>> >>> Thanks!<br>
>>>>> >>>>>> >>><br>
>>>>> >>>>>> >>> --<br>
>>>>> >>>>>> >>> -- Yoshiki<br>
>>>>> >>>>>> >>><br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> >><br>
>>>>> >>>>>> ><br>
>>>>> >>>>>> ><br>
>>>>> >>>>>> ><br>
>>>>> >>>>>> > --<br>
>>>>> >>>>>> > -- Yoshiki<br>
>>>>> >>>>>><br>
>>>>> >>>>>><br>
>>>>> >>>>>><br>
>>>>> >>>>>> --<br>
>>>>> >>>>>> -- Yoshiki<br>
>>>>> >>>>>><br>
>>>>> >>>>><br>
>>>>> >>>><br>
>>>>> >>><br>
>>>>> >>><br>
>>>>> >>><br>
>>>>> >>><br>
>>>>> >><br>
>>>>> >><br>
>>>>> >><br>
>>>>> >> --<br>
>>>>> >> -- Yoshiki<br>
>>>>> ><br>
>>>>> ><br>
>>>>> ><br>
>>>>> > --<br>
>>>>> > -- Yoshiki<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> --<br>
>>>>> -- Yoshiki<br>
>>>>><br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>><br>
>><br>
>><br>
>> --<br>
>> -- Yoshiki<br>
><br>
><br>
><br>
> --<br>
> -- Yoshiki<br>
<br>
<br>
<br>
</div></div><span><font color="#888888">--<br>
-- Yoshiki<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div data-smartmail="gmail_signature">-- Yoshiki<div><br></div></div>
</font></span></div>
<br><br>
<br></blockquote></div><br></div>