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

7 responses to “Compiling MUMPS 4.10.0 with WinMumps using Visual Studio 2008 and Intel”

Comments are now closed
  1. Henry says:

    Hello,I’m a college student! Now,I want to use MUMPS package on Windows platform,and I use it according to this article,but there is an error when run winmumps_generator.py,and I can not solve this problem!So,I need your help!My E-mail is hwalei@qq.com, I’m looking forward to your reply!
    Best regards!

  2. You may want to ask this question at the MUMPS discussion list.

  3. yan says:

    hello everybody, can you help me!

    when I follow the above steps, the compiler gives the following error, i don’t know what has happend.

    1>ssimpletest.obj : error LNK2019: unresolved external symbol _MPI_INIT referenced in function _MAIN__
    1>ssimpletest.obj : error LNK2019: unresolved external symbol _SMUMPS referenced in function _MAIN__
    1>ssimpletest.obj : error LNK2019: unresolved external symbol _MPI_FINALIZE referenced in function _MAIN__
    1>Debug\Console1.exe : fatal error LNK1120: 3 unresolved externals

    My platform is win7 64 +vs 2008 +ivf +mumps 4.0 +winmumps.

    please help me!!!

  4. LING DS says:

    Just add MSMPI.LIB (for WIN64) to the list of additional libraries.

  5. santa's little helper says:

    @ yan:
    Hi Yan, I have the same problem. You are probably changed something in MumpsSolver.cpp file because I head 4 LNK 2019 errors (one more for MPI rank).
    If you done everything like on this site the problem might be on console that u start.
    I head that LNK problem when I started (accidentally) 32bit console from vs tools. Try to go on Visual Studio Tools from start menu and than start Visual Studio x64 Command prompt (or if you have something similar to this) and this command prompt will load any unnecessary libs for compiling x64 mumps solver.

  6. DS Ling says:

    I wander how to get parallel version of MUMPS using WinMUMPS. Please…

  7. The best if you ask your question on the MUMPS discussion list.