__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# SPDX-License-Identifier: Apache-2.0
# Copyright 2013-2020 The Meson development team
from __future__ import annotations
from pathlib import Path
import functools
import os
import typing as T
from ..options import OptionKey
from .base import DependencyMethods
from .cmake import CMakeDependency
from .detect import packages
from .pkgconfig import PkgConfigDependency
from .factory import factory_methods
if T.TYPE_CHECKING:
from ..environment import Environment
from ..mesonlib import MachineChoice
from .factory import DependencyGenerator
@factory_methods({DependencyMethods.PKGCONFIG, DependencyMethods.CMAKE})
def scalapack_factory(env: 'Environment', for_machine: 'MachineChoice',
kwargs: T.Dict[str, T.Any],
methods: T.List[DependencyMethods]) -> T.List['DependencyGenerator']:
candidates: T.List['DependencyGenerator'] = []
if DependencyMethods.PKGCONFIG in methods:
static_opt = kwargs.get('static', env.coredata.get_option(OptionKey('prefer_static')))
mkl = 'mkl-static-lp64-iomp' if static_opt else 'mkl-dynamic-lp64-iomp'
candidates.append(functools.partial(
MKLPkgConfigDependency, mkl, env, kwargs))
for pkg in ['scalapack-openmpi', 'scalapack']:
candidates.append(functools.partial(
PkgConfigDependency, pkg, env, kwargs))
if DependencyMethods.CMAKE in methods:
candidates.append(functools.partial(
CMakeDependency, 'Scalapack', env, kwargs))
return candidates
packages['scalapack'] = scalapack_factory
class MKLPkgConfigDependency(PkgConfigDependency):
"""PkgConfigDependency for Intel MKL.
MKL's pkg-config is pretty much borked in every way. We need to apply a
bunch of fixups to make it work correctly.
"""
def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any],
language: T.Optional[str] = None):
_m = os.environ.get('MKLROOT')
self.__mklroot = Path(_m).resolve() if _m else None
# We need to call down into the normal super() method even if we don't
# find mklroot, otherwise we won't have all of the instance variables
# initialized that meson expects.
super().__init__(name, env, kwargs, language=language)
# Doesn't work with gcc on windows, but does on Linux
if (not self.__mklroot or (env.machines[self.for_machine].is_windows()
and self.clib_compiler.id == 'gcc')):
self.is_found = False
# This can happen either because we're using GCC, we couldn't find the
# mklroot, or the pkg-config couldn't find it.
if not self.is_found:
return
assert self.version != '', 'This should not happen if we didn\'t return above'
if self.version == 'unknown':
# At least by 2020 the version is in the pkg-config, just not with
# the correct name
v = self.get_variable(pkgconfig='Version', default_value='')
if not v and self.__mklroot:
try:
v = (
self.__mklroot.as_posix()
.split('compilers_and_libraries_')[1]
.split('/', 1)[0]
)
except IndexError:
pass
if v:
assert isinstance(v, str)
self.version = v
def _set_libs(self) -> None:
super()._set_libs()
if self.env.machines[self.for_machine].is_windows():
suffix = '.lib'
elif self.static:
suffix = '.a'
else:
suffix = ''
libdir = self.__mklroot / 'lib/intel64'
if self.clib_compiler.id == 'gcc':
for i, a in enumerate(self.link_args):
# only replace in filename, not in directory names
dirname, basename = os.path.split(a)
if 'mkl_intel_lp64' in basename:
basename = basename.replace('intel', 'gf')
self.link_args[i] = '/' + os.path.join(dirname, basename)
# MKL pkg-config omits scalapack
# be sure "-L" and "-Wl" are first if present
i = 0
for j, a in enumerate(self.link_args):
if a.startswith(('-L', '-Wl')):
i = j + 1
elif j > 3:
break
if self.env.machines[self.for_machine].is_windows() or self.static:
self.link_args.insert(
i, str(libdir / ('mkl_scalapack_lp64' + suffix))
)
self.link_args.insert(
i + 1, str(libdir / ('mkl_blacs_intelmpi_lp64' + suffix))
)
else:
self.link_args.insert(i, '-lmkl_scalapack_lp64')
self.link_args.insert(i + 1, '-lmkl_blacs_intelmpi_lp64')
def _set_cargs(self) -> None:
allow_system = False
if self.language == 'fortran':
# gfortran doesn't appear to look in system paths for INCLUDE files,
# so don't allow pkg-config to suppress -I flags for system paths
allow_system = True
cflags = self.pkgconfig.cflags(self.name, allow_system, define_variable=(('prefix', self.__mklroot.as_posix()),))
self.compile_args = self._convert_mingw_paths(cflags)
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| data | Folder | 0755 |
|
|
| __init__.py | File | 8.1 KB | 0644 |
|
| base.py | File | 28.69 KB | 0644 |
|
| boost.py | File | 38.9 KB | 0644 |
|
| cmake.py | File | 28.72 KB | 0644 |
|
| coarrays.py | File | 3.11 KB | 0644 |
|
| configtool.py | File | 7.51 KB | 0644 |
|
| cuda.py | File | 13.91 KB | 0644 |
|
| detect.py | File | 9.05 KB | 0644 |
|
| dev.py | File | 34.17 KB | 0644 |
|
| dub.py | File | 20.31 KB | 0644 |
|
| factory.py | File | 6.36 KB | 0644 |
|
| framework.py | File | 5.27 KB | 0644 |
|
| hdf5.py | File | 6.58 KB | 0644 |
|
| misc.py | File | 27.11 KB | 0644 |
|
| mpi.py | File | 8.84 KB | 0644 |
|
| pkgconfig.py | File | 27.24 KB | 0644 |
|
| platform.py | File | 1.83 KB | 0644 |
|
| python.py | File | 19.48 KB | 0644 |
|
| qt.py | File | 19.1 KB | 0644 |
|
| scalapack.py | File | 5.26 KB | 0644 |
|
| ui.py | File | 11.84 KB | 0644 |
|