在 Windows 下编译运行 MUMPS

原文连接:http://matrixprogramming.com/2011/12/mumps-4-10-0-with-winmumps

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 directoryD:\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 directoryd:\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.0mpi.h fromD:\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 likeD:\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 thesolution.mtx file. Current version supports only symmetric matricies.

Hope you compiled it successfully!
All the best


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值