Update OpenFAST package file (#33438)
* Update OpenFAST package file. * Add comment.
This commit is contained in:
parent
69e66f57a9
commit
cd015b8498
@ -16,6 +16,8 @@ class Openfast(CMakePackage):
|
|||||||
|
|
||||||
version("develop", branch="dev")
|
version("develop", branch="dev")
|
||||||
version("master", branch="main")
|
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.1.0", tag="v3.1.0")
|
||||||
version("3.0.0", tag="v3.0.0")
|
version("3.0.0", tag="v3.0.0")
|
||||||
version("2.6.0", tag="v2.6.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("cxx", default=False, description="Enable C++ bindings")
|
||||||
variant("pic", default=True, description="Position independent code")
|
variant("pic", default=True, description="Position independent code")
|
||||||
variant("openmp", default=False, description="Enable OpenMP support")
|
variant("openmp", default=False, description="Enable OpenMP support")
|
||||||
|
variant("netcdf", default=False, description="Enable NetCDF support")
|
||||||
|
|
||||||
# Dependencies for OpenFAST Fortran
|
# Dependencies for OpenFAST Fortran
|
||||||
depends_on("blas")
|
depends_on("blas")
|
||||||
@ -44,6 +47,7 @@ class Openfast(CMakePackage):
|
|||||||
depends_on("hdf5+mpi+cxx+hl", when="+cxx")
|
depends_on("hdf5+mpi+cxx+hl", when="+cxx")
|
||||||
depends_on("zlib", when="+cxx")
|
depends_on("zlib", when="+cxx")
|
||||||
depends_on("libxml2", when="+cxx")
|
depends_on("libxml2", when="+cxx")
|
||||||
|
depends_on("netcdf-c", when="+netcdf")
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
@ -52,8 +56,8 @@ def cmake_args(self):
|
|||||||
|
|
||||||
options.extend(
|
options.extend(
|
||||||
[
|
[
|
||||||
"-DBUILD_DOCUMENTATION:BOOL=OFF",
|
define("BUILD_DOCUMENTATION", False),
|
||||||
"-DBUILD_TESTING:BOOL=OFF",
|
define("BUILD_TESTING", False),
|
||||||
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
|
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
|
||||||
self.define_from_variant("DOUBLE_PRECISION", "double-precision"),
|
self.define_from_variant("DOUBLE_PRECISION", "double-precision"),
|
||||||
self.define_from_variant("USE_DLL_INTERFACE", "dll-interface"),
|
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
|
blas_libs = spec["lapack"].libs + spec["blas"].libs
|
||||||
options.extend(
|
options.extend(
|
||||||
[
|
[
|
||||||
"-DBLAS_LIBRARIES=%s" % blas_libs.joined(";"),
|
define("BLAS_LIBRARIES", blas_libs.joined(";")),
|
||||||
"-DLAPACK_LIBRARIES=%s" % blas_libs.joined(";"),
|
define("LAPACK_LIBRARIES", blas_libs.joined(";")),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
if "+cxx" in spec:
|
if "+cxx" in spec:
|
||||||
options.extend(
|
options.extend(
|
||||||
[
|
[
|
||||||
"-DCMAKE_C_COMPILER=%s" % spec["mpi"].mpicc,
|
define("CMAKE_CXX_COMPILER", spec["mpi"].mpicxx),
|
||||||
"-DCMAKE_CXX_COMPILER=%s" % spec["mpi"].mpicxx,
|
define("CMAKE_C_COMPILER", spec["mpi"].mpicc),
|
||||||
"-DCMAKE_Fortran_COMPILER=%s" % spec["mpi"].mpifc,
|
define("CMAKE_Fortran_COMPILER", spec["mpi"].mpifc),
|
||||||
"-DMPI_CXX_COMPILER:PATH=%s" % spec["mpi"].mpicxx,
|
define("MPI_CXX_COMPILER", spec["mpi"].mpicxx),
|
||||||
"-DMPI_C_COMPILER:PATH=%s" % spec["mpi"].mpicc,
|
define("MPI_C_COMPILER", spec["mpi"].mpicc),
|
||||||
"-DMPI_Fortran_COMPILER:PATH=%s" % spec["mpi"].mpifc,
|
define("MPI_Fortran_COMPILER", spec["mpi"].mpifc),
|
||||||
"-DHDF5_ROOT:PATH=%s" % spec["hdf5"].prefix,
|
define("HDF5_ROOT", spec["hdf5"].prefix),
|
||||||
"-DYAML_ROOT:PATH=%s" % spec["yaml-cpp"].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:
|
if "~shared" in spec:
|
||||||
options.extend(
|
options.extend(
|
||||||
[
|
[
|
||||||
"-DHDF5_USE_STATIC_LIBRARIES=ON",
|
define("HDF5_USE_STATIC_LIBRARIES", True),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
if "+openmp" in spec:
|
if "+openmp" in spec:
|
||||||
options.extend(
|
options.extend(
|
||||||
[
|
[
|
||||||
"-DOPENMP:BOOL=ON",
|
define("OPENMP", True),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
if "darwin" in spec.architecture:
|
|
||||||
options.append("-DCMAKE_MACOSX_RPATH:BOOL=ON")
|
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
|
||||||
def flag_handler(self, name, flags):
|
def flag_handler(self, name, flags):
|
||||||
|
Loading…
Reference in New Issue
Block a user