QuTech-Delft / qx-simulator

QX Simulator
Other
16 stars 12 forks source link

libqasm integration with QX #7

Closed imranashraf closed 6 years ago

imranashraf commented 6 years ago

libqasm has been released. so instead of the current parser in qx, this libqasm should be used to parse cQasm v1.0 files.

andreasppg commented 6 years ago

Initial implementation available in https://github.com/QE-Lab/qx-simulator/tree/libqasm_integration

CumulonimbusCalvus commented 6 years ago

There are some installation problems when using Ubuntu 18.04 LTS. The std headers are not found. Any idea why?

kel85uk commented 6 years ago

Maybe newer version of gcc?

On Fri, 29 Jun 2018, 14:21 Luc Blom, notifications@github.com wrote:

There are some installation problems when using Ubuntu 18.04 LTS. The std headers are not found. Any idea why?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/QE-Lab/qx-simulator/issues/7#issuecomment-401337863, or mute the thread https://github.com/notifications/unsubscribe-auth/AF_vTY29i6NS8LQNMRMVdj7EhIUMfng3ks5uBhvPgaJpZM4U5hXT .

imranashraf commented 6 years ago

Well, the problem seems to be there for gcc 5, 6 and 7 on my Ubuntu 18.04. I wonder what version @andreasppg was using for compilation?

imranashraf commented 6 years ago

@andreasppg I fixed minor issue regarding addition of a header but the main error is: [ 9%] [FLEX][cQasmScanner] Building scanner with flex 2.6.4 [ 18%] [BISON][cQasmParser] Building parser with bison 3.0.4 Scanning dependencies of target cqasmlexgram [ 27%] Building CXX object bin/parser/CMakeFiles/cqasmlexgram.dir/grammar.tab.c.o [ 36%] Building CXX object bin/parser/CMakeFiles/cqasmlexgram.dir/lex.yy.c.o In file included from /usr/include/c++/7/bits/stl_algobase.h:63:0, from /usr/include/c++/7/vector:60, from /home/iashraf/repositories/quantRepos/qx-simulator/src/qcode/strings.h:4, from /usr/include/string.h:431, from /home/iashraf/repositories/quantRepos/qx-simulator/build/bin/parser/lex.yy.c:21: /usr/include/c++/7/ext/numeric_traits.h:54:3: error: template with C linkage template ^~~~ compilation terminated due to -Wfatal-errors. bin/parser/CMakeFiles/cqasmlexgram.dir/build.make:98: recipe for target 'bin/parser/CMakeFiles/cqasmlexgram.dir/lex.yy.c.o' failed make[2]: [bin/parser/CMakeFiles/cqasmlexgram.dir/lex.yy.c.o] Error 1 CMakeFiles/Makefile2:220: recipe for target 'bin/parser/CMakeFiles/cqasmlexgram.dir/all' failed make[1]: [bin/parser/CMakeFiles/cqasmlexgram.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

andreasppg commented 6 years ago

Compiling with: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

kel85uk commented 6 years ago

image

I agree, works well with the Bash for Windows system too.

kel85uk commented 6 years ago

Using this system...

image

kel85uk commented 6 years ago

@imranashraf Could you try flex 2.6.0 instead? I think there could be an issue with flex and gcc?

imranashraf commented 6 years ago

with gcc 5 and flex 2.6.0 still the same problem.

kel85uk commented 6 years ago

@imranashraf This is stumping me. Could it be a problem of Ubuntu? Anyway, will check it out on Wednesday if it is related to include declarations within the extern declarations of the flex output.

Related to this perhaps https://stackoverflow.com/questions/38503934/receiving-error-messages-template-with-c-linkage-when-trying-to-build-a-c-pr ?

imranashraf commented 6 years ago

i also think the same but i do not have time now to verify/test it. @andreasppg is also looking at it. it will be great if you can look at it when you get time.

kel85uk commented 6 years ago

Seems like it's solved? @andreasppg

CumulonimbusCalvus commented 6 years ago

The installation problem seems to be solved on Ubuntu 18.04 LTS.

imranashraf commented 6 years ago

Indeed. But there are still some other issues regarding the functioning, which @andreasppg is looking at.

imranashraf commented 6 years ago

@andreasppg pushed recent commit for this initial integration. also tested on ubuntu 18.04 and seems to work ok. i have merged it with develop and master branch. other issues/bugs should be handled separately in their respective issues by forking develop branch.