mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
feat: get RT lib path from py and use as sharedlib
Try to find the runtime library automatically (should only work on proper installation of the package), and fail silently by not passing any RT lib. The RT lib can also be specified manually. The RT lib will be used as a shared library by the JIT compiler.
This commit is contained in:
@@ -5,11 +5,16 @@
|
||||
|
||||
using mlir::zamalang::JitCompilerEngine;
|
||||
|
||||
mlir::zamalang::JitCompilerEngine::Lambda buildLambda(const char *module,
|
||||
const char *funcName) {
|
||||
mlir::zamalang::JitCompilerEngine::Lambda
|
||||
buildLambda(const char *module, const char *funcName,
|
||||
const char *runtimeLibPath) {
|
||||
// Set the runtime library path if not nullptr
|
||||
llvm::Optional<llvm::StringRef> runtimeLibPathOptional = {};
|
||||
if (runtimeLibPath != nullptr)
|
||||
runtimeLibPathOptional = runtimeLibPath;
|
||||
mlir::zamalang::JitCompilerEngine engine;
|
||||
llvm::Expected<mlir::zamalang::JitCompilerEngine::Lambda> lambdaOrErr =
|
||||
engine.buildLambda(module, funcName);
|
||||
engine.buildLambda(module, funcName, runtimeLibPathOptional);
|
||||
if (!lambdaOrErr) {
|
||||
std::string backingString;
|
||||
llvm::raw_string_ostream os(backingString);
|
||||
|
||||
Reference in New Issue
Block a user