From 63b1c2744d54f5c7d3f92ddce0f8428fe73ae9a1 Mon Sep 17 00:00:00 2001 From: Ankith Date: Sat, 13 Jul 2024 17:19:18 +0530 Subject: [PATCH] Handle brigand in buildscript instead of wrap --- backend/buildscripts/build-all.sh | 12 ++++++++++++ backend/meson.build | 9 ++++++++- backend/src/meson.build | 10 +++++----- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/backend/buildscripts/build-all.sh b/backend/buildscripts/build-all.sh index 7ae68cab..28060ca5 100644 --- a/backend/buildscripts/build-all.sh +++ b/backend/buildscripts/build-all.sh @@ -67,4 +67,16 @@ if [ ! -d sleef ]; then cd .. fi +# brigand +if [ ! -d brigand ]; then + git clone --depth 1 https://github.com/edouarda/brigand.git && cd brigand + + mkdir build + cmake -B build $ELASTICA_BASE_CMAKE_FLAGS \ + -S . + cmake --build build --parallel $(nproc) + cmake --install build + cd .. +fi + cd $OLD_CWD \ No newline at end of file diff --git a/backend/meson.build b/backend/meson.build index 6ef884f5..26cd2608 100644 --- a/backend/meson.build +++ b/backend/meson.build @@ -59,6 +59,9 @@ pybind11_dep = declare_dependency( ).stdout().strip(), ) +# python and pybind deps are used together +py_deps = [py_dep, pybind11_dep] + fs = import('fs') message('Running buildscripts/build-all.sh (might take a while)') @@ -93,7 +96,11 @@ endif # blaze and deps commonly used together blaze_deps = [blaze_dep, blaze_tensor_dep, sleef_dep] -brigand_dep = dependency('brigand', fallback : 'brigand') +brigand_dep = dependency('brigand', required: false) +if not brigand_dep.found() + brigand_dep = declare_dependency(include_directories: deps_inc_dirs) +endif + cxxopts_dep = dependency('cxxopts', fallback : 'cxxopts') # meson-python: error: Could not map installation path to an equivalent wheel directory: diff --git a/backend/src/meson.build b/backend/src/meson.build index 9e8a52a2..74be201e 100644 --- a/backend/src/meson.build +++ b/backend/src/meson.build @@ -1,7 +1,7 @@ example_1 = py.extension_module( 'example_1', sources: ['example_1.cpp'], - dependencies: [py_dep, pybind11_dep], + dependencies: py_deps, link_language: 'cpp', install: true, subdir: package, @@ -10,7 +10,7 @@ example_1 = py.extension_module( _linalg = py.extension_module( '_linalg', sources: ['_linalg.cpp'], - dependencies: [py_dep, pybind11_dep] + blaze_deps, + dependencies: py_deps + blaze_deps, link_language: 'cpp', install: true, subdir: package, @@ -19,7 +19,7 @@ _linalg = py.extension_module( _linalg_numpy = py.extension_module( '_linalg_numpy', sources: ['_linalg_numpy.cpp'], - dependencies: [py_dep, pybind11_dep] + blaze_deps, + dependencies: py_deps + blaze_deps, link_language: 'cpp', install: true, subdir: package, @@ -33,7 +33,7 @@ _PyArrays = py.extension_module( 'Utilities/Math/Python/BlazeMatrix.cpp', 'Utilities/Math/Python/BlazeTensor.cpp', ], - dependencies: [py_dep, pybind11_dep] + blaze_deps, + dependencies: py_deps + blaze_deps, link_language: 'cpp', install: true, subdir: package, @@ -45,7 +45,7 @@ _PyTags = py.extension_module( 'Systems/Python/Bindings.cpp', 'Systems/Python/BindTags.cpp', ], - dependencies: [py_dep, pybind11_dep] + blaze_deps, + dependencies: py_deps + blaze_deps + brigand_dep, link_language: 'cpp', install: true, subdir: package,