help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] testing glpk 4.62 on a 64-bit platform


From: Chris Matrakidis
Subject: Re: [Help-glpk] testing glpk 4.62 on a 64-bit platform
Date: Wed, 24 May 2017 23:48:32 +0300

Hi Andrew.

>> This assumes that int never has more bits then size_t. This is not
>> guaranteed. The x32 ABI uses 32bit addresses and supports 64bit integers
>> (https://lwn.net/Articles/456731/). It depends on the compiler if int
>> has 32 or 64bit.

I think Heinrich is right to be worried about this.

> This wouldn't resolve the issue, because the glpk code supports only
> ILP32 and LP64 programming models, where int is assumed to be 32-bit;
> this is checked in the routine glp_init_env (see glpk/src/env/env.c).

However, it is easy to guard against this just in case. We can change
the "if (sizeof(void *) != sizeof(size_t))" in minisat1.c to something
like "if (sizeof(void *) != sizeof(size_t) || sizeof(int) >
sizeof(size_t))" which should catch x32 variants with 64 bit ints.

As I said back in March, there is a C interface available for the C++
MiniSat, so it may be possible to hook a more recent version to GLPK.
I am planning to work on this at some point - if there is interest I
can look into it earlier.

Best Regards,

Chris Matrakidis



reply via email to

[Prev in Thread] Current Thread [Next in Thread]