c++ - 编译包含 PETSc 库的 C++ 代码。make: 没有规则来制作目标错误信息
问题描述
我对使用这里讨论的开源代码很感兴趣。此处讨论了有关如何运行代码的框架和一些说明。为了能够使用代码,首先应该安装PETSc。我已经这样做了,它似乎已正确安装。当我尝试按照论文make topopt
中给出的说明(第 2.2 节)运行时,问题就出现了。在GitHub 上有一个地方,按照本文中给出的说明,我进行了以下更改:和. 运行后出现以下错误:makefile_ref
PETSC_DIR=\home\myusername\petsc
PETSC_ARCH=arch-linux-c-debug
make -d topopt
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
Considering target file 'GNUmakefile'.
File 'GNUmakefile' does not exist.
Looking for an implicit rule for 'GNUmakefile'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.o'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.c'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.cc'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.C'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.cpp'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.p'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.f'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.F'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.m'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.r'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.s'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.S'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.mod'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.sh'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile,v'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'RCS/GNUmakefile,v'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'RCS/GNUmakefile'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 's.GNUmakefile'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'SCCS/s.GNUmakefile'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.o'.
Looking for a rule with intermediate file 'GNUmakefile.o'.
Avoiding implicit rule recursion.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.c'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.cc'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.C'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.cpp'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.p'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.f'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.F'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.m'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.r'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.s'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.S'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.mod'.
Trying pattern rule with stem 'GNUmakefile.o'.
Trying implicit prerequisite 'GNUmakefile.o,v'.
Trying pattern rule with stem 'GNUmakefile.o'.
Trying implicit prerequisite 'RCS/GNUmakefile.o,v'.
Trying pattern rule with stem 'GNUmakefile.o'.
Trying implicit prerequisite 'RCS/GNUmakefile.o'.
Trying pattern rule with stem 'GNUmakefile.o'.
Trying implicit prerequisite 's.GNUmakefile.o'.
Trying pattern rule with stem 'GNUmakefile.o'.
Trying implicit prerequisite 'SCCS/s.GNUmakefile.o'.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.c'.
Looking for a rule with intermediate file 'GNUmakefile.c'.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem 'GNUmakefile'.
Trying implicit prerequisite 'GNUmakefile.y'.
Trying pattern rule with stem 'GNUmakefile'.
.
.
.
.
.
.
.
.
.
.
Looking for a rule with intermediate file 'topopt.mod'.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem 'topopt.mod'.
Trying implicit prerequisite 'topopt.mod,v'.
Trying pattern rule with stem 'topopt.mod'.
Trying implicit prerequisite 'RCS/topopt.mod,v'.
Trying pattern rule with stem 'topopt.mod'.
Trying implicit prerequisite 'RCS/topopt.mod'.
Trying pattern rule with stem 'topopt.mod'.
Trying implicit prerequisite 's.topopt.mod'.
Trying pattern rule with stem 'topopt.mod'.
Trying implicit prerequisite 'SCCS/s.topopt.mod'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.c'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.cc'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.C'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.cpp'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.p'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.f'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.F'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.m'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.r'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.s'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.S'.
Trying pattern rule with stem 'topopt'.
Rejecting impossible implicit prerequisite 'topopt.mod'.
Trying pattern rule with stem 'topopt'.
Trying implicit prerequisite 'topopt.sh'.
Looking for a rule with intermediate file 'topopt.sh'.
Avoiding implicit rule recursion.
Trying pattern rule with stem 'topopt.sh'.
Trying implicit prerequisite 'topopt.sh,v'.
Trying pattern rule with stem 'topopt.sh'.
Trying implicit prerequisite 'RCS/topopt.sh,v'.
Trying pattern rule with stem 'topopt.sh'.
Trying implicit prerequisite 'RCS/topopt.sh'.
Trying pattern rule with stem 'topopt.sh'.
Trying implicit prerequisite 's.topopt.sh'.
Trying pattern rule with stem 'topopt.sh'.
Trying implicit prerequisite 'SCCS/s.topopt.sh'.
No implicit rule found for 'topopt'.
Finished prerequisites of target file 'topopt'.
Must remake target 'topopt'.
make: *** No rule to make target 'topopt'. Stop.
上面的代码只是整个消息的一部分(开始部分和结束部分)。
我正在开发 Ubuntu 20.04。
提前致谢。
解决方案
有一个
makefile_ref
地方按照本文中给出的说明进行了以下更改[...]
如果没有指定要读取的生成文件的显式选项,该make
实用程序会通过几个替代名称查找输入文件。makefile_ref
不是其中之一。我将文件名的“_ref”部分作为“参考”的助记符,从这个角度来看,意图似乎是您复制makefile_ref
到,比如说,makefile
(默认情况下查找的文件名之一),make
并修改复制到适合您的环境。
推荐阅读
- css - 使用具有动态高度的剪辑路径 css 的曲线部分
- android - exoplayer 播放列表中的转换延迟
- angular - 减少多个组件上的相同 http 网络调用
- jquery - 菜单在外部单击时关闭,但仅打开一次
- authentication - 通过使用数据库中的数据更新声明进行授权(Blazor WebAssembly ASP.NET Core 托管)
- sql - 连接两个表并将连接结果添加到动态列
- javascript - 页面可见性 API:有时在 android - chrome 上,在浏览器处于后台 10-20 分钟后不会触发事件
- javascript - 为什么 React 状态不能处理来自外部类的数据?
- mongodb - MongoDB $regex 查询“以”“$”字符结尾
- loopbackjs - Loopback 4 OpenAPI 连接器:指定每个请求的授权标头值