Update OpenFAST package file (#33438)
* Update OpenFAST package file. * Add comment.
This commit is contained in:
parent
69e66f57a9
commit
cd015b8498
1 changed files with 24 additions and 17 deletions
|
@ -16,6 +16,8 @@ class Openfast(CMakePackage):
|
|||
|
||||
version("develop", branch="dev")
|
||||
version("master", branch="main")
|
||||
version("3.2.1", tag="v3.2.1")
|
||||
version("3.2.0", tag="v3.2.0")
|
||||
version("3.1.0", tag="v3.1.0")
|
||||
version("3.0.0", tag="v3.0.0")
|
||||
version("2.6.0", tag="v2.6.0")
|
||||
|
@ -33,6 +35,7 @@ class Openfast(CMakePackage):
|
|||
variant("cxx", default=False, description="Enable C++ bindings")
|
||||
variant("pic", default=True, description="Position independent code")
|
||||
variant("openmp", default=False, description="Enable OpenMP support")
|
||||
variant("netcdf", default=False, description="Enable NetCDF support")
|
||||
|
||||
# Dependencies for OpenFAST Fortran
|
||||
depends_on("blas")
|
||||
|
@ -44,6 +47,7 @@ class Openfast(CMakePackage):
|
|||
depends_on("hdf5+mpi+cxx+hl", when="+cxx")
|
||||
depends_on("zlib", when="+cxx")
|
||||
depends_on("libxml2", when="+cxx")
|
||||
depends_on("netcdf-c", when="+netcdf")
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
|
@ -52,8 +56,8 @@ def cmake_args(self):
|
|||
|
||||
options.extend(
|
||||
[
|
||||
"-DBUILD_DOCUMENTATION:BOOL=OFF",
|
||||
"-DBUILD_TESTING:BOOL=OFF",
|
||||
define("BUILD_DOCUMENTATION", False),
|
||||
define("BUILD_TESTING", False),
|
||||
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
|
||||
self.define_from_variant("DOUBLE_PRECISION", "double-precision"),
|
||||
self.define_from_variant("USE_DLL_INTERFACE", "dll-interface"),
|
||||
|
@ -66,42 +70,45 @@ def cmake_args(self):
|
|||
blas_libs = spec["lapack"].libs + spec["blas"].libs
|
||||
options.extend(
|
||||
[
|
||||
"-DBLAS_LIBRARIES=%s" % blas_libs.joined(";"),
|
||||
"-DLAPACK_LIBRARIES=%s" % blas_libs.joined(";"),
|
||||
define("BLAS_LIBRARIES", blas_libs.joined(";")),
|
||||
define("LAPACK_LIBRARIES", blas_libs.joined(";")),
|
||||
]
|
||||
)
|
||||
|
||||
if "+cxx" in spec:
|
||||
options.extend(
|
||||
[
|
||||
"-DCMAKE_C_COMPILER=%s" % spec["mpi"].mpicc,
|
||||
"-DCMAKE_CXX_COMPILER=%s" % spec["mpi"].mpicxx,
|
||||
"-DCMAKE_Fortran_COMPILER=%s" % spec["mpi"].mpifc,
|
||||
"-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,
|
||||
define("CMAKE_CXX_COMPILER", spec["mpi"].mpicxx),
|
||||
define("CMAKE_C_COMPILER", spec["mpi"].mpicc),
|
||||
define("CMAKE_Fortran_COMPILER", spec["mpi"].mpifc),
|
||||
define("MPI_CXX_COMPILER", spec["mpi"].mpicxx),
|
||||
define("MPI_C_COMPILER", spec["mpi"].mpicc),
|
||||
define("MPI_Fortran_COMPILER", spec["mpi"].mpifc),
|
||||
define("HDF5_ROOT", spec["hdf5"].prefix),
|
||||
define("YAML_ROOT", spec["yaml"].prefix),
|
||||
define("NETCDF_ROOT", spec["netcdf-c"].prefix),
|
||||
# The following xpects that HDF5 was built with CMake.
|
||||
# Solves issue with OpenFAST trying to link
|
||||
# to HDF5 libraries with a "-shared" prefix
|
||||
# that do not exist.
|
||||
define("HDF5_NO_FIND_PACKAGE_CONFIG_FILE", True),
|
||||
]
|
||||
)
|
||||
|
||||
if "~shared" in spec:
|
||||
options.extend(
|
||||
[
|
||||
"-DHDF5_USE_STATIC_LIBRARIES=ON",
|
||||
define("HDF5_USE_STATIC_LIBRARIES", True),
|
||||
]
|
||||
)
|
||||
|
||||
if "+openmp" in spec:
|
||||
options.extend(
|
||||
[
|
||||
"-DOPENMP:BOOL=ON",
|
||||
define("OPENMP", True),
|
||||
]
|
||||
)
|
||||
|
||||
if "darwin" in spec.architecture:
|
||||
options.append("-DCMAKE_MACOSX_RPATH:BOOL=ON")
|
||||
|
||||
return options
|
||||
|
||||
def flag_handler(self, name, flags):
|
||||
|
|
Loading…
Reference in a new issue