Changeset 144719 for trunk/dports/math


Ignore:
Timestamp:
Jan 16, 2016, 3:41:22 AM (4 years ago)
Author:
mcalhoun@…
Message:

DSDP: allow universal build

Location:
trunk/dports/math/DSDP
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/math/DSDP/Portfile

    r127980 r144719  
    33
    44PortSystem          1.0
     5PortGroup           muniversal 1.0
    56
    67name                DSDP
     
    3334
    3435build.target        dsdpapi
    35 build.env-append    DSDPROOT=${worksrcpath}
     36if { ![variant_isset universal] } {
     37    build.env-append                              \
     38        DSDPROOT=${worksrcpath}                   \
     39        MP_ARCHFLAGS="${configure.cc_archflags}"
     40} else {
     41    foreach arch ${configure.universal_archs} {
     42        lappend merger_build_env(${arch})    \
     43            DSDPROOT=${worksrcpath}-${arch}  \
     44            MP_ARCHFLAGS='-arch ${arch}'
     45    }
     46}
    3647
    3748variant atlas description {Use ATLAS as BLAS, LAPACK library} {
     
    4758    reinplace "s|@@MP_CC@@|${configure.cc}|g" \
    4859        ${worksrcpath}/make.include
    49     reinplace "s|@@MP_ARCHFLAGS@@|${configure.cc_archflags}|g" \
    50         ${worksrcpath}/make.include
    5160    if {[variant_isset atlas]} {
    52         reinplace "s|-Wl,-framework -Wl,Accelerate -lm|-ltatlas -lm|g" \
     61        reinplace "s|@@MP_LAPACKBLAS@@|-ltatlas -lm|g" \
     62            ${worksrcpath}/make.include
     63    } else {
     64        reinplace "s|@@MP_LAPACKBLAS@@|-Wl,-framework -Wl,Accelerate|g" \
    5365            ${worksrcpath}/make.include
    5466    }
    5567}
    5668
    57 destroot {
    58     xinstall ${worksrcpath}/lib/libdsdp.a ${destroot}${prefix}/lib
    59     eval xinstall [glob ${worksrcpath}/include/*] ${destroot}${prefix}/include
    60     xinstall ${worksrcpath}/bin/dsdp5 ${destroot}${prefix}/bin
    61     xinstall ${worksrcpath}/bin/maxcut ${destroot}${prefix}/bin
    62     xinstall ${worksrcpath}/bin/theta ${destroot}${prefix}/bin
    63    
     69# muniversal build requires Makefile
     70post-extract {
     71    set makefile [open ${worksrcpath}/Makefile-Install "w"]
     72    puts ${makefile} "MSITE:=\$(shell ${prefix}/bin/octave-config --m-site-dir)/dsdp"
     73    puts ${makefile} {install:}
     74    puts ${makefile} "\t/usr/bin/install -m 0644 include/* \$(DESTDIR)${prefix}/include/"
     75    foreach bin "dsdp5 maxcut theta" {
     76        puts ${makefile} "\t/usr/bin/install -m 0755 bin/${bin} \$(DESTDIR)${prefix}/bin/"
     77    }
    6478    if {[variant_isset octave]} {
    65         if {[catch {set msite [exec ${prefix}/bin/octave-config --m-site-dir]}]} {
    66             set msite ${prefix}/share/dsdp/matlab
    67         }
    68         set msite ${msite}/dsdp
    69         xinstall -d ${destroot}${msite}
    70         eval file copy [glob ${worksrcpath}/matlab/*] ${destroot}${msite}
     79        puts ${makefile} "\t/usr/bin/install -d -m 0755 \$(DESTDIR)\$(MSITE)"
     80        puts ${makefile} "\t/usr/bin/install -m 0644 matlab/Contents \$(DESTDIR)\$(MSITE)"
     81        puts ${makefile} "\t/usr/bin/install -m 0644 matlab/*.m \$(DESTDIR)\$(MSITE)"
     82        puts ${makefile} "\t/usr/bin/install -m 0644 matlab/*.dat-s \$(DESTDIR)\$(MSITE)"
     83        puts ${makefile} "\t/usr/bin/install -m 0644 matlab/*.out \$(DESTDIR)\$(MSITE)"
     84        puts ${makefile} "\t/usr/bin/install -m 0755 matlab/*.mex \$(DESTDIR)\$(MSITE)"
    7185    }
     86    close ${makefile}
    7287}
     88destroot.args-append -f Makefile-Install
    7389
    7490livecheck.type      regex
  • trunk/dports/math/DSDP/files/patch-make.include.diff

    r125631 r144719  
    2525-CFLAGS   = ${OPTFLAGS} -I. -I${DSDPROOT}/include ${DSDPCFLAGS}
    2626-CLINKER        = ${CC} ${OPTFLAGS}
    27 +CFLAGS   = ${OPTFLAGS} @@MP_ARCHFLAGS@@ -I. -I${DSDPROOT}/include ${DSDPCFLAGS}
    28 +CLINKER        = ${CC} ${OPTFLAGS} @@MP_ARCHFLAGS@@
     27+CFLAGS   = ${OPTFLAGS} ${MP_ARCHFLAGS} -I. -I${DSDPROOT}/include ${DSDPCFLAGS}
     28+CLINKER        = ${CC} ${OPTFLAGS} ${MP_ARCHFLAGS}
    2929 #CLINKER       = ${CXX} ${OPTFLAGS} -static
    3030 #CLINKER       = link /out:dsdp5.exe
     
    3535 # Also include the math library and other libraries needed to link the BLAS to the C files that call them.
    3636-LAPACKBLAS  = -llapack -lblas -lg2c -lm
    37 +LAPACKBLAS  = -ltatlas -lm
     37+LAPACKBLAS  = @@MP_LAPACKBLAS@@
    3838 #LAPACKBLAS  = -L/usr/lib/ -llapack -lblas -lg2c -lm
    3939 #LAPACKBLAS  = -L/home/benson/ATLAS/Linux_P4SSE2/lib -llapack -lcblas -lf77blas -latlas -lg2c -lm
     
    4444 # STEP 6, MATLAB MACROS - If compiling Matlab interface, check MEX flag.
    4545-MEX           = mex -O
    46 +MEX           = mkoctfile --mex
     46+MEX           = /usr/bin/arch ${MP_ARCHFLAGS} mkoctfile --mex `mkoctfile -p BLAS_LIBS` -v
    4747 #MEX     = C:\Matlab\bin\mex
    4848 DSDPMATLABDIR = ${DSDPROOT}/matlab
Note: See TracChangeset for help on using the changeset viewer.