繼續下去做的。
原文
- Download the LAPACK precompiled binaries for MinGW. You should have a two files: liblapack.lib andliblapack.dll (libblas.lib libblas.dll if you also want the Reference BLAS) .
- OPTIONAL: Obtain a tuned version of BLAS for your machine (refer to "Compiling GotoBLAS").
- Create a Visual Studio project with the following sample C program:
- For C++ program, rename the prototypes in the above program to
void dgesv_( ) void dgels_( ) to extern "C" void dgesv_( ) extern "C" void dgels_( )- Add the the BLAS and LAPACK libraries to the Visual Studio project settings,
under Linker -> General -> Additional Library Directories: the directory where your liblapack.lib is.
under Linker -> Input -> Additional Dependencies: libblas.lib;liblapack.lib (For example, on my machine, I am using the Reference BLAS)
Note: because BLAS libraries commonly provide faster versions of some LAPACK subroutines, the BLAS library must be listed before before LAPACK library.
Note: make sure that all the dll (BLAS, LAPACK, MinGW dlls) are on your system path or copy them in the WINDOWS\system32 folder, else binary won't run.- Compile the project and run the resulting executable. You should get the output: The solution is
-0.661082 9.456125 -16.014625
1. 上一篇做完後,其實第一步已經完成了。
2. 接下來就開VC2010,開個新專案。然後把 範例的程式貼上去。
3. 把使用到的 void dgesv_( )與 void dgels_( ) 改成
No comments:
Post a Comment