Trusster Forums » Technical Support

Teal build error Fedora

(16 posts)
  • Started 7 months ago by shakthimaan
  • Latest reply from germanattanasio

  1. shakthimaan
    Member

    I am trying to build Teal (teal_1_40b.tar.gz) on Fedora 12 using gcc 4.4.2:

    $ export SIMULATOR_HOME=/usr

    $ ARCH=Linux make SIM=ivl
    gcc -c -fPIC ./teal_reg.cpp -o ./teal_reg.o -Wall -Dvpi_2_0 -DSIM=ivl -Divl -I. -I/usr/include -I/usr/pli_incs -I/usr/pli/interface
    In file included from ./teal.h:136,
    from ./teal_reg.cpp:32:
    ./teal_vout.h:149: warning: ‘typedef’ was ignored in this declaration
    In file included from ./teal.h:137,
    from ./teal_reg.cpp:32:
    ./teal_reg.h:95: warning: ‘typedef’ was ignored in this declaration
    ./teal_reg.cpp:391: error: ‘bool teal::operator==(const teal::reg&, const teal::reg&)’ should have been declared inside ‘teal’
    ./teal_reg.cpp:398: error: ‘teal::reg::four_state teal::triple_equal(const teal::reg&, const teal::reg&)’ should have been declared inside ‘teal’
    ./teal_reg.cpp:428: error: ‘teal::reg::four_state teal::operator<(const teal::reg&, const teal::reg&)’ should have been declared inside ‘teal’
    make: *** [teal_reg.o] Error 1

    Has anyone been able to successfully build Teal on *nix? Please let me know how to proceed.

    Posted 7 months ago #
  2. moogyd
    Member

    Hi,

    I'm not a C++ expert, but this problem can be fixed by editing the Makefiles to add the --friend_injection option gcc.

    Let me know if you manage to get everything running under Fodora - I am at a deadend under Ubuntu :-()

    Steven

    Posted 6 months ago #
  3. Mike Mintz
    Key Master

    Hi,

    Sorry for the delay in a response. Our notification system is broken.

    I have seen this error "should have been declared inside ‘teal’". It has to do with the newer gcc. I actually think its a bug, because its not overleading the scope correctly.

    Anyway, to fix it, add the global scope resolution operator on the function names:
    friend four_state ::teal::triple_equal (const reg& lhs, const reg& rhs);
    friend bool ::teal::operator== (const reg& lhs, const reg& rhs);
    friend four_state ::teal::operator< (const reg& lhs, const reg& rhs); //Should be bool?

    Take care,
    Mike

    Posted 4 months ago #
  4. daveW
    Member

    All

    I'm having one file fail on a Teal build on SUSE 10.2 with gcc 4.1.2. The build will work if I remove 'teal_vreg.cpp'.

    Here is some of the error message...using 'make -d'. It is ugly.. and I'm seeking some help.

    :char_traits<char>, _Alloc = std::allocator<char>]()’
    ./teal_vout.h:131: note: candidates are: virtual teal::vout&teal::vout::operator<<(char)
    ./teal_vout.h:132: note: virtual teal::vout& teal::vout::operator<<(int)
    ./teal_vout.h:133: note: virtual teal::vout& teal::vout::operator<<(unsigned int)
    ./teal_vout.h:134: note: virtual teal::vout& teal::vout::operator<<(long int)
    ./teal_vout.h:135: note: virtual teal::vout& teal::vout::operator<<(long long unsigned int)
    ./teal_vout.h:136: note: virtual teal::vout& teal::vout::operator<<(const std::string&) <near match>
    ./teal_vout.h:137: note: virtual teal::vout& teal::vout::operator<<(double)
    ./teal_vout.h:159: note: teal::vout& teal::vout::operator<<(teal::vout& (*)(teal::vout&)) <near match>
    ./teal_reg.h:191: note: teal::vout& teal::operator<<(teal::vout&, teal::reg::four_state) <near match>
    ./teal_reg.h:188: note: teal::vout& teal::operator<<(teal::vout&, const teal::reg&)
    Reaping losing child 0x0064c140 PID 5951
    make: *** [teal_vreg.o] Error 1
    Removing child 0x0064c140 PID 5951 from chain.

    This is using a recent 1_40b Teal archive. Scope resolution ("teal:: ") looks to be in place.

    cheers,

    Dave

    Posted 3 months ago #
  5. Robert Ekendahl
    Key Master

    Dave,

    Mike's on vacation and I must confess I don't have teal for c++ running currently on any of my computers. I'm sure Mike will be able to help you as soon as he gets back later this week.

    /Robert

    Posted 3 months ago #
  6. daveW
    Member

    Robert

    OK - that should work. Again the error appears to be related to one file - 'teal_vreg.cpp'. Remove this file in the 'makefile' and it builds successfully.
    Thank you for your quick response.

    Dave

    Posted 3 months ago #
  7. daveW
    Member

    Robert

    I hacked on this some the other night and boiled it down to line 150 (or within a few lines) in 'teal_vreg.cpp'. Seems to be a problem with the call to 'path_and_name_.size ()'. When commenting this out, I can successfully build the library.

    Hey, I'm enjoying your book - HW verification with C++.
    You guys are trailblazers.

    Dave

    Posted 3 months ago #
  8. Mike Mintz
    Key Master

    Hi Dave,

    I think it's this line:
    local_log << teal_error << "Unable to get handle for \"" << path_and_name_ << "\" size:" << (unsigned)path_and_name_.size () << endm;

    If so that would be my stupid hack to get 32 bit working with .size().

    Just remove the (unsigned) cast.

    I am happy that you are finding the book useful.

    Take Care,
    mike

    -- The details --
    The issue is that I did not do a signed uint64 operator<< for teal_vout. You can change the size_t operator<<() to be the correct form:

    virtual vout& operator<< (long long int x) {return operator<< ( (unsigned long long) x);}

    Sorry about that.

    Posted 3 months ago #
  9. shakthimaan
    Member

    I am now using teal_1_40b with gcc 4.4.4 on Fedora 13. Where should I include the following?

    Anyway, to fix it, add the global scope resolution operator on the function names:

    friend four_state ::teal::triple_equal (const reg& lhs, const reg& rhs);
    friend bool ::teal::operator== (const reg& lhs, const reg& rhs);
    friend four_state ::teal::operator< (const reg& lhs, const reg& rhs); //Should be bool?
    Posted 1 month ago #
  10. Mike Mintz
    Key Master

    Hi,

    start at line 117.

    Alternatively you could search for triple_equal

    Take Care,
    Mike

    Posted 1 month ago #
  11. admin
    Key Master

    There's an article on the site describing how to get read-only access to the SVN repository. It can be found at http://www.trusster.com/truss/howto-configure-svn-for-read-only-access/ . If you have trouble, let me or Mike know.

    Posted 1 month ago #
  12. shakthimaan
    Member

    I have the following in teal_reg.h and I still get the same error:

    //logic
    friend four_state ::teal::triple_equal (const reg& lhs, const reg& rhs);
    friend bool ::teal::operator== (const reg& lhs, const reg& rhs);
    friend four_state ::teal::operator< (const reg& lhs, const reg& rhs); //Should be bool?
    friend four_state reduce_xor (const reg&);

    ./teal_reg.cpp:391: error: ‘bool teal::operator==(const teal::reg&, const teal::reg&)’ should have been declared inside ‘teal’
    ./teal_reg.cpp:398: error: ‘teal::reg::four_state teal::triple_equal(const teal::reg&, const teal::reg&)’ should have been declared inside ‘teal’
    ./teal_reg.cpp:428: error: ‘teal::reg::four_state teal::operator<(const teal::reg&, const teal::reg&)’ should have been declared inside ‘teal’

    Posted 1 month ago #
  13. Mike Mintz
    Key Master

    Hi,

    Humm, can I believe some revs of gcc want the declaration also in the teal scope. Can you add the following starting at line 309?

    reg::four_state triple_equal (const reg& lhs, const reg& rhs);
    bool operator== (const reg& lhs, const reg& rhs);
    reg::four_state operator< (const reg& lhs, const reg& rhs);

    Sorry about this.

    Take Care,
    mike

    Posted 1 month ago #
  14. shakthimaan
    Member

    Can you please let me know line 309 in which file? In teal_reg.cpp line 309 contains:

    //now clean off any whole word parts, I am zero above assignment
    if (i < word_length_) {
    //work to do
    for (; i < word_length_; i++) {
    // std::cout << "teal::reg::operator=() clearing word =" << i << std::endl;
    teal_acc_vecval_[i].aval = 0;
    teal_acc_vecval_[i].bval = 0;
    }
    }

    In teal_reg.h the last line is only 286. If you could create a patch, with the required changes it will be easy to follow than replying with snippets. This is also the reason why I like mailing lists for easier discussions and follow-up. I am using teal_1_40b.tar.gz. Thanks!

    Posted 1 month ago #
  15. Mike Mintz
    Key Master

    Hi,

    There are actually two patches:

    *** teal_reg.h.new 2010-06-28 14:47:39.000000000 -0400
    --- teal_reg.h 2006-05-18 08:34:00.000000000 -0400
    *************** EVEN IF ADVISED OF THE POSSIBILITY OF SU
    *** 110,117 ****
    char to_int (uint32 b) const; //extract one bit (WARNING: Drops X/Z, see operator(uint32))

    //logic
    ! friend four_state ::teal::triple_equal (const reg& lhs, const reg& rhs);
    ! friend bool ::teal::operator== (const reg& lhs, const reg& rhs);
    friend four_state operator< (const reg& lhs, const reg& rhs); //Should be bool?
    friend four_state reduce_xor (const reg&);

    --- 110,117 ----
    char to_int (uint32 b) const; //extract one bit (WARNING: Drops X/Z, see operator(uint32))

    //logic
    ! friend four_state triple_equal (const reg& lhs, const reg& rhs);
    ! friend bool operator== (const reg& lhs, const reg& rhs);
    friend four_state operator< (const reg& lhs, const reg& rhs); //Should be bool?
    friend four_state reduce_xor (const reg&);

    *************** EVEN IF ADVISED OF THE POSSIBILITY OF SU
    *** 284,290 ****
    friend vout& operator<< (vout&, const vreg&);
    };
    vout& operator<< (vout&, const vreg&);
    -
    - reg::four_state triple_equal (const reg& lhs, const reg& rhs);
    - bool operator== (const reg& lhs, const reg& rhs);
    - reg::four_state operator< (const reg& lhs, const reg& rhs); //Should be bool?
    --- 284,286 ----

    -and -
    *** teal_vreg.cpp.new 2010-06-28 14:45:41.000000000 -0400
    --- teal_vreg.cpp 2010-06-28 14:45:28.000000000 -0400
    *************** void teal::vreg::connect_ () {
    *** 143,149 ****

    #if defined (vpi_2_0)
    if (! handle_) {
    ! local_log << teal_error << "Unable to get handle for \"" << path_and_name_ << "\" size:" << (int)path_and_name_.size () << endm;
    vpi_control (vpiFinish);
    }

    --- 143,149 ----

    #if defined (vpi_2_0)
    if (! handle_) {
    ! local_log << teal_error << "Unable to get handle for \"" << path_and_name_ << "\" size:" << path_and_name_.size () << endm;
    vpi_control (vpiFinish);
    }

    Posted 1 month ago #
  16. germanattanasio
    Member

    In order to fix "should have been declared inside ‘teal’" on Ubuntu.
    I had to:
    0. Checkout the code from subversion repositories.
    1. Install gcc-4.1 and g++-4.1 from Synaptic.
    2. change SYS_ARCH_CC to use gcc-4.1.

    http://www.trusster.com/truss/howto-configure-svn-for-read-only-access/

    Posted 1 week ago #

RSS feed for this topic

Reply

You must log in to post.