Re: testing glpk 4.62 on a 64-bit platform

Chris Matrakidis <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <CAEaJ3S7skB3scV_Ojq=rQ50skZ8HeUDmmtjV1DMmB_QaW8ucrA@mail.gmail.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.