From cf01226abe56b9c8373e883e9a753bcd61396175 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Sun, 13 Oct 2024 03:21:02 +0200 Subject: [PATCH] cpp/purify/config.in.h: Add #cmakedefine PURIFY_ONNXRT To enable onnxrt (onnxruntime) supporting the compiled C++ code, PURIFY_ONNXRT must be defined at the preprocessor level. On the cmake level, it is set here: https://github.com/astro-informatics/purify/blob/development/cmake_files/dependencies.cmake#L37 But it needs to be conditinally defined in config.h(.in) to reach the C++ level (actual compilation): //! Whether PURIFY is running with onnxrt (onnxruntime) #cmakedefine PURIFY_ONNXRT Without this, even with `cmake -Donnxrt=ON`, strings bin/purify | grep onnxrt will find a string that is compiled only when PURIFY_ONNXRT is not set by config.h (and it is not if this cmakedefine is not set). --- cpp/purify/config.in.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/purify/config.in.h b/cpp/purify/config.in.h index 57a34a3c7..d5ed42c78 100644 --- a/cpp/purify/config.in.h +++ b/cpp/purify/config.in.h @@ -16,6 +16,9 @@ //! Whether PURIFY is running with mpi #cmakedefine PURIFY_MPI +//! Whether PURIFY is running with onnxrt (onnxruntime) +#cmakedefine PURIFY_ONNXRT + //! Whether PURIFY is running with arrayfire #cmakedefine PURIFY_ARRAYFIRE