Git Product home page Git Product logo

Comments (6)

tuxu avatar tuxu commented on September 27, 2024 1

Ha! Adding -o qasm:shared=True actually works 🎉 Thank you!

from qe-compiler.

taalexander avatar taalexander commented on September 27, 2024 1

Great, I still view this as a temporary workaround as it should be enabled by default (@kevinhartman?)

from qe-compiler.

tuxu avatar tuxu commented on September 27, 2024

Same with debug build. Backtrace with more info here:

❯ lldb ./test/unittest/unittest-qss-compiler
(lldb) target create "./test/unittest/unittest-qss-compiler"
Current executable set to '/Users/tinow/zi/git/ibm/qss-compiler/build-debug/test/unittest/unittest-qss-compiler' (arm64).
(lldb) run
Process 42068 launched: '/Users/tinow/zi/git/ibm/qss-compiler/build-debug/test/unittest/unittest-qss-compiler' (arm64)
Process 42068 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000105c8d88c unittest-qss-compiler`std::__1::__tree<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__map_value_compare<unsigned int, std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::less<unsigned int>, true>, std::__1::allocator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*> > >::__insert_node_at(this=0x00000001071f36c0, __parent=0x00000001071f36c8, __child=0x00000001071f36c8, __new_node=0x0000600000c040f0) at __tree:2078:25
   2075	    __new_node->__parent_ = __parent;
   2076	    // __new_node->__is_black_ is initialized in __tree_balance_after_insert
   2077	    __child = __new_node;
-> 2078	    if (__begin_node()->__left_ != nullptr)
   2079	        __begin_node() = static_cast<__iter_pointer>(__begin_node()->__left_);
   2080	    _VSTD::__tree_balance_after_insert(__end_node()->__left_, __child);
   2081	    ++size();
Target 0: (unittest-qss-compiler) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000105c8d88c unittest-qss-compiler`std::__1::__tree<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__map_value_compare<unsigned int, std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::less<unsigned int>, true>, std::__1::allocator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*> > >::__insert_node_at(this=0x00000001071f36c0, __parent=0x00000001071f36c8, __child=0x00000001071f36c8, __new_node=0x0000600000c040f0) at __tree:2078:25
    frame #1: 0x0000000105e7f2a4 unittest-qss-compiler`std::__1::pair<std::__1::__tree_iterator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__tree_node<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, void*>*, long>, bool> std::__1::__tree<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__map_value_compare<unsigned int, std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::less<unsigned int>, true>, std::__1::allocator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*> > >::__emplace_unique_key_args<unsigned int, std::__1::pair<unsigned int, QASM::ASTDeclarationContext const*> >(this=0x00000001071f36c0, __k=0x000000016fdfd098, __args=0x000000016fdfd098) at __tree:2096:9
    frame #2: 0x0000000105e7f1ac unittest-qss-compiler`std::__1::pair<std::__1::__tree_iterator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__tree_node<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, void*>*, long>, bool> std::__1::__tree<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__map_value_compare<unsigned int, std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::less<unsigned int>, true>, std::__1::allocator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*> > >::__emplace_unique_extract_key[abi:v15006]<std::__1::pair<unsigned int, QASM::ASTDeclarationContext const*> >(this=0x00000001071f36c0, __x=0x000000016fdfd098, (null)=__extract_key_first_tag @ 0x000000016fdfcee7) at __tree:1207:14
    frame #3: 0x0000000105e7f128 unittest-qss-compiler`std::__1::pair<std::__1::__tree_iterator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__tree_node<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, void*>*, long>, bool> std::__1::__tree<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__map_value_compare<unsigned int, std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::less<unsigned int>, true>, std::__1::allocator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*> > >::__emplace_unique[abi:v15006]<std::__1::pair<unsigned int, QASM::ASTDeclarationContext const*> >(this=0x00000001071f36c0, __x=0x000000016fdfd098) at __tree:1171:16
    frame #4: 0x0000000105e7f0a8 unittest-qss-compiler`std::__1::pair<std::__1::__tree_iterator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__tree_node<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, void*>*, long>, bool> std::__1::__tree<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__map_value_compare<unsigned int, std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::less<unsigned int>, true>, std::__1::allocator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*> > >::__insert_unique[abi:v15006]<std::__1::pair<unsigned int, QASM::ASTDeclarationContext const*>, void>(this=0x00000001071f36c0, __v=0x000000016fdfd098) at __tree:1277:16
    frame #5: 0x0000000105e7beb8 unittest-qss-compiler`std::__1::pair<std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, std::__1::__tree_node<std::__1::__value_type<unsigned int, QASM::ASTDeclarationContext const*>, void*>*, long> >, bool> std::__1::map<unsigned int, QASM::ASTDeclarationContext const*, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, QASM::ASTDeclarationContext const*> > >::insert[abi:v15006]<std::__1::pair<unsigned int, QASM::ASTDeclarationContext const*>, void>(this=0x00000001071f36c0 size=0, __p=0x000000016fdfd098) at map:1234:29
    frame #6: 0x0000000105e7bb1c unittest-qss-compiler`QASM::ASTDeclarationContextTracker::Init() at ASTDeclarationContext.cpp:54:12
    frame #7: 0x0000000105b87a7c unittest-qss-compiler`QASM::ASTDeclarationContextTracker::Instance() at ASTDeclarationContext.h:214:7
    frame #8: 0x0000000105d7aea4 unittest-qss-compiler`QASM::ASTIdentifierNode::ASTIdentifierNode(this=0x00000001071f3b38, Id="char", STy=ASTTypeChar, B=8) at ASTIdentifier.h:129:7
    frame #9: 0x0000000105d12eac unittest-qss-compiler`QASM::ASTIdentifierNode::ASTIdentifierNode(this=0x00000001071f3b38, Id="char", STy=ASTTypeChar, B=8) at ASTIdentifier.h:133:27
    frame #10: 0x0000000105f21244 unittest-qss-compiler`::__cxx_global_var_init() at ASTIdentifier.cpp:39:20
    frame #11: 0x0000000105f260e4 unittest-qss-compiler`_GLOBAL__I_000201 at ASTIdentifier.cpp:0
    frame #12: 0x00000001ae8837c4 dyld`invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 156
    frame #13: 0x00000001ae8c8214 dyld`invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 340
    frame #14: 0x00000001ae8bb524 dyld`invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 524
    frame #15: 0x00000001ae8682d8 dyld`dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 296
    frame #16: 0x00000001ae8ba548 dyld`dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 192
    frame #17: 0x00000001ae8c7bf4 dyld`dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 516
    frame #18: 0x00000001ae88369c dyld`dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 176
    frame #19: 0x00000001ae883950 dyld`dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 216
    frame #20: 0x00000001ae883ae8 dyld`dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 328
    frame #21: 0x00000001ae8a64b8 dyld`dyld4::APIs::runAllInitializersForMain() + 480
    frame #22: 0x00000001ae86cdd8 dyld`dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3500
    frame #23: 0x00000001ae86bdc4 dyld`start + 2404

from qe-compiler.

taalexander avatar taalexander commented on September 27, 2024

Due to issues with the qss-qasm parser you must build with shared libraries, have you tried building with conan install .. --profile default --update --build=outdated -o qasm:shared?

from qe-compiler.

taalexander avatar taalexander commented on September 27, 2024

See this comment #82 (comment)

from qe-compiler.

kevinhartman avatar kevinhartman commented on September 27, 2024

We ought to make it the default, at least for macOS. Here are our options:

  1. Make it default, but for macOS, only. This should be doable within our conanfile.
  2. Make it default for everything. This is unfortunately not straightforward, since there are issues with dynamically linking to Qasm on Linux. This is likely an issue/bug with our Qasm Conan recipe that could be fixed with some effort.

(Note that we link GMP, MPFR, and MPC themselves dynamically on all platforms, but QASM statically by default today).

from qe-compiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.