I just noticed that we solved this for the SimObject but not the stats
wrapper. Could you try adding:

#include <cstddef>
using std::ptrdiff_t;

to src/python/swig/stats.i.

Thanks,

Andreas

On 10/07/2013 18:27, "Zheng Wu" <[email protected]> wrote:

>Hi,
>
>I've used this version of SWIG for and older version of gem5 (changeset:
> 9350:ddb946b131c8) and it works fine. It's just for the most current
>version of gem5.
>
>I could update my SWIG to 2.0.4 but I also want it to be backward
>compatible with the older version of gem5, would the new version of swig
>be a problem for older gem5?
>
>Thanks,
>Zheng Wu
>
>On 2013-07-10, at 12:15 PM, Andreas Hansson <[email protected]>
>wrote:
>
>> I suspect it is the combination of an old version of swig and a recent
>> version of gcc that is causing the issue. Do you have the possibility of
>> using swig 2.0.4 by any chance?
>>
>> Andreas
>>
>> On 10/07/2013 17:10, "Zheng Wu" <[email protected]> wrote:
>>
>>> Hi Andreas,
>>>
>>> I am using the latest version of gem5 dev (change set:
>>>9803:86b426640960)
>>> and SWIG 1.3.40.
>>>
>>> Thanks
>>>
>>> On 2013-07-10, at 12:07 PM, Andreas Hansson <[email protected]>
>>> wrote:
>>>
>>>> What version of gem5 and swig are you using?
>>>>
>>>> On 10/07/2013 15:18, "Zheng Wu" <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am getting the following errors instead now when I compile (scons
>>>>> build/X86/gem5.debug):
>>>>>
>>>>> build/X86/python/swig/stats_wrap.cc:2883:13: error: 'ptrdiff_t' does
>>>>> not
>>>>> name a type
>>>>> build/X86/python/swig/stats_wrap.cc:2920:21: error: expected ';' at
>>>>>end
>>>>> of member declaration
>>>>> build/X86/python/swig/stats_wrap.cc:2920:39: error: expected ')'
>>>>>before
>>>>> 'n'
>>>>> build/X86/python/swig/stats_wrap.cc:2935:34: error: declaration of
>>>>> 'operator+=' as non-function
>>>>> build/X86/python/swig/stats_wrap.cc:2935:30: error: expected ';' at
>>>>>end
>>>>> of member declaration
>>>>> build/X86/python/swig/stats_wrap.cc:2935:44: error: expected ')'
>>>>>before
>>>>> 'n'
>>>>> build/X86/python/swig/stats_wrap.cc:2940:34: error: declaration of
>>>>> 'operator-=' as non-function
>>>>> build/X86/python/swig/stats_wrap.cc:2940:30: error: expected ';' at
>>>>>end
>>>>> of member declaration
>>>>> build/X86/python/swig/stats_wrap.cc:2940:44: error: expected ')'
>>>>>before
>>>>> 'n'
>>>>> build/X86/python/swig/stats_wrap.cc:2945:33: error: declaration of
>>>>> 'operator+' as non-function
>>>>> build/X86/python/swig/stats_wrap.cc:2945:30: error: expected ';' at
>>>>>end
>>>>> of member declaration
>>>>> build/X86/python/swig/stats_wrap.cc:2945:43: error: expected ')'
>>>>>before
>>>>> 'n'
>>>>> build/X86/python/swig/stats_wrap.cc:2950:33: error: declaration of
>>>>> 'operator-' as non-function
>>>>> build/X86/python/swig/stats_wrap.cc:2950:30: error: expected ';' at
>>>>>end
>>>>> of member declaration
>>>>> build/X86/python/swig/stats_wrap.cc:2950:43: error: expected ')'
>>>>>before
>>>>> 'n'
>>>>> build/X86/python/swig/stats_wrap.cc:2955:5: error: 'ptrdiff_t' does
>>>>>not
>>>>> name a type
>>>>> build/X86/python/swig/stats_wrap.cc:3111:23: error:
>>>>> 'SWIG_From_ptrdiff_t'
>>>>> declared as an 'inline' variable
>>>>> build/X86/python/swig/stats_wrap.cc:3111:23: error: 'ptrdiff_t' was
>>>>>not
>>>>> declared in this scope
>>>>> build/X86/python/swig/stats_wrap.cc:3111:23: note: suggested
>>>>> alternatives:
>>>>> /usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++config.h:156:28:
>>>>>note:
>>>>> 'std::ptrdiff_t'
>>>>> /usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++config.h:156:28:
>>>>>note:
>>>>> 'std::ptrdiff_t'
>>>>> build/X86/python/swig/stats_wrap.cc:3112:1: error: expected ',' or
>>>>>';'
>>>>> before '{' token
>>>>> build/X86/python/swig/stats_wrap.cc:3164:39: error: 'ptrdiff_t' has
>>>>>not
>>>>> been declared
>>>>> build/X86/python/swig/stats_wrap.cc: In function 'int
>>>>> SWIG_AsVal_ptrdiff_t(PyObject*, int*)':
>>>>> build/X86/python/swig/stats_wrap.cc:3168:50: error: expected
>>>>> type-specifier before 'ptrdiff_t'
>>>>> build/X86/python/swig/stats_wrap.cc:3168:50: error: expected '>'
>>>>>before
>>>>> 'ptrdiff_t'
>>>>> build/X86/python/swig/stats_wrap.cc:3168:50: error: expected '('
>>>>>before
>>>>> 'ptrdiff_t'
>>>>> build/X86/python/swig/stats_wrap.cc:3168:50: error: 'ptrdiff_t' was
>>>>>not
>>>>> declared in this scope
>>>>> build/X86/python/swig/stats_wrap.cc:3168:50: note: suggested
>>>>> alternatives:
>>>>> /usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++config.h:156:28:
>>>>>note:
>>>>> 'std::ptrdiff_t'
>>>>> /usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++config.h:156:28:
>>>>>note:
>>>>> 'std::ptrdiff_t'
>>>>> build/X86/python/swig/stats_wrap.cc:3168:64: error: expected ')'
>>>>>before
>>>>> ';' token
>>>>> build/X86/python/swig/stats_wrap.cc: At global scope:
>>>>> build/X86/python/swig/stats_wrap.cc:3862:15: error:
>>>>>'swig::check_index'
>>>>> declared as an 'inline' variable
>>>>> build/X86/python/swig/stats_wrap.cc:3862:15: error: 'ptrdiff_t' was
>>>>>not
>>>>> declared in this scope
>>>>> build/X86/python/swig/stats_wrap.cc:3862:15: note: suggested
>>>>> alternatives:
>>>>> /usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++config.h:156:28:
>>>>>note:
>>>>> 'std::ptrdiff_t'
>>>>> /usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++config.h:156:28:
>>>>>note:
>>>>> 'std::ptrdiff_t'
>>>>> build/X86/python/swig/stats_wrap.cc:3862:35: error: expected
>>>>> primary-expression before 'size'
>>>>> build/X86/python/swig/stats_wrap.cc:3862:41: error: expected
>>>>> primary-expression before 'bool'
>>>>> build/X86/python/swig/stats_wrap.cc:3862:60: error: expression list
>>>>> treated as compound expression in initializer [-fpermissive]
>>>>> build/X86/python/swig/stats_wrap.cc:3862:62: error: expected ',' or
>>>>>';'
>>>>> before '{' token
>>>>> build/X86/python/swig/stats_wrap.cc:17818:1: error: expected '}' at
>>>>>end
>>>>> of input
>>>>> scons: *** [build/X86/python/swig/stats_wrap.do] Error 1
>>>>> scons: building terminated because of errors.
>>>>>
>>>>>
>>>>>
>>>>> On 2013-07-10, at 10:00 AM, Zheng Wu <[email protected]> wrote:
>>>>>
>>>>>> Sorry Please Ignore this emailÅ I did something stupid...
>>>>>>
>>>>>>
>>>>>> On 2013-07-10, at 9:58 AM, Zheng Wu <[email protected]> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I've the most current version of the gem5 dev code ( change set:
>>>>>>> 9803:86b426640960) and when I try to compile (scons
>>>>>>> build/X86/gem5.opt), I get the following errors:
>>>>>>>
>>>>>>> build/X86/mem/cache/tags/base.cc: In member function 'virtual void
>>>>>>> BaseTags::regStats()':
>>>>>>> build/X86/mem/cache/tags/base.cc:95:25: error: invalid use of
>>>>>>>member
>>>>>>> (did you forget the '&' ?)
>>>>>>> build/X86/mem/cache/tags/base.cc:100:22: error: invalid use of
>>>>>>>member
>>>>>>> (did you forget the '&' ?)
>>>>>>> scons: *** [build/X86/mem/cache/tags/base.o] Error 1
>>>>>>> scons: building terminated because of errors.
>>>>>>>
>>>>>>> Does anyone else have this problem?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Zheng Wu
>>>>>>> _______________________________________________
>>>>>>> gem5-users mailing list
>>>>>>> [email protected]
>>>>>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>>>>
>>>>>> _______________________________________________
>>>>>> gem5-users mailing list
>>>>>> [email protected]
>>>>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>>>
>>>>> _______________________________________________
>>>>> gem5-users mailing list
>>>>> [email protected]
>>>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>>>
>>>>
>>>>
>>>> -- IMPORTANT NOTICE: The contents of this email and any attachments
>>>>are
>>>> confidential and may also be privileged. If you are not the intended
>>>> recipient, please notify the sender immediately and do not disclose
>>>>the
>>>> contents to any other person, use it for any purpose, or store or copy
>>>> the information in any medium.  Thank you.
>>>>
>>>> _______________________________________________
>>>> gem5-users mailing list
>>>> [email protected]
>>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>
>>> _______________________________________________
>>> gem5-users mailing list
>>> [email protected]
>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>
>>
>>
>> -- IMPORTANT NOTICE: The contents of this email and any attachments are
>>confidential and may also be privileged. If you are not the intended
>>recipient, please notify the sender immediately and do not disclose the
>>contents to any other person, use it for any purpose, or store or copy
>>the information in any medium.  Thank you.
>>
>> _______________________________________________
>> gem5-users mailing list
>> [email protected]
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
>_______________________________________________
>gem5-users mailing list
>[email protected]
>http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>


-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium.  Thank you.

_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to