source: trunk/dports/_resources/port1.0/group/linear_algebra-1.0.tcl @ 148843

Last change on this file since 148843 was 148843, checked in by dstrubbe@…, 3 years ago

linear_algebra port group: Proc to set that only blacs is being used.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: linear_algebra-1.0.tcl 148843 2016-05-19 22:02:38Z dstrubbe@macports.org $
3#
4# Copyright (c) 2016 The MacPorts Project
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are
9# met:
10#
11# 1. Redistributions of source code must retain the above copyright
12#    notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright
14#    notice, this list of conditions and the following disclaimer in the
15#    documentation and/or other materials provided with the distribution.
16# 3. Neither the name of The MacPorts Project nor the names of its
17#    contributors may be used to endorse or promote products derived from
18#    this software without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31#
32#
33# This PortGroup sets up variants for serial linear algebra (Accelerate/ATLAS/OpenBLAS/OpenBLAS-devel).
34#
35# Usage:
36#
37#   PortGroup               linear_algebra 1.0
38#
39#   If only BLAS and not LAPACK is used, set:
40#   linalg.setup blas_only
41#
42#   in pre-configure, a line like this may be needed:
43#   configure.args-append --with-blas="-L${prefix}/lib ${linalglib}"
44#
45#   If +threads and +atlas are set, the threaded ATLAS library will be used.
46#
47
48# scalapack.
49# vecLibFort only needed if calling Accelerate from Fortran.
50# enforcing +lapack for OpenBLAS can be optional.
51
52PortGroup active_variants 1.1
53
54default linalglib ""
55default blas_only 0
56
57proc linalg.setup {args} {
58    global blas_only
59
60    foreach v $args {
61        if {$v == "blas_only"} {
62            ui_msg "arg = $v"
63            set blas_only 1
64        }
65    }
66}
67
68if {![variant_isset accelerate] && ![variant_isset atlas] && ![variant_isset openblas]} {
69    default_variants-append +accelerate
70}
71
72# choose one of the following for serial linear algebra
73variant accelerate conflicts atlas openblas description {Build with linear algebra from built-in Accelerate framework} {
74    depends_lib-append      port:vecLibFort
75    set linalglib           -lvecLibFort
76}
77
78variant atlas conflicts accelerate openblas description {Build with linear algebra from ATLAS} {
79    depends_lib-append      port:atlas
80    if {[variant_isset threads]} {
81        set linalglib       -ltatlas
82    } else {
83        set linalglib       -lsatlas
84    }
85}
86
87variant openblas conflicts accelerate atlas description {Build with linear algebra from OpenBLAS} {
88    # allow OpenBLAS-devel too
89    depends_lib-append      path:lib/libopenblas.dylib:OpenBLAS
90    if {$blas_only == 0} {
91        require_active_variants path:lib/libopenblas.dylib:OpenBLAS lapack
92    }
93    set linalglib           -lopenblas
94}
Note: See TracBrowser for help on using the repository browser.