Volker Pittlik wrote:I tried to compile and run the latest version of scorpio here in my linux 64 bit machine. I'm using gcc 4.2.3.
Changing the data model in scorpio.h did not show the expected effect.
Setting DATA_MODEL to 2 does not compile at all. Using 3 and 4 compiles but results in a segmentation fault at runtime. Has someone been successful?
Regards
Volker
I did not try a linux build yet (maybe I will make one tonight). It works fine under 64 bit Windows using MS VC++ with the default model of 1. I did a PGO build and it performs very well.
I guess that if you are using GCC then you should use data model 1 or 3:
#if DATA_MODEL == 0
# define BMP32 long
# define BMP64 long long
#elif DATA_MODEL == 1
# define BMP32 int
# define BMP64 long long
#elif DATA_MODEL == 2
# define BMP32 __int32
# define BMP64 long
#elif DATA_MODEL == 3
# define BMP32 int
# define BMP64 long long
#elif DATA_MODEL == 4
# define BMP32 int
# define BMP64 long
#else
#error Define Data model number (0 - 4)
#endif
That is because GCC needs long long for 64 bit integer (at least on the platforms I know about). We have 64 bit Linux here so I could give it a go later on tonight.
A simple way to test that your choice is right is to add this assert to the start of main():
assert(sizeof BMP32 >= 4);
assert(sizeof BMP64 >= 8);
If either assert fires, then there is no way that the code can work.
Are you using GCC or Intel or some other compiler?