[Disksim-users] building Disksim-4.0 issues

Michael Stroucken stroucki at ece.cmu.edu
Tue Mar 27 17:38:31 EDT 2012


(cc to group)

Qingpeng Niu wrote:
> Hi
> My gcc version is 4.6.1 and my bison version is 2.4.1.

Hi Qingpeng,

The code was written several years ago, and is not currently maintained 
to follow updates to the C understood by gcc. Thanks for providing some 
assistance.

> When do make in Disksim main folder. There will be two main problems 
> need to fix. 1 Some math library can not be found due to library 
> dependency on math library.
>
> Solution Search LDFLAGS in each Makefile and put -lm at the end of 
> LDFLAGS or link sequence.
Can you provide more details on this? What function is it not finding? I 
don't have gcc-4.6 at hand right now to test.
> **
> *
> *
> 2 src/disksim_iosim.c:712:4: error: duplicate case value
> disksim_iosim.c:712:4: error: previously used here
> Due to StaticAssert (sizeof(ioreq_event) <= DISKSIM_EVENT_SIZE);
> Where* #define StaticAssert(c) switch (c) case 0: case (c): *
> What is the meaning of this StaticAssert.  I do not understand the 
> meaning of this assert. If c is 0, because there is no break, it will 
> still go to case(c). If c is not 0, it directly go to case(c). It 
> sounds to me this is totally no use. So just comment it. Then 
> everything works fine and compile successful.
> Is this actually a code bug?
> Hopes developer can fix this in Makefile and disksim_iosim.c if this 
> is a code bug. 

This provides a way of having compilation fail after preprocessing. If 
the condition is false (c == 0), the code will be "switch(0) case 0: 
case 0:", which is invalid because there are two case statements with 
the same label.

If you are hitting this, it means your structures are larger than 
expected by the developers. Are you running on a 64 bit system? AFAIK, 
disksim will only work on a 32 bit system.

Greetings,
Michael.




More information about the Disksim-users mailing list