From 1fd3e49624b0f33051cff0a9cb49ca7c6a18e801 Mon Sep 17 00:00:00 2001 From: Ovidiu Mara Date: Thu, 25 Sep 2025 10:29:15 +0200 Subject: [PATCH 1/4] Make UCX dependency optional Signed-off-by: Ovidiu Mara --- examples/cpp/meson.build | 14 ++++++++------ meson.build | 2 +- src/plugins/meson.build | 6 ++++-- src/utils/meson.build | 4 +++- test/nixl/meson.build | 4 +++- test/unit/plugins/meson.build | 6 ++++-- test/unit/utils/common/meson.build | 14 +++++++------- test/unit/utils/meson.build | 4 +++- 8 files changed, 33 insertions(+), 21 deletions(-) diff --git a/examples/cpp/meson.build b/examples/cpp/meson.build index e0bc94b701..b5bba01072 100644 --- a/examples/cpp/meson.build +++ b/examples/cpp/meson.build @@ -13,12 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -nixl_example = executable('nixl_example', - 'nixl_example.cpp', - dependencies: [nixl_dep, nixl_infra, nixl_common_deps, ucx_backend_dep, ucx_dep], - include_directories: [nixl_inc_dirs, utils_inc_dirs], - link_with: [serdes_lib], - install: true) +if ucx_dep.found() + nixl_example = executable('nixl_example', + 'nixl_example.cpp', + dependencies: [nixl_dep, nixl_infra, nixl_common_deps, ucx_backend_dep, ucx_dep], + include_directories: [nixl_inc_dirs, utils_inc_dirs], + link_with: [serdes_lib], + install: true) +endif if etcd_dep.found() etcd_example = executable('nixl_etcd_example', diff --git a/meson.build b/meson.build index adf891c6ed..19f3f3b514 100644 --- a/meson.build +++ b/meson.build @@ -148,7 +148,7 @@ if ucx_path != '' include_directories : include_directories(ucx_inc_path)) endif else - ucx_dep = dependency('ucx', modules: ['ucx::ucs', 'ucx::ucp', 'ucx::uct']) + ucx_dep = dependency('ucx', modules: ['ucx::ucs', 'ucx::ucp', 'ucx::uct'], required: false) endif libfabric_path = get_option('libfabric_path') diff --git a/src/plugins/meson.build b/src/plugins/meson.build index 551c4d1ff7..9521b7f12e 100644 --- a/src/plugins/meson.build +++ b/src/plugins/meson.build @@ -15,8 +15,10 @@ ucx_backend_inc_dirs = include_directories('./ucx') -subdir('ucx') -subdir('ucx_mo') +if ucx_dep.found() + subdir('ucx') + subdir('ucx_mo') +endif subdir('posix') # Always try to build POSIX backend, it will handle its own dependencies subdir('obj') # Always try to build Obj backend, it will handle its own dependencies diff --git a/src/utils/meson.build b/src/utils/meson.build index 12ee072479..e7ee0a5086 100644 --- a/src/utils/meson.build +++ b/src/utils/meson.build @@ -15,7 +15,9 @@ subdir('common') subdir('serdes') -subdir('ucx') +if ucx_dep.found() + subdir('ucx') +endif subdir('stream') subdir('file') diff --git a/test/nixl/meson.build b/test/nixl/meson.build index 18d151cdae..9aeefbd2ce 100644 --- a/test/nixl/meson.build +++ b/test/nixl/meson.build @@ -13,7 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -ucx_backend_dep = declare_dependency(link_with: ucx_backend_lib, include_directories: [nixl_inc_dirs, utils_inc_dirs, '../../src/plugins/ucx']) +if ucx_dep.found() + ucx_backend_dep = declare_dependency(link_with: ucx_backend_lib, include_directories: [nixl_inc_dirs, utils_inc_dirs, '../../src/plugins/ucx']) +endif desc_example = executable('desc_example', 'desc_example.cpp', diff --git a/test/unit/plugins/meson.build b/test/unit/plugins/meson.build index 22a98f6c03..af5aa09378 100644 --- a/test/unit/plugins/meson.build +++ b/test/unit/plugins/meson.build @@ -13,8 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -subdir('ucx') -subdir('ucx_mo') +if ucx_dep.found() + subdir('ucx') + subdir('ucx_mo') +endif subdir('posix') diff --git a/test/unit/utils/common/meson.build b/test/unit/utils/common/meson.build index 13c7975b24..e037dd6fa7 100644 --- a/test/unit/utils/common/meson.build +++ b/test/unit/utils/common/meson.build @@ -13,13 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -#if cuda_dep.found() -# cuda_dependencies = [cuda_dep] -# cpp_args = '-DUSE_VRAM' -#else -# cuda_dependencies = [] -# cpp_args = '-UUSE_VRAM' -#endif +if cuda_dep.found() + cuda_dependencies = [cuda_dep] + cpp_args = '-DUSE_VRAM' +else + cuda_dependencies = [] + cpp_args = '-UUSE_VRAM' +endif p2p_socket = executable('p2p_test', 'p2p_socket_test.cpp', diff --git a/test/unit/utils/meson.build b/test/unit/utils/meson.build index 97cee34980..d6bc46592b 100644 --- a/test/unit/utils/meson.build +++ b/test/unit/utils/meson.build @@ -19,4 +19,6 @@ if libfabric_dep.found() endif subdir('serdes') subdir('stream') -subdir('ucx') +if ucx_dep.found() + subdir('ucx') +endif From baa3b878000e07897e31288da00d546525049b3e Mon Sep 17 00:00:00 2001 From: Ovidiu Mara Date: Thu, 25 Sep 2025 14:05:05 +0200 Subject: [PATCH 2/4] NIXL example should always be built Signed-off-by: Ovidiu Mara --- examples/cpp/meson.build | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/cpp/meson.build b/examples/cpp/meson.build index b5bba01072..1dda92c4f4 100644 --- a/examples/cpp/meson.build +++ b/examples/cpp/meson.build @@ -13,19 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. +backend_deps = [] if ucx_dep.found() - nixl_example = executable('nixl_example', - 'nixl_example.cpp', - dependencies: [nixl_dep, nixl_infra, nixl_common_deps, ucx_backend_dep, ucx_dep], - include_directories: [nixl_inc_dirs, utils_inc_dirs], - link_with: [serdes_lib], - install: true) + backend_deps += [ucx_backend_dep, ucx_dep] endif +nixl_example = executable('nixl_example', + 'nixl_example.cpp', + dependencies: [nixl_dep, nixl_infra, nixl_common_deps] + backend_deps, + include_directories: [nixl_inc_dirs, utils_inc_dirs], + link_with: [serdes_lib], + install: true) + if etcd_dep.found() etcd_example = executable('nixl_etcd_example', 'nixl_etcd_example.cpp', - dependencies: [nixl_dep, nixl_infra, nixl_common_deps, ucx_backend_dep, ucx_dep], + dependencies: [nixl_dep, nixl_infra, nixl_common_deps] + backend_deps, include_directories: [nixl_inc_dirs, utils_inc_dirs], link_with: [serdes_lib], install: true) From e9f71c77801c1657be39733560c1b80c93315386 Mon Sep 17 00:00:00 2001 From: Ovidiu Mara Date: Fri, 26 Sep 2025 20:02:41 +0200 Subject: [PATCH 3/4] Remove example dep on plugins completely, since they are not needed for building Signed-off-by: Ovidiu Mara --- examples/cpp/meson.build | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/examples/cpp/meson.build b/examples/cpp/meson.build index 1dda92c4f4..89e5ced60f 100644 --- a/examples/cpp/meson.build +++ b/examples/cpp/meson.build @@ -13,14 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -backend_deps = [] -if ucx_dep.found() - backend_deps += [ucx_backend_dep, ucx_dep] -endif - nixl_example = executable('nixl_example', 'nixl_example.cpp', - dependencies: [nixl_dep, nixl_infra, nixl_common_deps] + backend_deps, + dependencies: [nixl_dep, nixl_infra, nixl_common_deps], include_directories: [nixl_inc_dirs, utils_inc_dirs], link_with: [serdes_lib], install: true) @@ -28,7 +23,7 @@ nixl_example = executable('nixl_example', if etcd_dep.found() etcd_example = executable('nixl_etcd_example', 'nixl_etcd_example.cpp', - dependencies: [nixl_dep, nixl_infra, nixl_common_deps] + backend_deps, + dependencies: [nixl_dep, nixl_infra, nixl_common_deps], include_directories: [nixl_inc_dirs, utils_inc_dirs], link_with: [serdes_lib], install: true) From 169f596117a137debe2ddb64d536740b29b5ee80 Mon Sep 17 00:00:00 2001 From: Ovidiu Mara Date: Fri, 26 Sep 2025 20:14:40 +0200 Subject: [PATCH 4/4] Cleanup Signed-off-by: Ovidiu Mara --- test/nixl/meson.build | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/nixl/meson.build b/test/nixl/meson.build index 9aeefbd2ce..bc6a9c9ffa 100644 --- a/test/nixl/meson.build +++ b/test/nixl/meson.build @@ -13,10 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -if ucx_dep.found() - ucx_backend_dep = declare_dependency(link_with: ucx_backend_lib, include_directories: [nixl_inc_dirs, utils_inc_dirs, '../../src/plugins/ucx']) -endif - desc_example = executable('desc_example', 'desc_example.cpp', dependencies: [nixl_dep, nixl_infra],