【发布时间】:2020-12-05 17:47:31
【问题描述】:
make 指令未找到编译所需的库。它们位于通常的/usr/include 文件夹之外的其他文件夹中。
我正在使用名为 magnum.fe 的模拟软件我已经安装了所有必需的依赖项(FEniCS = 1.5
CMake >= 2.8
痛饮 >= 2.0
G++ >= 4.0) 并按照说明开始运行make。
$ cd /path/to/magnum.fe
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
但是在运行 make 时出现以下错误:
/usr/include/petscsys.h:136:12: fatal error: petsc/mpiuni/mpi.h: No such file or directory
136 | # include <petsc/mpiuni/mpi.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
文件确实存在,但在其他文件夹中:/home/myusername/bin/petsc/include/mpiuni/mpi.h
我使用以下指令在/home/myusername/bin/petsc/ 上编译了petsc:
$ ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack
$ make all check
它编译成功,但我无法完成 magnum.fe 编译。
我尝试将每个头文件移动到/usr/include,但现在如果将整个 petsc 目录移动到此文件夹中,我会卡住。这一定是一种更优雅的方式。
谢谢
【问题讨论】:
-
我发现我可以使用
LDLIBS行指定要在 make 文件中使用的库。但我做不到,所以我将整个 ...petsc/include 文件夹复制到 /usr/include 并工作
标签: makefile compiler-errors mpi petsc