Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:15:26

0001 """
0002 PodIO
0003 https://github.com/AIDASoft/podio.git
0004 """
0005 
0006 import os
0007 
0008 from edpm.engine.env_gen import Set, Append, Prepend
0009 from edpm.engine.git_cmake_recipe import GitCmakeRecipe
0010 
0011 
0012 class PodioRecipe(GitCmakeRecipe):
0013     """Provides data for building and installing Genfit framework
0014     source_path  = {app_path}/src/{version}          # Where the sources for the current version are located
0015     build_path   = {app_path}/build/{version}        # Where sources are built. Kind of temporary dir
0016     install_path = {app_path}/root-{version}         # Where the binary installation is
0017     """
0018 
0019     def __init__(self):
0020         """
0021         Installs Genfit track fitting framework
0022         """
0023 
0024         # Set initial values for parent class and self
0025         super(PodioRecipe, self).__init__('podio')                        # This name will be used in edpm commands
0026         self.config['branch'] = 'v00-17-04'                               # The branch or tag to be cloned (-b flag)
0027         self.config['repo_address'] = 'https://github.com/AIDASoft/podio.git'    # Repo address
0028         self.config['cmake_flags'] = '-DBUILD_TESTING=OFF'
0029         self.config['cxx_standard'] = 17
0030 
0031     @staticmethod
0032     def gen_env(data):
0033         """Generates environments to be set"""
0034         path = data['install_path']
0035 
0036         yield Set('PODIO_ROOT', path)
0037 
0038         # it could be lib or lib64. There are bugs on different platforms (RHEL&centos and WSL included)
0039         # https://stackoverflow.com/questions/46847939/config-site-for-vendor-libs-on-centos-x86-64
0040         # https: // bugzilla.redhat.com / show_bug.cgi?id = 1510073
0041 
0042         import platform
0043         if platform.system() == 'Darwin':
0044             if os.path.isdir(os.path.join(path, 'lib64')):
0045                 yield Append('DYLD_LIBRARY_PATH', os.path.join(path, 'lib64'))
0046             else:
0047                 yield Append('DYLD_LIBRARY_PATH', os.path.join(path, 'lib'))
0048 
0049         if os.path.isdir(os.path.join(path, 'lib64')):
0050             yield Append('LD_LIBRARY_PATH', os.path.join(path, 'lib64'))
0051         else:
0052             yield Append('LD_LIBRARY_PATH', os.path.join(path, 'lib'))
0053 
0054         yield Append('CMAKE_PREFIX_PATH', os.path.join(path, 'lib', 'cmake', 'podio'))
0055 
0056 
0057     #
0058     # OS dependencies are a map of software packets installed by os maintainers
0059     # The map should be in form:
0060     # os_dependencies = { 'required': {'ubuntu': "space separated packet names", 'centos': "..."},
0061     #                     'optional': {'ubuntu': "space separated packet names", 'centos': "..."}
0062     # The idea behind is to generate easy to use instructions: 'sudo apt-get install ... ... ... '
0063     os_dependencies = {
0064         'required': {
0065             'ubuntu18': "python3-jinja2 python3-yaml",
0066             'ubuntu22': "python3-jinja2 python3-yaml",
0067             'centos7': "",
0068             'centos8': "",
0069         },
0070         'optional': {},
0071     }