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

vince at macports.org vince at macports.org
Sun May 20 01:31:36 PDT 2012


Revision: 93326
          https://trac.macports.org/changeset/93326
Author:   vince at macports.org
Date:     2012-05-20 01:31:35 -0700 (Sun, 20 May 2012)
Log Message:
-----------
Change mpclang option into mpclang31 and mpclang32; decides upon possible compilers according to XCode version, not OS X. Some other cosmetic changes.

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

Modified: trunk/dports/math/atlas/Portfile
===================================================================
--- trunk/dports/math/atlas/Portfile	2012-05-20 08:28:29 UTC (rev 93325)
+++ trunk/dports/math/atlas/Portfile	2012-05-20 08:31:35 UTC (rev 93326)
@@ -44,32 +44,38 @@
     sha256  a7139ef97004d0e3c4c30f1c52d508fd7ae84b5fbaf0dd8e792c167dc306c3e9
 
 
-variant gcc47                   conflicts gcc45 gcc46 clang mpclang\
+variant gcc47                   conflicts gcc45 gcc46 clang mpclang31 mpclang32\
                                 description {build using macports-gcc-4.7} {
 
 }
 
-variant gcc46                   conflicts gcc45 gcc47 clang mpclang\
+variant gcc46                   conflicts gcc45 gcc47 clang mpclang31 mpclang32\
                                 description {build using macports-gcc-4.6} {
     
 }
 
-variant gcc45                   conflicts gcc46 gcc47 clang mpclang\
+variant gcc45                   conflicts gcc46 gcc47 clang mpclang31 mpclang32\
                                 description {build using macports-gcc-4.5} { 
                                 
 }
 
-variant clang                   conflicts gcc45 gcc46 gcc47 mpclang\
-                                description {build using clang and gfortran} {
+variant clang                   conflicts gcc45 gcc46 gcc47 mpclang31 mpclang32\
+                                description {build using system clang and gfortran} {
                                 
 }
     
-variant mpclang                 conflicts gcc45 gcc46 gcc47 clang\
-                                description {build using MPclang and gfortran} { 
+variant mpclang31               conflicts gcc45 gcc46 gcc47 clang mpclang32\
+                                description {build using MPclang 3.1 and gfortran} { 
     
-    depends_build-append        port:clang
+    depends_build-append        port:clang-3.1
 }
+
+variant mpclang32               conflicts gcc45 gcc46 gcc47 clang mpclang31\
+                                description {build using MPclang 3.2 and gfortran} { 
     
+    depends_build-append        port:clang-3.2
+}
+    
 variant dragonegg               conflicts gcc45 gcc46 gcc47\
                                 description {use dragonegg with gcc46} {
 
@@ -80,13 +86,14 @@
 }
 
 # Select proper gcc version (or clang)
+# The clang compiler bundled with Xcode < 4.3 is not suitable for
+# Atlas compiling.
 
-if {${os.major} < 11} {
+if {[join [split ${xcodeversion} "."] ""] < 43} {
 
-    # On SL or earlier, clang did not exist
     if {[variant_isset clang] || [variant_isset dragonegg46]} {
     
-        return -code error "Use of Clang is disabled on this version of MacOS."
+        return -code error "Use of Clang is disabled with this version of Xcode."
     }
     
     if {[variant_isset gcc45]} {
@@ -98,16 +105,21 @@
     } elseif {[variant_isset gcc47]} {
     
         set                     gccversion  4.7
-    } elseif {[variant_isset mpclang]} {
+    } elseif {[variant_isset mpclang31]} {
     
-        configure.compiler      macports-clang
-    } else {
+        configure.compiler      macports-clang-3.1
+    } elseif {[variant_isset mpclang32]} {
     
+        configure.cc            ${prefix}/bin/clang-mp-3.2
+    } else {
+    
         # Defaults to gcc46
         set                     gccversion  4.6
     }
+    
 } else {
-    # Lion or newer
+
+    # On Xcode > 4.2 we may use the standard Clang
     if {[variant_isset gcc45]} {
     
         set                     gccversion  4.5
@@ -120,9 +132,12 @@
     } elseif {[variant_isset dragonegg]} {
     
         set                     gccversion  4.6
-    } elseif {[variant_isset mpclang]} {
+    } elseif {[variant_isset mpclang31]} {
     
-        configure.compiler      macports-clang
+        configure.compiler      macports-clang-3.1
+    } elseif {[variant_isset mpclang32]} {
+    
+        configure.cc            ${prefix}/bin/clang-mp-3.2
     } elseif {[variant_isset clang]} {
     
         configure.compiler      clang
@@ -144,17 +159,18 @@
     configure.compiler          macports-gcc-${gccversion}
     
     depends_build-append        port:gcc${gccnumber}
+} else {
+
+    set use_clang               1
 }
 
-# Clang is not officially supported, so we must add a line to the
-# atlcomp.txt file specifying the flags used for compilation
-
 if {[info exists depends_skip_archcheck] && [info exists gccversion]} {
 
     depends_skip_archcheck      gcc${gccnumber}
 }
 
 # No cross-compilation possible
+
 if {${os.arch} == "i386"} {
 
     set universal_archs_supported {i386 x86_64}
@@ -181,6 +197,7 @@
     --dylibs
     
 # Dragonegg
+
 if {[variant_isset dragonegg]} {
     configure.args-delete -Fa alg -fPIC
     configure.args-append -Fa alg '-fPIC -fplugin=${prefix}/lib/dragonegg46.so'
@@ -204,7 +221,7 @@
 # MacPorts defaults to ppc on G4 and G5, so we must override 64-bit
 # detection by Atlas, even if we are on a G5
 
-if {${build_arch} == "ppc" && ! [variant_isset universal]} {
+if {${build_arch} == "ppc" && ![variant_isset universal]} {
 
     configure.args-delete       --cc=${configure.cc} \
                                 -Fa alg -fPIC
@@ -231,10 +248,10 @@
     (${os.major} > 8 && [sysctl hw.cpufamily] == 1418770316)} {
     
     # Core i2 processors (AVX)
-    # AVX instruction can’t be used with GCC because Apple bundled as (1)
+    # AVX instruction can’t be used with GCC because Apple bundled as(1)
     # does not support it. Use clang instead.
     
-    if {![variant_isset clang] && ![variant_isset mpclang]} {
+    if {![info exists use_clang]} {
     
         # Force Core i1 arch
         ui_warn "GCC compilers on OS X do not support AVX instructions."
@@ -288,7 +305,7 @@
 
 
 extract {
-    # extract atlas and move to a consistent working directory name
+    # extract Atlas and move to a consistent working directory name
     system -W ${workpath} "bunzip2 -dc ${distpath}/${atlasdist} | \
              gnutar --no-same-owner -xf -"
     system    "mv ${workpath}/ATLAS ${workpath}/${name}-${version}"
@@ -308,7 +325,7 @@
     }
 }
 
-# change the default compilers
+# Change the default compilers
 pre-configure {
 
     set cc [lindex [split ${configure.cc} '/'] end]
@@ -330,13 +347,12 @@
     # If we use clang, we must grasp a gfortran compiler to build
     # Fortran sources (do not impact overall Atlas performance)
 
-    if {![info exists gccnumber]} {
+    if {[info exists use_clang]} {
         ui_msg "Use of clang is still experimental and may result in\
                 reduced performance or misbehavior. Use with caution."
     }
     
-    # If we use clang and +nofortran is not set, seek a fortran compiler
-    if {![info exists gccnumber] && ![variant_isset nofortran]} {
+    if {[info exists use_clang] && ![variant_isset nofortran]} {
 
         set gflist                  [glob -noc ${prefix}/bin/gfortran-mp-4.*]
         
@@ -360,6 +376,7 @@
         }
     }
 
+    # If we use gcc, then select the corresponding gfortran compiler
     if {[info exists gccnumber] && ![variant_isset nofortran]} {
         configure.args-append       -C if ${configure.f77}
         configure.args-append       -Ss f77lib ${prefix}/lib/gcc${gccnumber}
@@ -393,7 +410,7 @@
     }
 
     foreach arch ${archs} {
-        if { ! [variant_isset universal] } {
+        if {![variant_isset universal]} {
             set    atlas_path ${workpath}/${name}-${version}
         } else {
             set    atlas_path ${workpath}/${name}-${version}-${arch}
@@ -427,7 +444,7 @@
             set     atlas_path ${workpath}/${name}-${version}-${arch}
         }
 
-        # recursively remove directories
+        # Recursively remove directories
         ui_debug    "patch to recursively remove directories on clean"
         reinplace    "s|rm -f|rm -rf|g" ${atlas_path}/build/Makefile
         
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120520/5056d977/attachment-0001.html>


More information about the macports-changes mailing list