Commit 24fe6037 authored by Mccaskey, Alex's avatar Mccaskey, Alex

Making service registry fail with more descriptive error message if plugin...

Making service registry fail with more descriptive error message if plugin can't be loaded (like due to link error). fixed a few mem leaks in xasm compiler, updated python lib compile flags
Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 9898fb89
Pipeline #113221 passed with stage
in 77 minutes and 3 seconds
......@@ -15,7 +15,7 @@ add_subdirectory(plugins)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -O2 -g -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wformat -fexceptions --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -O2 -g -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wformat -fexceptions --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=native -D_GNU_SOURCE -fPIC -fwrapv")
if(APPLE)
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
endif(APPLE)
......
......@@ -50,7 +50,8 @@ bool XASMCompiler::canParse(const std::string &src) {
CommonTokenStream tokens(&lexer);
xasmParser parser(&tokens);
parser.removeErrorListeners();
parser.addErrorListener(new XASMThrowExceptionErrorListener());
XASMThrowExceptionErrorListener el;
parser.addErrorListener(&el);
try {
tree::ParseTree *tree = parser.xaccsrc();
......@@ -68,7 +69,8 @@ std::shared_ptr<IR> XASMCompiler::compile(const std::string &src,
CommonTokenStream tokens(&lexer);
xasmParser parser(&tokens);
parser.removeErrorListeners();
parser.addErrorListener(new XASMErrorListener());
XASMErrorListener el;
parser.addErrorListener(&el);
auto ir = xacc::getService<IRProvider>("quantum")->createIR();
......@@ -99,7 +101,8 @@ XASMCompiler::getKernelBufferNames(const std::string &src) {
CommonTokenStream tokens(&lexer);
xasmParser parser(&tokens);
parser.removeErrorListeners();
parser.addErrorListener(new XASMErrorListener());
XASMErrorListener el;
parser.addErrorListener(&el);
auto ir = xacc::getService<IRProvider>("quantum")->createIR();
......
......@@ -12,6 +12,7 @@
*******************************************************************************/
#include "ServiceRegistry.hpp"
#include "xacc_config.hpp"
#include "xacc.hpp"
namespace xacc {
......@@ -69,7 +70,11 @@ void ServiceRegistry::initialize(const std::string rootPath) {
// bad practice.
auto bundles = context.GetBundles();
for (auto b : bundles) {
b.Start();
try {
b.Start();
} catch (std::exception &e) {
xacc::error("Could not load " + b.GetSymbolicName() + ", error message: " + e.what());
}
}
initialized = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment