I get “lapack.h: No such file or directory” although I installed liblapack-dev

半世苍凉 提交于 2019-12-23 10:29:10

问题


I installed liblapack-dev and its dependencies using Synaptic, and I included <lapack.h> in my code.

If I try to compile my program like this...

mpicc program.c -llapack -o output

...I get the following error:

program.c:4:20: fatal error: lapack.h: No such file or directory 
compilation terminated.

How can I fix this? I've already spent hours googling for a solution but nothing helped.

I'm using Linux Mint, but I tried the same thing on the latest version of Ubuntu and it still wouldn't work. Same thing when I try "eliminating" MPI from my program and compiling with gcc.


回答1:


I experienced a similar issue on Debian. I noticed that

dpkg -L liblapack-dev

did not return a single header file. So I did some searching with apt-cache and found what appears to be C headers. After installing via

sudo apt-get install liblapacke-dev

(note the extra e!), I was able to compile a minimal working example, found here. Modifying the include at the top to read

#include <lapacke.h>

and compiling with

gcc -llapack lapack_example.c

successfully runs on my system. Hope this helps someone.




回答2:


Answering because it doesn't fit in a comment:

The manual says:

Standard C language APIs for LAPACK

collaboration LAPACK and INTEL Math Kernel Library Team

    LAPACK C INTERFACE is now included in the LAPACK package (in the lapacke directory)

    LAPACKE User Guide

    Updated: April 20, 2012

    header files: lapacke.h, lapacke_config.h, lapacke_mangling.h, lapacke_utils.h

so perhaps you need to

#include <lapacke.h>


来源:https://stackoverflow.com/questions/14034284/i-get-lapack-h-no-such-file-or-directory-although-i-installed-liblapack-dev

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!