Results 1 to 7 of 7

Thread: Need help packaging quantum-blackbird (antlr4-common.h: No such file or directory)

  1. #1
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    191

    Default Need help packaging quantum-blackbird (antlr4-common.h: No such file or directory)

    Hello,

    I have been trying to package python-quantum-blackbird.

    https://build.opensuse.org/package/s...ntum-blackbird
    https://github.com/XanaduAI/blackbird

    I tried installing the libraries and header files for C++ but failed.

    The error can be reproduce on my local machine .
    Step to reproduce on local machine.

    1. Download source from github https://github.com/XanaduAI/blackbir.../v0.2.1.tar.gz
    2. Extract it
    3. Required libantlr4-runtime-devel as dependencies so install it with sudo zypper in libantlr4-runtime-devel.
    4. Change directory to blackbird_cpp folder.
    5. cmake .
    6. sudo make install
    7. Error as shown below.

    Code:
    Scanning dependencies of target blackbird
    [ 20%] Building CXX object CMakeFiles/blackbird.dir/Visitor.cpp.o
    In file included from /usr/include/antlr4-runtime/CharStream.h:9,
                     from /usr/include/antlr4-runtime/ANTLRInputStream.h:8,
                     from /usr/include/antlr4-runtime/ANTLRFileStream.h:8,
                     from /usr/include/antlr4-runtime/antlr4-runtime.h:14,
                     from /home/kev/Desktop/quantum-blackbird-0.2.4/blackbird_cpp/Blackbird.h:23,
                     from /home/kev/Desktop/quantum-blackbird-0.2.4/blackbird_cpp/Visitor.cpp:16:
    /usr/include/antlr4-runtime/misc/Interval.h:8:10: fatal error: antlr4-common.h: No such file or directory
        8 | #include "antlr4-common.h"
          |          ^~~~~~~~~~~~~~~~~
    compilation terminated.
    make[2]: *** [CMakeFiles/blackbird.dir/build.make:82: CMakeFiles/blackbird.dir/Visitor.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/blackbird.dir/all] Error 2
    make: *** [Makefile:149: all] Error 2

    It complain about fatal error: antlr4-common.h: No such file or directory, but antlr4-common.h should be provided by libantlr4-runtime-devel. SO what is going on here?
    Thank you

  2. #2
    Join Date
    Sep 2012
    Posts
    5,924

    Default Re: Need help packaging quantum-blackbird (antlr4-common.h: No such file or directory)

    Quote Originally Posted by andythe_great View Post
    antlr4-common.h should be provided by libantlr4-runtime-devel.
    If this file is not in one of default include directories you either need to specify correct include directory during compilation (-I...) or patch sources to use path relative to one of standard include directories.

  3. #3
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    191

    Default Re: Need help packaging quantum-blackbird (antlr4-common.h: No such file or directory)

    Quote Originally Posted by arvidjaar View Post
    If this file is not in one of default include directories you either need to specify correct include directory during compilation (-I...) or patch sources to use path relative to one of standard include directories.
    What is the -I thing you speak of?
    Thanks

  4. #4
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    191

    Default Re: Need help packaging quantum-blackbird (antlr4-common.h: No such file or directory)

    I changing the directories in CmakeList.txt to,

    include_directories(/usr/include/)
    include_directories(/usr/include/antlr4-runtime/)

    which fix the antlr4 issue, but a whole new problem occur.
    Thanks anyway.

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,713
    Blog Entries
    15

    Default Re: Need help packaging quantum-blackbird (antlr4-common.h: No such file or directory)

    Quote Originally Posted by andythe_great View Post
    I changing the directories in CmakeList.txt to,

    include_directories(/usr/include/)
    include_directories(/usr/include/antlr4-runtime/)

    which fix the antlr4 issue, but a whole new problem occur.
    Thanks anyway.
    Hi
    The -I is the way to (-I)nclude a directory, look in the CmakeList.txt and look for the includes and add (don't change) so it gets appended to the includes.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  6. #6
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    191

    Default Re: Need help packaging quantum-blackbird (antlr4-common.h: No such file or directory)

    Quote Originally Posted by malcolmlewis View Post
    Hi
    The -I is the way to (-I)nclude a directory, look in the CmakeList.txt and look for the includes and add (don't change) so it gets appended to the includes.
    I add more directories like this, it found antlr4 as expect now.

    Code:
    include_directories(/usr/local/include)
    include_directories(/usr/local/include/antlr4-runtime)
    include_directories(/usr/include/)
    include_directories(/usr/include/antlr4-runtime/)
    But I encounter other error instead, I got a lot of this, not sure what it meant.
    Code:
    /home/abuild/rpmbuild/BUILD/quantum-blackbird-0.2.4/blackbird_cpp/Visitor.cpp:262:5: error: control reaches end of non-void function [-Werror=return-type]

  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,713
    Blog Entries
    15

    Default Re: Need help packaging quantum-blackbird (antlr4-common.h: No such file or directory)

    Quote Originally Posted by andythe_great View Post
    I add more directories like this, it found antlr4 as expect now.

    Code:
    include_directories(/usr/local/include)
    include_directories(/usr/local/include/antlr4-runtime)
    include_directories(/usr/include/)
    include_directories(/usr/include/antlr4-runtime/)
    But I encounter other error instead, I got a lot of this, not sure what it meant.
    Code:
    /home/abuild/rpmbuild/BUILD/quantum-blackbird-0.2.4/blackbird_cpp/Visitor.cpp:262:5: error: control reaches end of non-void function [-Werror=return-type]
    Hi
    You need to look at the code at Visitor.cpp line 262 and fix the return to actually mean something, depends on what it's expecting... looks like it gets to the end, all the previous are return val; but no return if it doesn't return val... what is it passing through at that point?

    I see (at https://github.com/XanaduAI/blackbir...pp/Visitor.cpp)

    Code:
    return val;
    }
    ERROR IS HERE! }
    Maybe worth asking upstream, but the expression is documented at line 187...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •