Commit request: add mpclang33 variants, disable universal build for gcc variants

Daisuke Takahashi dtakahashi42 at gmail.com
Sat Oct 12 15:29:21 PDT 2013


Hi all,

To improve the gsl port, I would like to submit my patch on the Portfile. Could you please review it and please commit it if the patch is acceptable?

The patch contains two fixes. Firstly, I added a new variant "mpclang33", which enables the compilation using the newest released version of llvm/clang.
Secondly, I added an "universal" to the conflicting-variants list of all gcc variants (gcc43, gcc44, gcc45, gcc46, gcc47, and gcc48). In my understanding, gcc does not understand the multiple -arch flags correctly, and it is better to warn users about the unexpected result.
Although I disables the universal build for those variants, still users can use the system's clang (default) and the new variant "mpclang33" to get universal binary of gsl.

Thank you very much.


Daisuke Takahashi

--- Portfile	(revision 112138)
+++ Portfile	(working copy)
@@ -56,41 +56,47 @@
     }
 }
 
-variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 description "Use GCC 4.3 for compilation of GSL" {
+variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 mpclang33 universal description "Use GCC 4.3 for compilation of GSL" {
     configure.compiler          macports-gcc-4.3
 }
 
-variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 gcc48 description "Use GCC 4.4 for compilation of GSL" {
+variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 gcc48 mpclang33 universal description "Use GCC 4.4 for compilation of GSL" {
     configure.compiler          macports-gcc-4.4
 }
 
-variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 gcc48 description "Use GCC 4.5 for compilation of GSL" {
+variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 gcc48 mpclang33 universal description "Use GCC 4.5 for compilation of GSL" {
     configure.compiler          macports-gcc-4.5
 }
 
-variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 gcc48 description "Use GCC 4.6 for compilation of GSL" {
+variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 gcc48 mpclang33 universal description "Use GCC 4.6 for compilation of GSL" {
     configure.compiler          macports-gcc-4.6
 }
 
-variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 gcc48 description "Use GCC 4.7 for compilation of GSL" {
+variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 gcc48 mpclang33 universal description "Use GCC 4.7 for compilation of GSL" {
     configure.compiler          macports-gcc-4.7
 }
 
-variant gcc48 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 description "Use GCC 4.8 for compilation of GSL" {
+variant gcc48 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 mpclang33 universal description "Use GCC 4.8 for compilation of GSL" {
     configure.compiler          macports-gcc-4.8
 }
 
+variant mpclang33 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 description "Use clang 3.3 for compilation of GSL" {
+    configure.compiler          macports-clang-3.3
+}
+
 variant optimize description "Provide further optimization options (depending on compiler used)" {
-    configure.cflags-append     "-ftree-vectorize -O3"
+    configure.cflags-append     "-O3"
 }
 
 platform darwin i386 {
     if { [variant_isset optimize] } {
         if { [variant_isset gcc43] } {
+            configure.cflags-append "-ftree-vectorize -march=native"
+        } elseif { [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47] || [variant_iiset gcc48] } {
+            # Currently, gcc cannot compile AVX instructions on OSX
+            configure.cflags-append "-ftree-vectorize -march=native -mno-avx"
+        } elseif { [variant_isset mpclang33] } {
             configure.cflags-append "-march=native"
-        } elseif { [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47] } {
-            # Currently, gcc cannot compile AVX instructions on OSX
-            configure.cflags-append "-march=native -mno-avx"
         }
     }
 }



More information about the macports-dev mailing list