[144719] trunk/dports/math/DSDP
mcalhoun at macports.org
mcalhoun at macports.org
Fri Jan 15 19:41:22 PST 2016
Revision: 144719
https://trac.macports.org/changeset/144719
Author: mcalhoun at macports.org
Date: 2016-01-15 19:41:22 -0800 (Fri, 15 Jan 2016)
Log Message:
-----------
DSDP: allow universal build
Modified Paths:
--------------
trunk/dports/math/DSDP/Portfile
trunk/dports/math/DSDP/files/patch-make.include.diff
Modified: trunk/dports/math/DSDP/Portfile
===================================================================
--- trunk/dports/math/DSDP/Portfile 2016-01-16 03:39:31 UTC (rev 144718)
+++ trunk/dports/math/DSDP/Portfile 2016-01-16 03:41:22 UTC (rev 144719)
@@ -2,6 +2,7 @@
# $Id$
PortSystem 1.0
+PortGroup muniversal 1.0
name DSDP
version 5.8
@@ -32,7 +33,17 @@
use_configure no
build.target dsdpapi
-build.env-append DSDPROOT=${worksrcpath}
+if { ![variant_isset universal] } {
+ build.env-append \
+ DSDPROOT=${worksrcpath} \
+ MP_ARCHFLAGS="${configure.cc_archflags}"
+} else {
+ foreach arch ${configure.universal_archs} {
+ lappend merger_build_env(${arch}) \
+ DSDPROOT=${worksrcpath}-${arch} \
+ MP_ARCHFLAGS='-arch ${arch}'
+ }
+}
variant atlas description {Use ATLAS as BLAS, LAPACK library} {
depends_lib-append port:atlas
@@ -46,30 +57,35 @@
post-patch {
reinplace "s|@@MP_CC@@|${configure.cc}|g" \
${worksrcpath}/make.include
- reinplace "s|@@MP_ARCHFLAGS@@|${configure.cc_archflags}|g" \
- ${worksrcpath}/make.include
if {[variant_isset atlas]} {
- reinplace "s|-Wl,-framework -Wl,Accelerate -lm|-ltatlas -lm|g" \
+ reinplace "s|@@MP_LAPACKBLAS@@|-ltatlas -lm|g" \
${worksrcpath}/make.include
+ } else {
+ reinplace "s|@@MP_LAPACKBLAS@@|-Wl,-framework -Wl,Accelerate|g" \
+ ${worksrcpath}/make.include
}
}
-destroot {
- xinstall ${worksrcpath}/lib/libdsdp.a ${destroot}${prefix}/lib
- eval xinstall [glob ${worksrcpath}/include/*] ${destroot}${prefix}/include
- xinstall ${worksrcpath}/bin/dsdp5 ${destroot}${prefix}/bin
- xinstall ${worksrcpath}/bin/maxcut ${destroot}${prefix}/bin
- xinstall ${worksrcpath}/bin/theta ${destroot}${prefix}/bin
-
+# muniversal build requires Makefile
+post-extract {
+ set makefile [open ${worksrcpath}/Makefile-Install "w"]
+ puts ${makefile} "MSITE:=\$(shell ${prefix}/bin/octave-config --m-site-dir)/dsdp"
+ puts ${makefile} {install:}
+ puts ${makefile} "\t/usr/bin/install -m 0644 include/* \$(DESTDIR)${prefix}/include/"
+ foreach bin "dsdp5 maxcut theta" {
+ puts ${makefile} "\t/usr/bin/install -m 0755 bin/${bin} \$(DESTDIR)${prefix}/bin/"
+ }
if {[variant_isset octave]} {
- if {[catch {set msite [exec ${prefix}/bin/octave-config --m-site-dir]}]} {
- set msite ${prefix}/share/dsdp/matlab
- }
- set msite ${msite}/dsdp
- xinstall -d ${destroot}${msite}
- eval file copy [glob ${worksrcpath}/matlab/*] ${destroot}${msite}
+ puts ${makefile} "\t/usr/bin/install -d -m 0755 \$(DESTDIR)\$(MSITE)"
+ puts ${makefile} "\t/usr/bin/install -m 0644 matlab/Contents \$(DESTDIR)\$(MSITE)"
+ puts ${makefile} "\t/usr/bin/install -m 0644 matlab/*.m \$(DESTDIR)\$(MSITE)"
+ puts ${makefile} "\t/usr/bin/install -m 0644 matlab/*.dat-s \$(DESTDIR)\$(MSITE)"
+ puts ${makefile} "\t/usr/bin/install -m 0644 matlab/*.out \$(DESTDIR)\$(MSITE)"
+ puts ${makefile} "\t/usr/bin/install -m 0755 matlab/*.mex \$(DESTDIR)\$(MSITE)"
}
+ close ${makefile}
}
+destroot.args-append -f Makefile-Install
livecheck.type regex
livecheck.url ${master_sites}
Modified: trunk/dports/math/DSDP/files/patch-make.include.diff
===================================================================
--- trunk/dports/math/DSDP/files/patch-make.include.diff 2016-01-16 03:39:31 UTC (rev 144718)
+++ trunk/dports/math/DSDP/files/patch-make.include.diff 2016-01-16 03:41:22 UTC (rev 144719)
@@ -24,8 +24,8 @@
# STEP 4. Set Linker and FLAGS: Link the DSDP library to application
-CFLAGS = ${OPTFLAGS} -I. -I${DSDPROOT}/include ${DSDPCFLAGS}
-CLINKER = ${CC} ${OPTFLAGS}
-+CFLAGS = ${OPTFLAGS} @@MP_ARCHFLAGS@@ -I. -I${DSDPROOT}/include ${DSDPCFLAGS}
-+CLINKER = ${CC} ${OPTFLAGS} @@MP_ARCHFLAGS@@
++CFLAGS = ${OPTFLAGS} ${MP_ARCHFLAGS} -I. -I${DSDPROOT}/include ${DSDPCFLAGS}
++CLINKER = ${CC} ${OPTFLAGS} ${MP_ARCHFLAGS}
#CLINKER = ${CXX} ${OPTFLAGS} -static
#CLINKER = link /out:dsdp5.exe
@@ -34,7 +34,7 @@
# Needed to link DSDP library to the driver ( read SDPA files, maxcut example, ...)
# Also include the math library and other libraries needed to link the BLAS to the C files that call them.
-LAPACKBLAS = -llapack -lblas -lg2c -lm
-+LAPACKBLAS = -ltatlas -lm
++LAPACKBLAS = @@MP_LAPACKBLAS@@
#LAPACKBLAS = -L/usr/lib/ -llapack -lblas -lg2c -lm
#LAPACKBLAS = -L/home/benson/ATLAS/Linux_P4SSE2/lib -llapack -lcblas -lf77blas -latlas -lg2c -lm
#LAPACKBLAS = -L/sandbox/benson/ATLAS-3.6/lib/Linux_P4SSE2 -llapack -lcblas -lf77blas -latlas -lg2c -lm
@@ -43,7 +43,7 @@
# STEP 6, MATLAB MACROS - If compiling Matlab interface, check MEX flag.
-MEX = mex -O
-+MEX = mkoctfile --mex
++MEX = /usr/bin/arch ${MP_ARCHFLAGS} mkoctfile --mex `mkoctfile -p BLAS_LIBS` -v
#MEX = C:\Matlab\bin\mex
DSDPMATLABDIR = ${DSDPROOT}/matlab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160115/0dba9f32/attachment.html>
More information about the macports-changes
mailing list