Project

General

Profile

Actions

Installing MinGW

This is slightly experimental, but we have built Vorpal with it, and it is currently our only path to building facetsall.

This is for 64 bit only.

  • 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.
  • This should add C:\TDM-GCC-64\5.1.0-2\bin correctly to the end of your Windows path, but one should check.
  • 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:

NumPy build failure with incorrect MinGW binutils:

generate_def(dll_file, def_file)
File "C:\Users\jsalvatier\workspace\numpy\numpy\distutils\mingw32ccompiler.py", line 282, in generate_def
raise ValueError("Symbol table not found")

To make your mingw paths consistent, do

mount binary C:/TDM-GCC-64 /TDM-GCC-64

in the bash shell.

To make this permanent, put

C:/TDM-GCC-64 /TDM-GCC-64 ntfs binary 0 0

as one line in /etc/fstab.

[Installing ATLAS on Windows] requires that one link the MinGW compilers into /usr/bin as follows for 64-bit:

cd /usr/bin
ln -s /TDM-GCC-64/5.1.0-2/bin/x86_64-w64-mingw32-gcc.exe .
ln -s /TDM-GCC-64/5.1.0-2/bin/x86_64-w64-mingw32-g++.exe .
ln -s /TDM-GCC-64/5.1.0-2/bin/x86_64-w64-mingw32-gfortran.exe .

MPI for MinGW

These notes have not been upgraded in a while.

A useful reference is http://www.symscape.com/configure-msmpi-for-mingw-w64.

  • Copy the Microsoft HPC Pack 2008 SDK distribution to a new place:
cd /winsame
mkdir contrib-mingw
cd contrib-mingw
mkdir microsoft-hpc-mingw
cd microsoft-hpc-mingw
cp -R /cygdrive/c/Program\ Files/Microsoft\ HPC\ Pack\ 2008\ SDK/* .
  • Add #include <basetsd.h> to the copied mpi.h as line 304.
  • 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\System321 that you can copy over. If so, do the following before the above.
cp /cygdrive/c/Windows/System32/msmpi.dll /winsame/contrib-mingw/microsoft-hpc-mingw/Lib/amd64 # For 64 bit, otherwise i386
  • Once msmpi.dll is in /winsame/contrib-mingw/microsoft-hpc-mingw/Lib/amd64 do the following:
cd /winsame/contrib-mingw/microsoft-hpc-mingw/Lib
cd amd64
/TDM-GCC-64/5.1.0-2/x86_64-w64-mingw32/bin/gendef msmpi.dll # creates msmpi.def
/TDM-GCC-64/5.1.0-2/x86_64-w64-mingw32/bin/dlltool -d msmpi.def -l libmsmpi.a -D msmpi.dll 

The build system for your project then will need to add the flags

  • -I/winsame/contrib-mingw/microsoft-hpc-mingw/Include/mpi.h
  • -L/winsame/contrib-mingw/microsoft-hpc-mingw/Lib/amd64 -lmsmpi

for compiling and linking.

MPI for MinGW Fortran

  • modify mpif.h by adding the following as line 9:
use ISO_C_BINDING

Change the line 308 (309 now that you've added the above as line 9) to read

PARAMETER (MPI_ADDRESS_KIND=C_INTPTR_T)
  • modify mpi.f90 by adding the following as line 10:
use ISO_C_BINDING

Change line 311 (312 now that you've added the above as line 10) to read

PARAMETER (MPI_ADDRESS_KIND=C_INTPTR_T)

and compile to generate the module files:

$ mingw32-gfortran.exe -o mpigf.o -c mpi.f90 && rm mpigf.o

The link flags are now:

  • -L/winsame/contrib-mingw32/microsoft-hpc-mingw/Lib/amd64 -lmsmpifec -lmsmpi

Updated by Redmine Admin about 9 years ago · 2 revisions