Compiling MUMPS 4.10.0 with WinMumps using Visual Studio 2008 and Intel

Domen Stadler

Files are in /files/contrib/domen.stadler/

For startes, this work was performed on the Windows XP 32 bit computer, but there is no reason to occur any troubles on other windows platforms. To be able to compile, one would need following software:

-MUMPS source code (http://graal.ens-lyon.fr/MUMPS/) (tried with versions 4.8.0 and 4.10.0),
-WinMUMPS package (http://sourceforge.net/projects/winmumps/) (previous versions have support for VS2005, VS2008 and VS2010, while current have support only for VS2005 and VS2010),
-Visual Studio (http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-expres) (I used 2008 Pro version, but i think it will work with any of 2005+ version even Express edition),
-Intel Visual Fortran Composer XE for Windows (http://software.intel.com/en-us/articles/intel-software-evaluation-center/) (I used trial version).
-python (http://www.python.org/getit/releases/2.6/)(I used version 2.6)

Once you have installed VS and Intel Fortran (it is recommended to install Intel MKL also – I know that I did) and unpacked MUMPS and WinMUMPS, you have very little things to do. I copied MUMPS source code into the dir D:\WinMUMPS\MUMPS_4.10.0. Also I have created directory D:\WinMUMPS\output. Then i opened command line, move to the directory D:\WinMUMPS\ and executed winmumps_generator.py with command:

winmumps_generator.py --winmumpsdir=D:\WinMUMPS\output --mumpsdir=D:\WinMUMPS\MUMPS_4.10.0 --msvc=8 --intelfortran=9

If you use winmumps_generator.py --help you should get all possible options for WinMUMMPS generator.

I was not sure which version of intel fortran I installed, but when you open fortran projects with Visual Studio, it automatically converts projects to the current version.

Build all projects in the D:\WinMUMPS\output (there should be 5 fortran projects – *.vfproj – and 7 Visual Studio c++ projects -*.vcproj). Builded libraries should be in the directory d:\WinMUMPS\MUMPS_4.10.0\lib\Debug\Win32.

I created new directory (let it be d:\MUMPS_test) and copied libraires to this directory. I also copied dmumps_c.h from d:\WinMUMPS\MUMPS_4.10.0, mpi.h from D:\WinMUMPS\MUMPS_4.10.0\libseq and the MumpsSolver.cpp to this new directory. Then I copied all Intel libraries to the directory without any blank spaces (something like D:\Intel\libs – to be on the safe side when I specified library paths to the compiler).

Now open Visual Studio command prompt. Go to the directory mscv\Common7\Tools and execute vsvars32.bat. Move to the directory D:\MUMPS_test or whatever directory you created for this example. Check again if you have all MUMPS libraries, MumpsSolver.cpp, mpi.h and dmumps_.h in this directory. Next thing to do is to compile MumpsSolver.cpp with command

cl -O2 -EHsc -MD -D_SECURE_SCL=0 -c MumpsSolver.cpp

If you used subfolder for header files, you should use -I headers before -O2 switch.

Next thing is to link MumpsSolver.obj with all needed libraries with command

cl MumpsSolver.obj dmumps_c.lib dmumps_fortran.lib mumps_common_c.lib pord_c.lib libseq_c.lib libseq_fortran.lib mkl_intel.lib mkl_thread_intel.lib mkl_core.lib libiomp5md.lib ifconsol.lib /link /LIBPATH:D:\Intel\libs /NODEFAULTLIB:MSVCRTD

You will get MumpsSolver.exe and MumpsSolver.exe.manifest. If you want to use mumps solver, you should have both files in the same directory. Usage of the MumpsSolver is

MumpsSolver matrix.mtx RHSvector.mtx solution.mtx

It will read matrix.mtx and RHSvector.mtx, solve the problem and write the solution to the solution.mtx file. Current version supports only symmetric matricies.

Hope you compiled it successfully!
All the best

P.S. (ER) If you have question about WinMUMPS, please post them to the MUMP discussion list:

https://listes.ens-lyon.fr/sympa/arc/mumps-users


Comments are closed.