[57851] trunk/dports/math/atlas/Portfile

jameskyle at macports.org jameskyle at macports.org
Thu Sep 17 07:54:01 PDT 2009


Revision: 57851
          http://trac.macports.org/changeset/57851
Author:   jameskyle at macports.org
Date:     2009-09-17 07:54:00 -0700 (Thu, 17 Sep 2009)
Log Message:
-----------
1. Changed maintainer to jameskyle (myself)
2. Introduced test for macports build_arch for correct arch flags
3. Removed universal variant until I have time to read the documentation on how
to do so for atlas

Modified Paths:
--------------
    trunk/dports/math/atlas/Portfile

Modified: trunk/dports/math/atlas/Portfile
===================================================================
--- trunk/dports/math/atlas/Portfile	2009-09-17 14:52:57 UTC (rev 57850)
+++ trunk/dports/math/atlas/Portfile	2009-09-17 14:54:00 UTC (rev 57851)
@@ -13,7 +13,7 @@
 set atlasdist       ${name}${version}.tar.bz2
 set lapackdist      ${lapackname}.tgz
 
-maintainers         nomaintainer
+maintainers         jameskyle
 platforms           darwin
 
 description         Portable optimal linear algebra software
@@ -51,9 +51,17 @@
                     port:bzip2 \
                     port:gzip
 
+universal_variant   no
+
 # Set fortran compiler flags
 set myf77           ${prefix}/bin/gfortran-mp-4.3
 
+if {${build_arch} == "x86_64" || ${build_arch} == "ppc64" } {
+  set my_arch 64
+} else {
+  set my_arch 32
+}
+
 configure.args      -C xc ${prefix}/bin/gcc-mp-4.3 \
                     -C gc ${prefix}/bin/gcc-mp-4.3 \
                     -C if ${myf77} \
@@ -63,7 +71,7 @@
                     -C dk ${prefix}/bin/gcc-mp-4.3 \
                     -C sk ${prefix}/bin/gcc-mp-4.3 \
                     --cc=${prefix}/bin/gcc-mp-4.3 \
-                    -b 32 \
+                    -b ${my_arch} \
                     -Fa alg -fPIC 
                     
 configure.compiler macports-gcc-4.3
@@ -124,7 +132,7 @@
     reinplace "s|OPTS     = -O2|OPTS = ${atlas_fflags}|" \
            ${workpath}/${lapackname}-${lapackversion}/make.inc
     
-    reinplace "s|NOOPT    = -O0|NOOPT = -O2 -m32|" \
+    reinplace "s|NOOPT    = -O0|NOOPT = -O2 -m${my_arch}|" \
            ${workpath}/${lapackname}-${lapackversion}/make.inc
 
     reinplace "s|PLAT = _LINUX|PLAT = _darwin|" \
@@ -155,10 +163,18 @@
 pre-destroot {
   # We have to manually create the dylib shared libs as the default build does not do this
   if {[string equal "${os.arch}" "powerpc"]} {
-    set myarch "ppc"
-    } {
-      set myarch "i386"
+    if {${my_arch} == "64" } {
+      set myarch "ppc64"
+    } else {
+      set myarch "ppc"
     }
+    } else {
+      if {${my_arch} == "64" } {
+        set myarch "x86_64"
+      } else {
+        set myarch "i386"
+      }
+    }
   
   set ld "ld -arch ${myarch} -dynamic -dylib -single_module -dead_strip -x \
           -all_load -L. -L${prefix}/lib/gcc43 -ldylib1.o -dylib_install_name"
@@ -168,17 +184,17 @@
            -lSystem"
   
   system "cd ${workpath}/${name}-${version}/build/lib && \
-          ${ld} ${prefix}/lib/libptcblas.dylib libptcblas.a -o \
+          ${ld} -arch ${myarch} ${prefix}/lib/libptcblas.dylib libptcblas.a -o \
            libptcblas.dylib -latlas \
            -lSystem"
   
   system "cd ${workpath}/${name}-${version}/build/lib && \
-          ${ld} ${prefix}/lib/libptf77blas.dylib \
+          ${ld} -arch ${myarch} ${prefix}/lib/libptf77blas.dylib \
           libptf77blas.a -o libptf77blas.dylib \
            -lgfortran -latlas -lSystem"
 
   system "cd ${workpath}/${name}-${version}/build/lib && \
-          ${ld} ${prefix}/lib/liblapack.dylib liblapack.a -o liblapack.dylib \
+          ${ld} -arch ${myarch} ${prefix}/lib/liblapack.dylib liblapack.a -o liblapack.dylib \
            -lptf77blas -lgfortran -lptcblas -latlas -lgcc_s.1 -lSystem"
 
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090917/696a61b6/attachment-0001.html>


More information about the macports-changes mailing list