[MacPorts] #44503: DSDP: Build with Apple's Accelerator.framework by default
MacPorts
noreply at macports.org
Wed Jul 30 16:50:19 PDT 2014
#44503: DSDP: Build with Apple's Accelerator.framework by default
----------------------------+--------------------------------
Reporter: mark.brethen@… | Owner: macports-tickets@…
Type: enhancement | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.3.1
Keywords: | Port: DSDP
----------------------------+--------------------------------
Port py-cvxopt uses optional solvers, one of which is DSDP, uses atlas'
blas and lapack. Both py-cvxopt and py-numpy build with Apple's
Accelerator.framework by default. DSDP however builds with macports'
atlas. This breaks the install.
I was able to build DSDP with Apple's Accelerate.framework by patching
'make.include' at this line:
{{{
#!div style="font-size: 80%"
Code highlighting:
{{{#!c++
-LAPACKBLAS = -llapack -lblas -lg2c -lm
+LAPACKBLAS = -Wl,-framework -Wl,Accelerate -lm
}}}
}}}
and tested that it works with the following python program:
{{{
#!div style="font-size: 80%"
Code highlighting:
{{{#!python
from cvxopt.base import matrix,spmatrix
from cvxopt import solvers
clst=[0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0]
hlst=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, -1.0]
Gr=[0, 7, 14, 21, 28, 1, 5, 8]+[35]*5
Gc=[0, 1, 2, 3, 4, 5, 6, 7]+range(5)
Gmtr=spmatrix([1.0]*8+[-1.0]*5,Gr,Gc,(36,8))
c=-matrix(clst)
Gs=[-Gmtr]
h=[-matrix(hlst,(6,6))]
try:
sol=solvers.sdp(c,Gs=Gs,hs=h,solver='dsdp')
print 'optimal value: %.2f'%(1+(matrix(clst,(1,8))*sol['x'])[0],)
except:
print 'could not use dsdp'
sol=solvers.sdp(c,Gs=Gs,hs=h)
print 'optimal value: %.2f'%(1+(matrix(clst,(1,8))*sol['x'])[0],)
raise
}}}
}}}
For consistency, DSDP should build with the accelerator.framework by
default, with a variant to build using macports' atlas port. The patch I
applied conflicts with the existing patch, so a decision needs to made how
best to implement either patch.
--
Ticket URL: <https://trac.macports.org/ticket/44503>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list