diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/openfast/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/openfast/package.py | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/var/spack/repos/builtin/packages/openfast/package.py b/var/spack/repos/builtin/packages/openfast/package.py index c5d9086c61..6da8c696e6 100644 --- a/var/spack/repos/builtin/packages/openfast/package.py +++ b/var/spack/repos/builtin/packages/openfast/package.py @@ -47,7 +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") + depends_on("netcdf-c", when="+cxx+netcdf") def cmake_args(self): spec = self.spec @@ -56,8 +56,8 @@ class Openfast(CMakePackage): options.extend( [ - define("BUILD_DOCUMENTATION", False), - define("BUILD_TESTING", False), + self.define("BUILD_DOCUMENTATION", False), + self.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"), @@ -70,42 +70,44 @@ class Openfast(CMakePackage): blas_libs = spec["lapack"].libs + spec["blas"].libs options.extend( [ - define("BLAS_LIBRARIES", blas_libs.joined(";")), - define("LAPACK_LIBRARIES", blas_libs.joined(";")), + self.define("BLAS_LIBRARIES", blas_libs.joined(";")), + self.define("LAPACK_LIBRARIES", blas_libs.joined(";")), ] ) if "+cxx" in spec: options.extend( [ - 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. + self.define("CMAKE_CXX_COMPILER", spec["mpi"].mpicxx), + self.define("CMAKE_C_COMPILER", spec["mpi"].mpicc), + self.define("CMAKE_Fortran_COMPILER", spec["mpi"].mpifc), + self.define("MPI_CXX_COMPILER", spec["mpi"].mpicxx), + self.define("MPI_C_COMPILER", spec["mpi"].mpicc), + self.define("MPI_Fortran_COMPILER", spec["mpi"].mpifc), + self.define("HDF5_ROOT", spec["hdf5"].prefix), + self.define("YAML_ROOT", spec["yaml-cpp"].prefix), + # The following expects 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), + self.define("HDF5_NO_FIND_PACKAGE_CONFIG_FILE", True), ] ) - if "~shared" in spec: - options.extend( - [ - define("HDF5_USE_STATIC_LIBRARIES", True), - ] - ) + if "+netcdf" in spec: + options.extend([self.define("NETCDF_ROOT", spec["netcdf-c"].prefix)]) + + if "~shared" in spec: + options.extend( + [ + self.define("HDF5_USE_STATIC_LIBRARIES", True), + ] + ) if "+openmp" in spec: options.extend( [ - define("OPENMP", True), + self.define("OPENMP", True), ] ) |