Changeset 143304 for trunk/dports/math


Ignore:
Timestamp:
Dec 10, 2015, 3:15:59 AM (4 years ago)
Author:
dstrubbe@…
Message:

itsol: Use compilers portgroup for Fortran variants.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/math/itsol/Portfile

    r143303 r143304  
    44PortSystem          1.0
    55PortGroup           muniversal 1.0
     6PortGroup           compilers 1.0
    67
    78name                itsol
     
    3940                    patch-TESTS-matfile.diff
    4041
    41 depends_lib         path:lib/libgcc/libgcc_s.1.dylib:libgcc
    42 
    43 #########################
    44 # set up fortran variants
    45 
    46 set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
    47 set gcc_default "4.8"
    48 
    49 # create g95 variant, with full conflicts of GCC versions
    50 
    51 set gcc_conflicts ""
    52 foreach ver ${gcc_versions} {
    53     set gcc_ver_no_dot gcc[join [split ${ver} "."] ""]
    54     set gcc_conflicts "${gcc_conflicts} ${gcc_ver_no_dot}"
    55 }
     42compilers.choose    fc
     43compilers.setup     require_fortran
    5644
    5745# atlas does not provide a +g95 variant, so if +g95 is used,
     
    6149# it out does work, so doing that and checking for this condition
    6250# later, for now.
    63 
    64 eval [subst {
    65     variant g95 conflicts ${gcc_conflicts} \
    66         description "Build with MacPorts g95 as the Fortran Compiler" {
    67             depends_build-append port:g95
    68             configure.fc ${prefix}/bin/g95
    69         }
    70 }]
    71 
    72 # create GCC variants, with partial conflicts of other GCC versions
    73 
    74 foreach ver1 ${gcc_versions} {
    75 
    76     set gcc_ver1_no_dot gcc[join [split ${ver1} "."] ""]
    77 
    78     set gcc_conflicts "conflicts g95"
    79     foreach ver2 ${gcc_versions} {
    80         if {${ver1} == ${ver2}} {
    81             continue
    82         }
    83         set gcc_ver2_no_dot gcc[join [split ${ver2} "."] ""]
    84         set gcc_conflicts "${gcc_conflicts} ${gcc_ver2_no_dot}"
    85     }
    86 
    87     eval [subst {
    88         variant ${gcc_ver1_no_dot} ${gcc_conflicts} \
    89             description {Build with the MacPorts ${gcc_ver1_no_dot} as the Fortran Compiler} {
    90                 depends_build-append port:${gcc_ver1_no_dot}
    91                 configure.fc ${prefix}/bin/gfortran-mp-${ver1}
    92             }
    93     }]
    94 }
    9551
    9652######################
     
    11066##################
    11167# variant checking
    112 
    113 set gcc_default_no_dot gcc[join [split ${gcc_default} "."] ""]
    114 
    115 set fortran_variant_selection ""
    116 if {[variant_isset g95]} {
    117     set fortran_variant_selection "g95"
    118 } else {
    119     foreach ver ${gcc_versions} {
    120         set gcc_ver_no_dot gcc[join [split ${ver} "."] ""]
    121         if {[variant_isset ${gcc_ver_no_dot}]} {
    122             set fortran_variant_selection "${gcc_ver_no_dot}"
    123         }
    124     }
    125 }
    126 
    127 if {${fortran_variant_selection} eq ""} {
    128     default_variants +${gcc_default_no_dot}
    129 
    130     # check for -${gcc_default_no_dot} alone
    131 
    132     set fortran_variant_selection ""
    133     if {[variant_isset g95]} {
    134         set fortran_variant_selection "g95"
    135     } else {
    136         foreach ver ${gcc_versions} {
    137             set gcc_ver_no_dot gcc[join [split ${ver} "."] ""]
    138             if {[variant_isset ${gcc_ver_no_dot}]} {
    139                 set fortran_variant_selection "${gcc_ver_no_dot}"
    140             }
    141         }
    142     }
    143 
    144     if {${fortran_variant_selection} eq ""} {
    145         ui_error "\n\nYou cannot use the -${gcc_default_no_dot} variant alone; a Fortran compiler is required.\n"
    146         return -code error "Invalid variant selection"
    147 s    }
    148 }
    14968
    15069# check for BLAS default variant, use +atlas if nothing else
Note: See TracChangeset for help on using the changeset viewer.