Commit 08207a75 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

Started working on ctest tests using qcor compiler

parent 1b759d30
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12)
endif()

set(CMAKE_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_DISABLE_IN_SOURCE_BUILDS ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+3 −1
Original line number Diff line number Diff line
@@ -82,9 +82,11 @@ bool FuzzyParsingExternalSemaSource::LookupUnqualified(clang::LookupResult &R,
  } else if (std::find(compositeInstructions.begin(),
                       compositeInstructions.end(),
                       unknownName + "__qcor_instruction") !=
             std::end(compositeInstructions)) {
             std::end(compositeInstructions) &&
      S->getFlags() != 128 && S->getBlockParent() != nullptr) {

    if (!qbit) {
        std::cout << unknownName <<  ", TRYING TO FIND QBIT\n";
      // Save pointers to xacc::qbit, xacc::HeterogeneousMap&& ParmVarDecl
      qbit = FirstDeclMatcher<ParmVarDecl>().match(
          ci.getASTContext().getTranslationUnitDecl(),
+14 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ protected:

int main(int argc, char **argv) {

  xacc::Initialize(argc, argv);
  xacc::Initialize();//argc, argv);

  // Get filename
  std::string fileName(argv[argc - 1]);
@@ -145,6 +145,19 @@ int main(int argc, char **argv) {
  std::vector<std::string> args{"-Wno-dangling", "-std=c++14",
                                "-I@CMAKE_INSTALL_PREFIX@/include/qcor",
                                "-I@CMAKE_INSTALL_PREFIX@/include/xacc"};
  std::vector<std::string> arguments(argv + 1, argv + argc);
  // Add incoming includes...
  for (int i = 0; i < arguments.size(); i++) {
      if (arguments[i] == "-I") {
        //   std::cout << "Adding " << arguments[i+1] << "\n";
        if (arguments[i+1] != "@CMAKE_INSTALL_PREFIX@/include/qcor" && arguments[i+1] != "@CMAKE_INSTALL_PREFIX@/include/xacc") {
        args.push_back(arguments[i]+arguments[i+1]);
        }
      } else if (arguments[i].find("-I") != std::string::npos) {
          args.push_back(arguments[i]);
      }
  }
//   args.insert(args.end(), arguments.begin(), arguments.end());

  if (!tooling::runToolOnCodeWithArgs(action, src, args)) {
    xacc::error("Error running qcor compiler.");
+5 −1
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@ endif()

xacc_configure_library_rpath(${LIBRARY_NAME})

file(GLOB HEADERS qcor.hpp qpu_handler.hpp)
file(GLOB HEADERS qcor.hpp)
install(FILES ${HEADERS} DESTINATION include/qcor)
install(TARGETS ${LIBRARY_NAME} DESTINATION lib)

if (QCOR_BUILD_TESTS)
  add_subdirectory(tests)
endif()
 No newline at end of file
+9 −0
Original line number Diff line number Diff line
set(CMAKE_CXX_COMPILER qcor)

message(STATUS "LINKING ${XACC_ROOT}/lib")

link_directories(${XACC_ROOT}/lib)
add_executable(test_bell_state test_bell_state.cpp)
target_include_directories(test_bell_state PRIVATE ${XACC_INCLUDE_ROOT}/gtest)
add_test(test_bell_state test_bell_state)
target_link_libraries(test_bell_state PRIVATE gtest gtest_main)
Loading