Commit e72af85e authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

Addressed code review comments



- Use CMAKE_INSTALL_PREFIX to locate QIR target files since QCOR might install its files to different locations.

- Remove qcor.hpp includes in driver files: since these source files will be compiled with our qcor compiler (having the language extension), no need to explicitly include this header.

Signed-off-by: default avatarThien Nguyen <nguyentm@ornl.gov>
parent 39234ecb
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
#include <iostream> 
#include <vector>
#include "qcor.hpp"

// Include the external QSharp function.
qcor_include_qsharp(QCOR__TestBell__body, int64_t, int64_t)
+0 −1
Original line number Diff line number Diff line
#include <iostream> 
#include <vector>
#include "qcor.hpp"

// Include the external QSharp function.
qcor_include_qsharp(QCOR__Deuteron__body, double, double, int64_t);
+0 −1
Original line number Diff line number Diff line
#include <iostream> 
#include <vector>
#include "qcor.hpp"
#include "import_kernel_utils.hpp"

// Util pre-processor to wrap Q# operation in a QCOR QuantumKernel.
+1 −1
Original line number Diff line number Diff line
@@ -356,7 +356,7 @@ def main(argv=None):
        bc_file_name = 'QIR/' + base_name + '.bc'
        object_file_name = base_name+'.o'
        extra_args = []
        result = subprocess.run(['qsc', 'build', '--qir', 'QIR', 's', '--input', filename, '@XACC_ROOT@/include/qsharp/QirCore.qs', '@XACC_ROOT@/include/qsharp/QirTarget.qs', '--proj', base_name], check=True)
        result = subprocess.run(['qsc', 'build', '--qir', 'QIR', 's', '--input', filename, '@CMAKE_INSTALL_PREFIX@/include/qsharp/QirCore.qs', '@CMAKE_INSTALL_PREFIX@/include/qsharp/QirTarget.qs', '--proj', base_name], check=True)
        llvm_bin_path = str(pathlib.Path(compiler).parent)
        result = subprocess.run([llvm_bin_path+'/llvm-as', ll_file_name, '-o', bc_file_name ], check=True)
        result = subprocess.run([llvm_bin_path+'/llc', '-filetype=obj', bc_file_name ], check=True)