windows下如何使用lapack
我想使用 lapack 并为其制作 C++ 矩阵包装器,但 lapack 是用 Fortran 编写的,有一些 clapack 但我想从源代码使用它。首先将 *.f 和 *.cpp 文件编译为目标文件,然后将其链接到应用程序中。
我拥有以下应用程序和源。
- Visual Studio Proff Edition,dev C++,Ultimate++,mingw,无论
- g95 和 gfortran(在 mingw 下)编译器
- lapack(最新源)
- blas(包含在 lapack 中)
我如何制作应用程序,请帮助...
我的操作系统是 Windows 7 和 CPU Core2Duo 和我没有 Intel 数学内核
I want to use lapack and make C++ matrix wrapper for it, but lapack is written in Fortran, there are some clapack but I want to use it from source. compile firstly *.f and *.cpp files to object files then link it into a application..
the following apps and sources that I have.
- visual studio proff edition,dev c++,ultimate++,mingw whatever
- g95 and gfortran (under mingw) compiler
- lapack (latest source)
- blas (included in lapack)
How can I make an application please help...
My Operating System is Windows 7 and CPU Core2Duo and I dont have Intel math kernel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用LAPACK 的官方 C 绑定,然后围绕它构建 C++ 包装器。这避免了必须担心 Fortran 调用约定的问题,并且 C 绑定对于 C/C++ 程序员来说比直接调用 Fortran 例程更友好。
此外,您可以使用现有的 C++ 矩阵库之一,而不是自行构建。我推荐Eigen。
PS.:特征矩阵/向量有一个 data() 成员,允许调用 LAPACK 而无需制作临时副本。
You can use the official C bindings for LAPACK, and then build your C++ wrapper around that. That avoids the issue of having to worry about the Fortran calling conventions, and the C bindings are a bit friendlier for C/C++ programmers than calling the Fortran routines directly.
Additionally, you could use one of the C++ matrix libraries that are already available, instead of rolling your own. I recommend Eigen.
PS.: Eigen matrices/vectors have a data() member that allows calling LAPACK without having to make temporary copies.