<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>For anyone who is interested in pursuing further the issues with Lion's BLAS when using the Accelerate/vecLib frameworks, below is a response I got from Charlie Sharpsteen to an e-mail I sent to him. If anyone gets a chance to sort through this issue and get Ipopt working with the native OS X BLAS (in Accelerate/vecLib), please post your solution here.</div><div><br></div><div>Btw, I also tried the Goto BLAS, but I can't seem to make a 64-bit version without the following sorts of errors:</div><div><div><br></div><div>../kernel/x86_64/symv_U_sse.S:410:32-bit absolute addressing is not supported for x86-64</div><div>../kernel/x86_64/symv_U_sse.S:410:cannot do signed 4 byte relocation</div></div><div><br></div><div>Thanks,</div><div><span class="Apple-style-span" style="font-size: 12px; "><br></span></div><div><span class="Apple-style-span" style="font-size: 12px; ">-- </span></div><div style="font-size: 12px; ">Ray Zimmerman</div><div style="font-size: 12px; ">Senior Research Associate</div><div style="font-size: 12px; ">419A Warren Hall, Cornell University, Ithaca, NY 14853</div><div style="font-size: 12px; ">phone: (607) 255-9645</div><div><br></div><div>On Oct 18, 2011, at 4:47 PM, Charlie Sharpsteen wrote:</div><div><blockquote type="cite">On Tue, Oct 18, 2011 at 11:54 AM, Ray Zimmerman wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; "><div style="word-wrap: break-word; "><div>Hi Charlie,</div><div><br></div><div>I ran across some comments of yours at <a href="https://github.com/mxcl/homebrew/issues/6649#issuecomment-1666673" target="_blank">https://github.com/mxcl/homebrew/issues/6649#issuecomment-1666673</a> that appeared relevant to an issue I'm having.</div><div><br></div><div>I have been running into issues with building a numerical optimization package (<a href="https://projects.coin-or.org/Ipopt" target="_blank">Ipopt</a>) on Mac OS X Lion and I finally tracked it down to an issue with the BLAS in the Accelerate or vecLib frameworks (I assume both reference the same BLAS library?).</div></div></blockquote><div><br></div><div>That is correct. vecLib is actually a sub-component of Accelerate.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; "><div style="word-wrap: break-word; "><div>I found that if I force Ipopt to use a reference BLAS/LAPACK from netlib, everything works fine, but I'd really like to stick to the optimized versions provided by Apple for obvious reasons.</div><div><br></div><div>I was wondering if you have any suggestions for how I might work around these issues in my situation. The following threads describe my attempts to get this package working on Snow Leopard (solved) and now Lion.</div><div><br></div><div> <a href="http://list.coin-or.org/pipermail/ipopt/2011-October/002609.html" target="_blank">http://list.coin-or.org/pipermail/ipopt/2011-October/002609.html</a></div><div> <a href="http://list.coin-or.org/pipermail/ipopt/2011-October/002610.html" target="_blank">http://list.coin-or.org/pipermail/ipopt/2011-October/002610.html</a></div><div><br></div><div>In case it matters, some of the parts of Ipopt are built from fortran code, and I'm using the gfortran from gfortran-lion-5666-3.pkg at <a href="http://r.research.att.com/tools/" target="_blank">http://r.research.att.com/tools/</a><br>and the following configure options for Ipopt.</div><div><br></div><div><div><font face="Courier">../configure --with-blas="-framework vecLib" \</font></div><div><font face="Courier"> --with-lapack="-framework vecLib" F77=gfortran \</font></div><div><font face="Courier"> FFLAGS="-fexceptions -m64 -fbackslash" \</font></div><div><font face="Courier"> CFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64" \</font></div><div><font face="Courier"> CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64" \</font></div><div><font face="Courier"> -disable-shared</font></div></div><div><br></div><div>Thanks in advance for any insight you might have to share.</div></div></blockquote><div><br></div><div>On Snow Leopard, you should be able to fix the vecLib BLAS by installing the `dotwrp` library (<a href="https://github.com/tenomoto/dotwrp">https://github.com/tenomoto/dotwrp</a>) which is a simple set of wrapper functions that normalize the BLAS API so that it can be linked during 64-bit compilation. To do so, make sure libdotwrp is linked first:</div><div><br></div><div> --with-lapack="-ldotwrp -framework vecLib"</div><div><br></div><div>I haven't upgraded to Lion yet, but from what I have heard the bug that `dotwrp` was fixing got fixed in a different way by Apple. In this case, the only way to properly link against vecLib may be to force GFortran into the legacy G77 mode using the `-ff2c` switch. This is explained in the documentation for the vecLib Framework:</div><div><br></div><div> <a href="http://developer.apple.com/hardwaredrivers/ve/errata.html#fortran_conventions">http://developer.apple.com/hardwaredrivers/ve/errata.html#fortran_conventions</a></div><div><br></div><div>I have tried going this route before and it was a major pain in the rear---there are a lot of software components that simply expect the newer GFortran linking conventions to be used and things tend to turn into a confused mess if some parts of the program have to use G77 conventions.</div><div><br></div><div>If it turns out that G77 conventions are required on Lion, I would take a hard look at how badly you need the vecLib BLAS. Do some profiling on Snow Leopard and see exactly how much speedup you get compared to NetLib. Perhaps another optimized implementation such as ATLAS (<a href="http://math-atlas.sourceforge.net/">http://math-atlas.sourceforge.net</a>) or GOTO BLAS (<a href="http://www.tacc.utexas.edu/tacc-projects/gotoblas2">http://www.tacc.utexas.edu/tacc-projects/gotoblas2</a>) would give you enough speed without the linking headache. The BLAS in Intel's Math Kernel Library is also pretty darn good if you have access to it.</div><div><br></div><div>Good Luck!</div><div><br></div><div>-Charlie</div></div></blockquote></div><div><div class="gmail_quote"><div><br></div><div>And later he wrote ...</div><div><br></div><div><div>On Oct 21, 2011, at 1:04 PM, Charlie Sharpsteen wrote:</div><blockquote type="cite">On Fri, Oct 21, 2011 at 9:42 AM, Ray Zimmerman wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; "><div style="word-wrap: break-word; ">On Oct 18, 2011, at 4:47 PM, Charlie Sharpsteen wrote:</div></blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; "><div style="word-wrap: break-word; "><div><div><div><div class="im"><br><blockquote type="cite"><div class="gmail_quote"><div>On Snow Leopard, you should be able to fix the vecLib BLAS by installing the `dotwrp` library (<a href="https://github.com/tenomoto/dotwrp" target="_blank">https://github.com/tenomoto/dotwrp</a>) which is a simple set of wrapper functions that normalize the BLAS API so that it can be linked during 64-bit compilation. To do so, make sure libdotwrp is linked first:</div><div><br></div><div> --with-lapack="-ldotwrp -framework vecLib"</div><div></div></div></blockquote><div><br></div></div><div>Hmmm ... the thing is, I haven't had any problems with the BLAS in vecLib on Snow Leopard ... only on Lion. And as far as I can tell the -ldotwrp flag is not being used anywhere.</div></div></div></div></div></blockquote><div><br></div><div>Under GFortran linking conventions on Snow Leopard the COMPLEX and DOUBLE COMPLEX routines are affected. This is a relatively rare data type for a matrix so the bug is obscure.</div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; "><div style="word-wrap: break-word; "><div><div><div><div class="im"><blockquote type="cite"><div class="gmail_quote"></div></blockquote></div></div></div></div></div></blockquote></div></blockquote></div><div><div class="gmail_quote"><div><br></div></div></div></div></div></body></html>