Ticket #41554: Portfile-gsl-optimize.diff

File Portfile-gsl-optimize.diff, 3.1 KB (added by NicosPavlov, 11 years ago)

Add cflags also for default compiler

  • Portfile

    old new  
    5656    }
    5757}
    5858
    59 variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 description "Use GCC 4.3 for compilation of GSL" {
     59variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 mpclang33 description "Use GCC 4.3 for compilation of GSL" {
    6060    configure.compiler          macports-gcc-4.3
    6161}
    6262
    63 variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 gcc48 description "Use GCC 4.4 for compilation of GSL" {
     63variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 gcc48 mpclang33 description "Use GCC 4.4 for compilation of GSL" {
    6464    configure.compiler          macports-gcc-4.4
    6565}
    6666
    67 variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 gcc48 description "Use GCC 4.5 for compilation of GSL" {
     67variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 gcc48 mpclang33 description "Use GCC 4.5 for compilation of GSL" {
    6868    configure.compiler          macports-gcc-4.5
    6969}
    7070
    71 variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 gcc48 description "Use GCC 4.6 for compilation of GSL" {
     71variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 gcc48 mpclang33 description "Use GCC 4.6 for compilation of GSL" {
    7272    configure.compiler          macports-gcc-4.6
    7373}
    7474
    75 variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 gcc48 description "Use GCC 4.7 for compilation of GSL" {
     75variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 gcc48 mpclang33 description "Use GCC 4.7 for compilation of GSL" {
    7676    configure.compiler          macports-gcc-4.7
    7777}
    7878
    79 variant gcc48 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 description "Use GCC 4.8 for compilation of GSL" {
     79variant gcc48 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 mpclang33 description "Use GCC 4.8 for compilation of GSL" {
    8080    configure.compiler          macports-gcc-4.8
    8181}
    8282
     83variant mpclang33 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 description "Use clang 3.3 for compilation of GSL" {
     84    configure.compiler          macports-clang-3.3
     85}
     86
    8387variant optimize description "Provide further optimization options (depending on compiler used)" {
    8488    configure.cflags-append     "-ftree-vectorize -O3"
    8589}
    8690
    8791platform darwin i386 {
    8892    if { [variant_isset optimize] } {
    89         if { [variant_isset gcc43] } {
     93        if { [variant_isset mpclang33] } {
     94            configure.cflags-append "-march=native"
     95        } elseif { [variant_isset gcc43] } {
    9096            configure.cflags-append "-march=native"
    91         } elseif { [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47] } {
     97        } elseif { [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] ||
     98                   [variant_isset gcc47] || [variant_isset gcc48] } {
    9299            # Currently, gcc cannot compile AVX instructions on OSX
    93100            configure.cflags-append "-march=native -mno-avx"
     101        } else {
     102            #Default compiler. Check if clang is new enough
     103            if { [string match "clang" ${configure.compiler}] &&
     104                 [vercmp $xcodeversion 5.0] >= 0 } {
     105                configure.cflags-append "-march=native"
     106            } else {
     107                configure.cflags-append "-march=native -mnoavx"
     108            }
    94109        }
    95110    }
    96111}