Ticket #41554: Portfile-gsl-optimize-2.diff

File Portfile-gsl-optimize-2.diff, 3.2 KB (added by daitakahashi, 11 years ago)
  • Portfile

     
    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)" {
    84     configure.cflags-append     "-ftree-vectorize -O3"
     88    configure.cflags-append     "-O3"
    8589}
    8690
    8791platform darwin i386 {
    8892    if { [variant_isset optimize] } {
    89         if { [variant_isset gcc43] } {
     93        if { [variant_isset mpclang33] } {
    9094            configure.cflags-append "-march=native"
    91         } elseif { [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47] } {
     95        } elseif { [variant_isset gcc43] } {
     96            configure.cflags-append "-ftree-vectorize -march=native"
     97        } elseif { [variant_isset gcc44] || [variant_isset gcc45] ||
     98                   [variant_isset gcc46] || [variant_isset gcc47] } {
    9299            # Currently, gcc cannot compile AVX instructions on OSX
    93             configure.cflags-append "-march=native -mno-avx"
     100            configure.cflags-append "-ftree-vectorize -march=native -mno-avx"
     101        } else {
     102            #Default compiler. Check if the compiler supports "native" architecture
     103            if { [string match "clang" ${configure.compiler}] } {
     104                configure.cflags-append "-march=native"
     105            }
    94106        }
    95107    }
    96108}