Re: [Help-glpk] 64-bit with Mac G5

2005-04-19 Thread Andrew Makhorin
> how can I change the glpk source code to generate the stand alone glpsol
> for my Mac G5 with 64-bit?
> According the Changelog, I need only to define the GLPHUGEMEM preprocessor
> variable in glplib2.c, but I did not found this variable in this file.
> Anyone can help me?

You need to define _GLPLIB_HUGEMEM used in glplib2.c. This only
will prevent umalloc/ucalloc/ufree from checking the available memory
that, by default, is limited by INT_MAX bytes (about 2GB on 32-bit
machines).

Note that *all* integer quantities in Glpk routines are declared
as `int' under the only assumption that sizeof(int) >= 4; so, if you
are able to compile Glpk in such a way that sizeof(int) is 8 (rather
than 4 on 32-bit platforms), no changes/definitions are needed at all.
(May be replacing `int' by `long int' during compilation is a most
natural way to port Glpk on a 64-bit machine, however, I've never
tried that.)

Andrew Makhorin




___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


RE: [Help-glpk] 64-bit with Mac G5

2005-04-19 Thread Marcos Roberto Silva
Dear Andrew,

"(May be replacing `int' by `long int' during compilation is a most
natural way to port Glpk on a 64-bit machine, however, I've never
tried that.)"

Can I do this only with compiler flags?

Thank you very much.

Marcos Roberto Silva

PS.: I am using gcc-3.3 for MAC.






___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] 64-bit with Mac G5

2005-04-19 Thread Andrew Makhorin
Hi Marcos,

> "(May be replacing `int' by `long int' during compilation is a most
> natural way to port Glpk on a 64-bit machine, however, I've never
> tried that.)"
> 
> Can I do this only with compiler flags?

I don't know because I don't have a 64-bit machine. Looks like gcc
translates `int' as well as `long int' to 32-bit integers, and only
`long long int' to 64-bit integers; however, it seems to me there is
no compiler flag to change `int' to `long long int'.

Regards,

Andrew Makhorin




___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


RE: [Help-glpk] 64-bit with Mac G5

2005-04-19 Thread Marcos Roberto Silva
Dear Andrew,
unfortunately the definition of the variable _GLPLIB_HUGEMEM of glplib2.c does 
not work for me.
The error output was:

*** malloc: vm_allocate(size=8421376) failed (error code=3)
*** malloc[3857]: error: Can't allocate region
umalloc: size = 8000; malloc failed

Thank you very much.
Best regards.

Marcos

-Original Message-
From:   Andrew Makhorin [mailto:[EMAIL PROTECTED]
Sent:   Tue 4/19/2005 4:44 PM
To: Marcos Roberto Silva
Cc: help-glpk@gnu.org
Subject:        Re: [Help-glpk] 64-bit with Mac G5
Hi Marcos,

> "(May be replacing `int' by `long int' during compilation is a most
> natural way to port Glpk on a 64-bit machine, however, I've never
> tried that.)"
> 
> Can I do this only with compiler flags?

I don't know because I don't have a 64-bit machine. Looks like gcc
translates `int' as well as `long int' to 32-bit integers, and only
`long long int' to 64-bit integers; however, it seems to me there is
no compiler flag to change `int' to `long long int'.

Regards,

Andrew Makhorin








___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk