Changeset 143309


Ignore:
Timestamp:
Dec 10, 2015, 4:45:29 PM (4 years ago)
Author:
dstrubbe@…
Message:

shogun: Use compilers portgroup for Fortran.

File:
1 edited

Legend:

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

    r142558 r143309  
    33
    44PortSystem          1.0
     5PortGroup           compilers 1.0
    56
    67name                shogun
     
    1617maintainers         nomaintainer
    1718
    18 description         The machine learning toolbox's focus is on large scale \
     19description         The machine-learning toolbox's focus is on large-scale \
    1920                    kernel methods
    2021
     
    4243depends_build-append port:pkgconfig
    4344
     45# FIXME: enable use of OpenBLAS(-devel) and Accelerate/vecLibFort?
    4446depends_lib-append  port:hdf5 \
    4547                    port:json-c \
     
    6567}
    6668
    67 # Define compilers variants
    68 configure.args-append   --ldflags=-lgfortran
    69 configure.env-append    POSTLINKFLAGS="-L${prefix}/lib/gcc47"
    70 
    71 set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
    72 set default_fortran_variant +gcc48
    73 
    74 foreach ver ${gcc_versions} {
    75     set ver_no_dot [join [split ${ver} "."] ""]
    76 
    77     set variant_line {variant gcc${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}"}
    78 
    79     foreach over ${gcc_versions} {
    80         if {${ver} == ${over}} {
    81             continue
    82         }
    83 
    84         set over_no_dot [join [split ${over} "."] ""]
    85         append variant_line " conflicts gcc${over_no_dot}"
    86     }
    87     append variant_line { {}}
    88 
    89     eval $variant_line
    90 
    91     if {[variant_isset gcc${ver_no_dot}]} {
    92         if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
    93             set default_fortran_variant ""
    94         }
    95     }
    96 }
    97 
    98 if {${default_fortran_variant} != ""} {
    99     default_variants "${default_fortran_variant}"
    100 }
    101 
    102 foreach ver ${gcc_versions} {
    103     set ver_no_dot [join [split ${ver} "."] ""]
    104 
    105     if {[variant_isset gcc${ver_no_dot}]} {
    106         depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
    107         depends_build-append port:gcc${ver_no_dot}
    108 
    109         configure.fc  ${prefix}/bin/gfortran-mp-${ver}
    110         configure.f77 ${prefix}/bin/gfortran-mp-${ver}
    111         configure.f90 ${prefix}/bin/gfortran-mp-${ver}
    112     }
    113 }
     69compilers.choose   fc f77 f90
     70compilers.setup    require_fortran
     71pre-configure {
     72    configure.args-append   --ldflags=${compilers.libfortran}
     73}
     74
     75# These compiler warnings appear:
     76#clang: warning: argument unused during compilation: '-mcpu=native'
     77#clang: warning: argument unused during compilation: '-pthread'
     78#ld: warning: directory not found for option '-L../libshogun'
     79#ld: warning: directory not found for option '-LDYLD_LIBRARY_PATH'
    11480
    11581# Define python variants
Note: See TracChangeset for help on using the changeset viewer.