spack/var/spack/repos/builtin/packages/ip/package.py
Kyle Gerheiser ce9ae3c70d
Add module variables for NCEPLIBS (#27162)
Use setup_run_environment to search for libraries and set env variables for module generation.

Libraries are installed with CMAKE_INSTALL_LIBDIR, which can be lib or lib64 depending on the machine, which makes it impossible to hardcode through modules.yaml.
2021-11-15 13:21:53 +01:00

29 lines
1.1 KiB
Python

# Copyright 2013-2021 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 Ip(CMakePackage):
"""The NCEP general interpolation library (iplib) contains Fortran 90
subprograms to be used for interpolating between nearly all grids used at
NCEP. This is part of the NCEPLIBS project."""
homepage = "https://noaa-emc.github.io/NCEPLIBS-ip"
url = "https://github.com/NOAA-EMC/NCEPLIBS-ip/archive/refs/tags/v3.3.3.tar.gz"
maintainers = ['t-brown', 'kgerheiser', 'edwardhartnett', 'Hang-Lei-NOAA']
version('3.3.3', sha256='d5a569ca7c8225a3ade64ef5cd68f3319bcd11f6f86eb3dba901d93842eb3633')
depends_on('sp')
def setup_run_environment(self, env):
for suffix in ('4', '8', 'd'):
lib = find_libraries('libip_4', root=self.prefix,
shared=False, recursive=True)
env.set('IP_LIB' + suffix, lib[0])
env.set('IP_INC' + suffix, join_path(self.prefix, 'include_' + suffix))