Skip to content

Commit 3d9d162

Browse files
committed
cross compile on windows script
Former-commit-id: a071056 [formerly 18c8fc0] Former-commit-id: 97e2f3c
1 parent 5e10370 commit 3d9d162

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

scripts/buildCBCWin.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
PREFIX="x86_64-w64-mingw32-"
2+
export CC=${PREFIX}gcc
3+
export FC=${PREFIX}gfortran
4+
export CXX=${PREFIX}c++
5+
export LD=${PREFIX}ld
6+
export AR=${PREFIX}ar
7+
export AS=${PREFIX}as
8+
export NM=${PREFIX}nm
9+
export STRIP=${PREFIX}strip
10+
export RANLIB=${PREFIX}ranlib
11+
export DLLTOOL=${PREFIX}dlltool
12+
export OBJDUMP=${PREFIX}objdump
13+
export RESCOMP=${PREFIX}windres
14+
export MINGWROOT=/usr/x86_64-w64-mingw32/
15+
16+
export CXXFLAGS="-Ofast -fPIC -flto -m64 -DNDEBUG -fprefetch-loop-arrays -static"
17+
export CFLAGS="-Ofast -fPIC -flto -m64 -DNDEBUG -fprefetch-loop-arrays -static"
18+
export FCFLAGS="-Ofast -fPIC -flto -m64 -DNDEBUG -fprefetch-loop-arrays -static"
19+
export F77FLAGS="-Ofast -fPIC -flto -m64 -DNDEBUG -fprefetch-loop-arrays -static"
20+
export LDFLAGS="-Ofast -static -fPIC -flto -m64 -Bstatic -lgfortran -static-libgcc -static-libgfortran -static-libstdc++"
21+
22+
cd ~/src/cbctrunk/
23+
24+
$(CXX) \
25+
-I/opt/w64/include/coin/ -L/opt/w64/lib/coin/ \
26+
-I${MINGWROOT}/include/ $(CXXFLAGS) \
27+
-mdll -shared -DCBC_THREAD ~/src/cbctrunk/Cbc/src/Cbc_C_Interface.cpp $(LDFLAGS) \
28+
-o ~/git/mip/mip/libraries/cbc-c-windows-x86-64.dll
29+

test/mip_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def test_tsp(solver: str):
117117
Aout = {n: [a for a in A if a[0] == n] for n in N}
118118
Ain = {n: [a for a in A if a[1] == n] for n in N}
119119
m = Model(solver_name=solver)
120-
m.verbose = 0
120+
m.verbose = 1
121121

122122
x = {a: m.add_var(name='x({},{})'.format(a[0], a[1]),
123123
var_type=BINARY) for a in A}

0 commit comments

Comments
 (0)