From daafa05d95c3352951ebc3ff802c975e6f9b8cfa Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Mon, 20 Nov 2023 19:00:20 -0600 Subject: [PATCH] Use xsimd and eigen from conda-forge for packages Also update the conda build compiler to be C++ Signed-off-by: Patrick Avery --- conda.recipe/meta.yaml | 5 +++- scripts/install/install_build_dependencies.py | 28 ++++++++++++++----- setup.py | 15 ++++++---- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 606a0ca57..19482d5c6 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -14,7 +14,7 @@ build: requirements: build: # This is so that we can build cross-platform for osx-arm64 - - {{ compiler('c') }} + - {{ compiler('cxx') }} - python {{ python }} # [build_platform != target_platform] - cross-python_{{ target_platform }} # [build_platform != target_platform] - numpy >=1.20 # [build_platform != target_platform] @@ -28,6 +28,9 @@ requirements: - setuptools_scm # Numba is only here to make sure we use a version of numpy that is compatible - numba + - pybind11 + - xsimd + - eigen run: - appdirs diff --git a/scripts/install/install_build_dependencies.py b/scripts/install/install_build_dependencies.py index 983013deb..ca1688faa 100755 --- a/scripts/install/install_build_dependencies.py +++ b/scripts/install/install_build_dependencies.py @@ -55,7 +55,7 @@ def download_xsimd(path): return str(target_path) -def download_eigen(path): +def download_eigen3(path): url = 'https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz' # noqa md5sum = '4c527a9171d71a72a9d4186e65bea559' out_dir_name = 'eigen-3.4.0' @@ -87,14 +87,28 @@ def download_pybind11(path): return str(target_path) +INSTALL_FUNCTIONS = { + 'eigen3': download_eigen3, + 'xsimd': download_xsimd, + 'pybind11': download_pybind11, +} + + +def install(library, destination): + if library not in INSTALL_FUNCTIONS: + raise NotImplementedError(library) + + return INSTALL_FUNCTIONS[library](destination) + + if __name__ == '__main__': import sys - if len(sys.argv) < 2: - sys.exit('