diff --git a/math/OpenBLAS/Portfile b/math/OpenBLAS/Portfile
index 8388fd3aeb..1ef520b33e 100644
a
|
b
|
checksums rmd160 11f85eb4bb382e10298ac40d1e1fd4ecc46bb3da \ |
45 | 45 | |
46 | 46 | } |
47 | 47 | |
48 | | variant gcc45 conflicts gcc46 gcc47 gcc48 gcc49 gcc5 gcc6 clang \ |
49 | | description "Use Gcc45 as compiler" { |
50 | | configure.compiler macports-gcc-4.5 |
51 | | } |
| 48 | # declare +clang variant |
| 49 | |
| 50 | variant clang description "Use Clang as C/C++ compiler (required for AVX)" {} |
52 | 51 | |
53 | | variant gcc46 conflicts gcc45 gcc47 gcc48 gcc49 gcc5 gcc6 clang \ |
54 | | description "Use Gcc46 as compiler" { |
55 | | configure.compiler macports-gcc-4.6 |
| 52 | # default to +clang if the processor has avx instructions |
| 53 | if {![catch {sysctl hw.optional.avx1_0} has_avx] && $has_avx == 1 && |
| 54 | ![variant_isset clang]} { |
| 55 | default_variants +clang |
56 | 56 | } |
57 | 57 | |
58 | | variant gcc47 conflicts gcc45 gcc46 gcc48 gcc49 gcc5 gcc6 clang \ |
59 | | description "Use Gcc47 as compiler" { |
60 | | configure.compiler macports-gcc-4.7 |
| 58 | # it is OK to use -clang, so don't check for that condition here |
| 59 | |
| 60 | # declare +gcc* variants |
| 61 | |
| 62 | set GCC_VERSIONS_NO_DOT {45 46 47 48 49 5 6 7} |
| 63 | |
| 64 | foreach this_gcc_version_no_dot ${GCC_VERSIONS_NO_DOT} { |
| 65 | set ndx [lsearch -exact ${this_gcc_version_no_dot} ${this_gcc_version_no_dot}] |
| 66 | set this_conflicts [lreplace ${this_gcc_version_no_dot} ${ndx} ${ndx}] |
| 67 | if {[variant_isset clang]} { |
| 68 | set this_description "Use gcc${this_gcc_version_no_dot} as Fortran compiler" |
| 69 | } else { |
| 70 | set this_description "Use gcc${this_gcc_version_no_dot} for the compiler suite" |
| 71 | } |
| 72 | eval [subst { |
| 73 | variant gcc${this_gcc_version_no_dot} \ |
| 74 | conflicts ${this_conflicts} \ |
| 75 | description ${this_description} {} |
| 76 | }] |
61 | 77 | } |
62 | 78 | |
63 | | variant gcc48 conflicts gcc45 gcc46 gcc47 gcc49 gcc5 gcc6 clang \ |
64 | | description "Use Gcc48 as compiler" { |
65 | | configure.compiler macports-gcc-4.8 |
| 79 | # set default +gcc* variant: default to +gcc6 if not other +gcc* |
| 80 | # variant is selected. this variant is used for Fortran, no matter |
| 81 | # whether +clang is selected or not. if +clang is not selected or |
| 82 | # -clang is selected, then use the selected +gcc* variant for the |
| 83 | # compiler suite. |
| 84 | |
| 85 | set GCC_VER_NO_DOT 0 |
| 86 | foreach this_gcc_version_no_dot ${GCC_VERSIONS_NO_DOT} { |
| 87 | if {[variant_isset gcc${this_gcc_version_no_dot}]} { |
| 88 | set GCC_VER_NO_DOT ${this_gcc_version_no_dot} |
| 89 | break |
| 90 | } |
66 | 91 | } |
67 | 92 | |
68 | | variant gcc49 conflicts gcc45 gcc46 gcc47 gcc48 gcc5 gcc6 clang \ |
69 | | description "Use Gcc49 as compiler" { |
70 | | configure.compiler macports-gcc-4.9 |
| 93 | if {${GCC_VER_NO_DOT} == 0} { |
| 94 | default_variants +gcc6 |
71 | 95 | } |
72 | 96 | |
73 | | variant gcc5 conflicts gcc45 gcc46 gcc47 gcc48 gcc49 gcc6 clang \ |
74 | | description "Use Gcc5 as compiler" { |
75 | | configure.compiler macports-gcc-5 |
| 97 | # make sure -gcc6 was not selected alone |
| 98 | |
| 99 | set GCC_VER_NO_DOT 0 |
| 100 | foreach this_gcc_version_no_dot ${GCC_VERSIONS_NO_DOT} { |
| 101 | if {[variant_isset gcc${this_gcc_version_no_dot}]} { |
| 102 | set GCC_VER_NO_DOT ${this_gcc_version_no_dot} |
| 103 | break |
| 104 | } |
76 | 105 | } |
77 | 106 | |
78 | | variant gcc6 conflicts gcc45 gcc46 gcc47 gcc48 gcc49 gcc5 clang \ |
79 | | description "Use Gcc6 as compiler" { |
80 | | configure.compiler macports-gcc-6 |
| 107 | if {${GCC_VER_NO_DOT} == 0} { |
| 108 | ui_error "\n\nYou must select a Fortran compiler variant; you cannot select -gcc6 alone.\n" |
| 109 | return -code error "Invalid variant selection." |
81 | 110 | } |
82 | 111 | |
83 | | variant clang conflicts gcc45 gcc46 gcc47 gcc48 gcc49 gcc5 gcc6 \ |
84 | | description "Use Clang as compiler" { |
| 112 | set GCC_VER_DOT [join [split ${GCC_VER_NO_DOT} ""] "."] |
| 113 | |
| 114 | # set compilers to use |
| 115 | |
| 116 | if {[variant_isset clang]} { |
| 117 | |
| 118 | # use selected +gcc* for Fortran only |
| 119 | depends_build-append port:gcc${GCC_VER_NO_DOT} |
| 120 | configure.fc ${prefix}/bin/gfortran-mp-${GCC_VER_DOT} |
| 121 | |
85 | 122 | if {[vercmp $xcodeversion 5.0] >= 0} { |
86 | 123 | configure.compiler clang |
87 | 124 | } else { |
… |
… |
variant clang conflicts gcc45 gcc46 gcc47 gcc48 gcc49 gcc5 gcc6 \ |
94 | 131 | configure.compiler macports-clang-3.4 |
95 | 132 | } |
96 | 133 | } |
97 | | depends_build-append port:gcc5 |
98 | | configure.fc ${prefix}/bin/gfortran-mp-5 |
| 134 | } else { |
99 | 135 | |
100 | | } |
| 136 | # use selected +gcc* for the whole compiler suite |
| 137 | configure.compiler macports-gcc-${GCC_VER_DOT} |
101 | 138 | |
102 | | if {![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc47] && \ |
103 | | ![variant_isset gcc48] && ![variant_isset gcc49] && ![variant_isset gcc5] && \ |
104 | | ![variant_isset gcc6] && ![variant_isset clang]} { |
105 | | if { ![catch {sysctl hw.optional.avx1_0} has_avx] && $has_avx == 1 } { |
106 | | #Use clang if the processor has avx instructions |
107 | | default_variants +clang |
108 | | } else { |
109 | | #Else, use gcc5 as default |
110 | | default_variants +gcc5 |
111 | | } |
112 | 139 | } |
113 | 140 | |
114 | 141 | variant lapack description "Add Lapack/CLapack support to the library" { } |