summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/tioga/package.py
blob: 89ea1923e642a8adf57c67bdc8ac86a72860b8ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *


class Tioga(CMakePackage):
    """Topology Independent Overset Grid Assembly (TIOGA)"""

    homepage = "https://github.com/jsitaraman/tioga"
    git      = "https://github.com/jsitaraman/tioga.git"

    # The master branch doesn't support CMake
    version('develop', branch='nalu-api')

    variant('shared', default=True,
            description="Enable building shared libraries")
    variant('pic', default=True,
            description="Position independent code")

    depends_on('mpi')

    # Tioga has the fortran module file problem with parallel builds
    parallel = False

    def cmake_args(self):
        spec = self.spec

        options = [
            '-DBUILD_SHARED_LIBS:BOOL=%s' % (
                'ON' if '+shared' in spec else 'OFF'),
            '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=%s' % (
                'ON' if '+pic' in spec else 'OFF'),
            '-DMPI_CXX_COMPILER:PATH=%s' % spec['mpi'].mpicxx,
            '-DMPI_C_COMPILER:PATH=%s' % spec['mpi'].mpicc,
            '-DMPI_Fortran_COMPILER:PATH=%s' % spec['mpi'].mpifc
        ]

        return options