summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/openfast/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/openfast/package.py')
-rw-r--r--var/spack/repos/builtin/packages/openfast/package.py55
1 files changed, 23 insertions, 32 deletions
diff --git a/var/spack/repos/builtin/packages/openfast/package.py b/var/spack/repos/builtin/packages/openfast/package.py
index 74d1881de9..14824588db 100644
--- a/var/spack/repos/builtin/packages/openfast/package.py
+++ b/var/spack/repos/builtin/packages/openfast/package.py
@@ -1,27 +1,8 @@
-##############################################################################
-# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
-# Produced at the Lawrence Livermore National Laboratory.
+# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
-# This file is part of Spack.
-# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
-# LLNL-CODE-647188
-#
-# For details, see https://github.com/spack/spack
-# Please also see the LICENSE file for our notice and the LGPL.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License (as
-# published by the Free Software Foundation) version 2.1, February 1999.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
-# conditions of the GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##############################################################################
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
from spack import *
@@ -29,18 +10,14 @@ class Openfast(CMakePackage):
"""Wind turbine simulation package from NREL"""
homepage = "http://openfast.readthedocs.io/en/latest/"
- url = "https://github.com/OpenFAST/openfast.git"
+ git = "https://github.com/OpenFAST/openfast.git"
maintainers = ['jrood-nrel']
- version('develop',
- git='https://github.com/OpenFAST/openfast.git',
- branch='dev')
- version('master',
- git='https://github.com/OpenFAST/openfast.git',
- branch='master')
+ version('develop', branch='dev')
+ version('master', branch='master')
- variant('shared', default=False,
+ variant('shared', default=True,
description="Build shared libraries")
variant('double-precision', default=True,
description="Treat REAL as double precision")
@@ -48,6 +25,8 @@ class Openfast(CMakePackage):
description="Enable dynamic library loading interface")
variant('cxx', default=False,
description="Enable C++ bindings")
+ variant('pic', default=True,
+ description="Position independent code")
# Dependencies for OpenFAST Fortran
depends_on('blas')
@@ -56,7 +35,7 @@ class Openfast(CMakePackage):
# Additional dependencies when compiling C++ library
depends_on('mpi', when='+cxx')
depends_on('yaml-cpp', when='+cxx')
- depends_on('hdf5+mpi+cxx', when='+cxx')
+ depends_on('hdf5+mpi+cxx+hl', when='+cxx')
depends_on('zlib', when='+cxx')
depends_on('libxml2', when='+cxx')
@@ -77,10 +56,22 @@ class Openfast(CMakePackage):
'ON' if '+dll-interface' in spec else 'OFF'),
'-DBUILD_FAST_CPP_API:BOOL=%s' % (
'ON' if '+cxx' in spec else 'OFF'),
+ '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=%s' % (
+ 'ON' if '+pic' in spec else 'OFF'),
+ ])
+
+ # Make sure we use Spack's blas/lapack:
+ blas_libs = spec['lapack'].libs + spec['blas'].libs
+ options.extend([
+ '-DBLAS_LIBRARIES=%s' % blas_libs.joined(';'),
+ '-DLAPACK_LIBRARIES=%s' % blas_libs.joined(';')
])
if '+cxx' in spec:
options.extend([
+ '-DMPI_CXX_COMPILER:PATH=%s' % spec['mpi'].mpicxx,
+ '-DMPI_C_COMPILER:PATH=%s' % spec['mpi'].mpicc,
+ '-DMPI_Fortran_COMPILER:PATH=%s' % spec['mpi'].mpifc,
'-DHDF5_ROOT:PATH=%s' % spec['hdf5'].prefix,
'-DYAML_ROOT:PATH=%s' % spec['yaml-cpp'].prefix,
])