Skip to content

Commit

Permalink
Use getCUDAQLibraryPath instead of DECODER_PLUGIN_DIR
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Howe <[email protected]>
  • Loading branch information
bmhowe23 committed Jan 17, 2025
1 parent c2c2c9a commit 84e696c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion libs/qec/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
set(LIBRARY_NAME cudaq-qec)

add_compile_options(-Wno-attributes)
add_compile_definitions(DECODER_PLUGIN_DIR="${CMAKE_INSTALL_PREFIX}/lib/decoder-plugins")

# FIXME?: This must be a shared library. Trying to build a static one will fail.
add_library(${LIBRARY_NAME} SHARED
Expand Down
4 changes: 3 additions & 1 deletion libs/qec/lib/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "cudaq/qec/decoder.h"
#include "cudaq/qec/plugin_loader.h"
#include "cudaq/utils/cudaq_utils.h"
#include <cassert>
#include <dlfcn.h>
#include <filesystem>
Expand Down Expand Up @@ -78,7 +79,8 @@ std::unique_ptr<decoder> get_decoder(const std::string &name,
// Constructor function for auto-loading plugins
__attribute__((constructor)) void load_decoder_plugins() {
// Load plugins from the decoder-specific plugin directory
load_plugins(DECODER_PLUGIN_DIR, PluginType::DECODER);
load_plugins(cudaq::getCUDAQLibraryPath() + "/decoder-plugins",
PluginType::DECODER);
}

// Destructor function to clean up only decoder plugins
Expand Down

0 comments on commit 84e696c

Please sign in to comment.