[gecode-users] Compiling Gecode under native Windows using the Mingw g++ 32-bit compiler [solved]
Richard Croad
richard.croad at gmail.com
Fri Jan 25 08:11:03 CET 2013
I have been able to compile and run a fair sample of the gecode examples on
a Windows 7 (Dell computer with a core i7 Intel microprocessor) using the
Mingw g++ 32-bit (GCC) compiler version 4.6.2 and GNU make version 3.8.1.
Native Windows executables were created without the need for Cygwin. All
steps were carried out in a Msys window. The required steps are:
Run configure as follows:
./configure --with-host-os=windows CC=gcc CXX=g++
Manually modify the following lines in
".\gecode-3.7.3\gecode\support\config.hpp" as follows:
/* Whether unistd.h is available */
/* Manually commented out -- #define GECODE_HAS_UNISTD_H 1 */
/* Whether we have posix threads */
/* Manually commented out -- #define GECODE_THREADS_PTHREADS 1 */
Note that GECODE_THREADS_WINDOWS remains defined so that the Windows threads
will be used.
Manually modify the following inline module in
".\gecode-3.7.3\gecode\int\sorted\sortsup.hpp" as follows (the comments
preceding the code snippet explains the reasons for this change):
/* Int "small" was modified to "small_" to eliminate an unexpected
unqualified-id error when compiling using the Mingw g++ comiler version
4.6.2; the underlying cause of this compiler error has not been determined.
Int "large" was modified to "large_" purely for aesthetic reasons alongside
"small_".
*/
forceinline void
OfflineMin::unite(int a, int b, int c) {
// c is the union of a and b
int ra = sequence[a].root;
int rb = sequence[b].root;
int large_ = rb;
int small_ = ra;
if (sequence[ra].rank > sequence[rb].rank) {
large_ = ra;
small_ = rb;
}
sequence[small_].parent = large_;
sequence[large_].rank += sequence[small_].rank;
sequence[large_].name = c;
sequence[c].root = large_;
}
Run make in the normal way. The static libraries "*.a" will be placed in
the gecode-3.7.3 folder, and the example executables will be found
".\gecode-3.7.3\examples" folder.
Copy "libgcc_s_dw2-1.dll" and "libstdc++-6.dll" dynamic link library files
from the bin folder in Mingw to the ".\gecode-3.7.3\examples" folder (along
with the executables)
Run the examples in the Msys window; they should all work.
I have not attempted to compile Gist.
Cheers . Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20130125/1b3cfa52/attachment.html>
More information about the users
mailing list