Commit 8fde6f36 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

cleanup, remove hardcoded paths

parent b22eb9d4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
#pragma once

#define QCOR_LIB_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}"
#define QCOR_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
#define XACC_ROOT "${XACC_ROOT}"
+2 −6
Original line number Diff line number Diff line
@@ -32,8 +32,9 @@ add_subdirectory(tools)

set(LIBRARY_NAME qcor-mlir-api)

file(GLOB SRC *.cpp)
file(GLOB SRC qcor_mlir_api.cpp)

include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/runtime/jit)
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
@@ -54,8 +55,6 @@ set(LIBS

add_mlir_library(${LIBRARY_NAME} SHARED ${SRC} LINK_LIBS PUBLIC ${LIBS})
target_compile_options(${LIBRARY_NAME} PUBLIC "-fexceptions")

#add_library(${LIBRARY_NAME} SHARED ${SRC})
target_compile_features(${LIBRARY_NAME} 
                        PUBLIC
                        cxx_std_17)
@@ -64,9 +63,6 @@ target_include_directories(
  ${LIBRARY_NAME}
  PUBLIC . dialect/include ${CMAKE_BINARY_DIR}/mlir/dialect/include) 

#get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
#target_link_libraries(${LIBRARY_NAME} PUBLIC MLIRQuantum MLIRIR MLIRStandard ${dialect_libs} MLIROptLib openqasm-mlir-generator openqasmv3-mlir-generator quantum-to-llvm-lowering)

if(APPLE)
  set_target_properties(${LIBRARY_NAME}
                        PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${MLIR_INSTALL_DIR}/lib;${LLVM_INSTALL_PREFIX}/lib")
+1 −1
Original line number Diff line number Diff line
@@ -42,4 +42,4 @@ endif()

install(TARGETS ${LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)

add_subdirectory(tests)
 No newline at end of file
#add_subdirectory(tests)
 No newline at end of file
+6 −4
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include "mlir/Parser.h"
#include "openqasm_mlir_generator.hpp"
#include "openqasmv3_mlir_generator.hpp"
#include "qcor_config.hpp"
#include "qcor_jit.hpp"
#include "quantum_to_llvm.hpp"
#include "tools/ast_printer.hpp"
@@ -207,9 +208,10 @@ void execute(const std::string &src_language_type, const std::string &src,
  }

  QJIT jit;
  jit.jit_compile(
      std::move(llvmModule),
      std::vector<std::string>{"/home/cades/.xacc/lib/libqir-qrt.so"});
  jit.jit_compile(std::move(llvmModule),
                  std::vector<std::string>{std::string(QCOR_INSTALL_DIR) +
                                           std::string("/lib/libqir-qrt") +
                                           std::string(QCOR_LIB_SUFFIX)});

  std::vector<std::string> argv;
  std::vector<char *> cstrs;
+1 −2
Original line number Diff line number Diff line
@@ -107,7 +107,6 @@ int main(int argc, char **argv) {
  // Create the PassManager for lowering to LLVM MLIR and run it
  mlir::PassManager pm(&context);
  applyPassManagerCLOptions(pm);

  pm.addPass(
      std::make_unique<qcor::QuantumToLLVMLoweringPass>(unique_function_names));
  auto module_op = (*module).getOperation();