Project

General

Profile

Installing MinGW » History » Version 1

Redmine Admin, 11/19/2015 02:31 PM

1 1 Redmine Admin
# Installing MinGW
2
3
4
# Installing MinGW
5
6
This is slightly experimental, but we have built Vorpal with it, and it is currently our only path to building facetsall.
7
This is for 64 bit only.
8
9
10
* Install the latest compilers from @http://tdm-gcc.tdragon.net/download@.  The webdl installer is recommended.  Assuming the version is 5.1.0-2, install into @C:\TDM-GCC-64\5.1.0-2@.
11
* This should add @C:\TDM-GCC-64\5.1.0-2\bin@ correctly to the end of your Windows path, but one should check.
12
* Most recent attempt required installing binutils to be able to create libraries with the mingw ar.  Will need some more sorting out, as previously found:
13
14
NumPy build failure with incorrect MinGW binutils:
15
16
<pre>
17
generate_def(dll_file, def_file)
18
File "C:\Users\jsalvatier\workspace\numpy\numpy\distutils\mingw32ccompiler.py", line 282, in generate_def
19
raise ValueError("Symbol table not found")
20
</pre>
21
22
23
To make your mingw paths consistent, do
24
<pre>
25
mount binary C:/TDM-GCC-64 /TDM-GCC-64
26
</pre>
27
in the bash shell.
28
29
To make this permanent, put
30
<pre>
31
C:/TDM-GCC-64 /TDM-GCC-64 ntfs binary 0 0
32
</pre>
33
34
as one line in /etc/fstab.
35
36
[Installing ATLAS on Windows] requires that one link the MinGW compilers into /usr/bin as follows for 64-bit
37
38
<pre>
39
cd /usr/bin
40
ln -s /TDM-GCC-64/5.1.0-2/bin/x86_64-w64-mingw32-gcc.exe .
41
ln -s /TDM-GCC-64/5.1.0-2/bin/x86_64-w64-mingw32-g++.exe .
42
ln -s /TDM-GCC-64/5.1.0-2/bin/x86_64-w64-mingw32-gfortran.exe .
43
</pre>
44
45
h1. MPI for MinGW
46
47
These notes have not been upgraded in a while.
48
49
A useful reference is http://www.symscape.com/configure-msmpi-for-mingw-w64.
50
51
* Copy the Microsoft HPC Pack 2008 SDK distribution to a new place:
52
53
<pre>
54
cd /winsame
55
mkdir contrib-mingw
56
cd contrib-mingw
57
mkdir microsoft-hpc-mingw
58
cd microsoft-hpc-mingw
59
cp -R /cygdrive/c/Program\ Files/Microsoft\ HPC\ Pack\ 2008\ SDK/* .
60
</pre>
61
62
* Add @#include <basetsd.h>@ to the copied mpi.h as line 304.
63
* If @msmpi.dll@ is not in @/winsame/contrib-mingw/microsoft-hpc-mingw/Lib/amd64@, there may be a copy of @msmpi.dll@ in @C:\\Windows\\System32@ that you can copy over.  If so, do the following before the above.
64
<pre>
65
cp /cygdrive/c/Windows/System32/msmpi.dll /winsame/contrib-mingw/microsoft-hpc-mingw/Lib/amd64 # For 64 bit, otherwise i386
66
</pre>
67
* Once @msmpi.dll@ is in @/winsame/contrib-mingw/microsoft-hpc-mingw/Lib/amd64@ do the following.
68
69
<pre>
70
cd /winsame/contrib-mingw/microsoft-hpc-mingw/Lib
71
cd amd64
72
/TDM-GCC-64/5.1.0-2/x86_64-w64-mingw32/bin/gendef msmpi.dll # creates msmpi.def
73
/TDM-GCC-64/5.1.0-2/x86_64-w64-mingw32/bin/dlltool -d msmpi.def -l libmsmpi.a -D msmpi.dll 
74
</pre>
75
76
77
The build system for your project then will need to add the flags,
78
79
* @-I/winsame/contrib-mingw/microsoft-hpc-mingw/Include/mpi.h@
80
* @-L/winsame/contrib-mingw/microsoft-hpc-mingw/Lib/amd64 -lmsmpi@
81
82
for compiling and linking.
83
84
85
### MPI for MinGW Fortran ###
86
87
* modify mpif.h add the following as line 9
88
89
<pre>
90
use ISO_C_BINDING
91
</pre>
92
93
Change the line 308 (309 now that you've added the above as line 9) to read
94
95
<pre>
96
PARAMETER (MPI_ADDRESS_KIND=C_INTPTR_T)
97
</pre>
98
99
* modify mpi.f90 to add the following as line 10;
100
101
<pre>
102
use ISO_C_BINDING
103
</pre>
104
105
Change line 311 (312 now that you've added the above as line 10) to read
106
107
<pre>
108
PARAMETER (MPI_ADDRESS_KIND=C_INTPTR_T)
109
</pre>
110
111
and compile to generate the module files:
112
<pre>
113
$ mingw32-gfortran.exe -o mpigf.o -c mpi.f90 && rm mpigf.o
114
</pre>
115
116
The link flags are now:
117
118
* @-L/winsame/contrib-mingw32/microsoft-hpc-mingw/Lib/amd64 -lmsmpifec -lmsmpi@