如何使用 make 构建源文件?

如何使用 make 构建源文件?

我正在尝试使用 make 构建源代码?这是我第一次尝试这样做,因为没有其他方法可以安装程序。包含源代码的目录的内容显示如下这里

我从 casa_1.1b_.zip 文件中提取源代码。

我使用了一个终端。

使用 将目录更改为此文件夹cd GA/casa_1.1b,然后运行./configure​​。正如预期的那样,它给出了错误bash: ./configure: No such file or directory。我尝试解压缩目录usr/local/src并运行./configure,但仍然给出了相同的错误。

在运行该命令之前,我们是否需要在源中配置文件?

的内容生成文件你在图片中看到的。

我该如何制作这个源代码?

我正在使用 Ubuntu 14.04。谢谢。

编辑 :

root@pi314:/home/potato_head/GA/casa_1.1b# make
g++ -MM common/utility/PascalTriangle.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,common/utility/PascalTriangle.o common/utility/PascalTriangle.d:   ,g' > common/utility/PascalTriangle.d
g++ -MM common/utility/Combinadic.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,common/utility/Combinadic.o common/utility/Combinadic.d:   ,g' > common/utility/Combinadic.d
g++ -MM common/utility/CombinadicIterator.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,common/utility/CombinadicIterator.o common/utility/CombinadicIterator.d:   ,g' > common/utility/CombinadicIterator.d
g++ -MM minisat/solver/Solver.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,minisat/solver/Solver.o minisat/solver/Solver.d:   ,g' > minisat/solver/Solver.d
g++ -MM casa/sat/SAT.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/sat/SAT.o casa/sat/SAT.d:  ,g' > casa/sat/SAT.d
g++ -MM casa/io/Usage.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/io/Usage.o casa/io/Usage.d:   ,g' > casa/io/Usage.d
g++ -MM casa/io/SpecificationFile.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/io/SpecificationFile.o casa/io/SpecificationFile.d:   ,g' > casa/io/SpecificationFile.d
g++ -MM casa/io/ConstraintFile.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/io/ConstraintFile.o casa/io/ConstraintFile.d:    ,g' > casa/io/ConstraintFile.d
g++ -MM casa/io/OutputFile.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/io/OutputFile.o casa/io/OutputFile.d:    ,g' > casa/io/OutputFile.d
g++ -MM casa/covering/state/CoveringArray.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/covering/state/CoveringArray.o casa/covering/state/CoveringArray.d:   ,g' > casa/covering/state/CoveringArray.d
g++ -MM casa/covering/state/CoveringArrayEntry.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/covering/state/CoveringArrayEntry.o casa/covering/state/CoveringArrayEntry.d:    ,g' > casa/covering/state/CoveringArrayEntry.d
g++ -MM casa/covering/state/CoveringArrayRow.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/covering/state/CoveringArrayRow.o casa/covering/state/CoveringArrayRow.d:  ,g' > casa/covering/state/CoveringArrayRow.d
g++ -MM casa/covering/state/CoveringArraySubRow.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/covering/state/CoveringArraySubRow.o casa/covering/state/CoveringArraySubRow.d: ,g' > casa/covering/state/CoveringArraySubRow.d
g++ -MM casa/covering/space/CoveringArraySpace.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/covering/space/CoveringArraySpace.o casa/covering/space/CoveringArraySpace.d:    ,g' > casa/covering/space/CoveringArraySpace.d
g++ -MM casa/covering/space/SingleChangeSpace.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/covering/space/SingleChangeSpace.o casa/covering/space/SingleChangeSpace.d:   ,g' > casa/covering/space/SingleChangeSpace.d
g++ -MM casa/covering/space/GraftSpace.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/covering/space/GraftSpace.o casa/covering/space/GraftSpace.d:    ,g' > casa/covering/space/GraftSpace.d
g++ -MM casa/covering/bookkeeping/Options.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/covering/bookkeeping/Options.o casa/covering/bookkeeping/Options.d:   ,g' > casa/covering/bookkeeping/Options.d
g++ -MM casa/annealing/Anneal.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/annealing/Anneal.o casa/annealing/Anneal.d:   ,g' > casa/annealing/Anneal.d
g++ -MM casa/annealing/AnnealingSuccess.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/annealing/AnnealingSuccess.o casa/annealing/AnnealingSuccess.d: ,g' > casa/annealing/AnnealingSuccess.d
g++ -MM casa/annealing/Bounds.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/annealing/Bounds.o casa/annealing/Bounds.d:   ,g' > casa/annealing/Bounds.d
g++ -MM casa/annealing/AnnealingPartitioner.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/annealing/AnnealingPartitioner.o casa/annealing/AnnealingPartitioner.d: ,g' > casa/annealing/AnnealingPartitioner.d
g++ -MM casa/algorithms/BinarySearch.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/algorithms/BinarySearch.o casa/algorithms/BinarySearch.d:  ,g' > casa/algorithms/BinarySearch.d
g++ -MM casa/Main.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS | sed 's,.*\.o:,casa/Main.o casa/Main.d:   ,g' > casa/Main.d
sed -e 's/://g' -e 's/[^ ][^ ]*\.d//g' -e 's/[^ ][^ ]*\.o//g' -e 's/[   \\][    \\]*/ /g' common/utility/PascalTriangle.d common/utility/Combinadic.d common/utility/CombinadicIterator.d minisat/solver/Solver.d casa/sat/SAT.d casa/io/Usage.d casa/io/SpecificationFile.d casa/io/ConstraintFile.d casa/io/OutputFile.d casa/covering/state/CoveringArray.d casa/covering/state/CoveringArrayEntry.d casa/covering/state/CoveringArrayRow.d casa/covering/state/CoveringArraySubRow.d casa/covering/space/CoveringArraySpace.d casa/covering/space/SingleChangeSpace.d casa/covering/space/GraftSpace.d casa/covering/bookkeeping/Options.d casa/annealing/Anneal.d casa/annealing/AnnealingSuccess.d casa/annealing/Bounds.d casa/annealing/AnnealingPartitioner.d casa/algorithms/BinarySearch.d casa/Main.d | tr ' ' "\n" | sort | uniq | tr "\n" ' ' | sed 's/^/ALL_INPUTS =/' > Dependencies
g++ -c -o common/utility/PascalTriangle.o common/utility/PascalTriangle.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o common/utility/Combinadic.o common/utility/Combinadic.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o common/utility/CombinadicIterator.o common/utility/CombinadicIterator.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o minisat/solver/Solver.o minisat/solver/Solver.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/sat/SAT.o casa/sat/SAT.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/io/Usage.o casa/io/Usage.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/io/SpecificationFile.o casa/io/SpecificationFile.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/io/ConstraintFile.o casa/io/ConstraintFile.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/io/OutputFile.o casa/io/OutputFile.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/covering/state/CoveringArray.o casa/covering/state/CoveringArray.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/covering/state/CoveringArrayEntry.o casa/covering/state/CoveringArrayEntry.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/covering/state/CoveringArrayRow.o casa/covering/state/CoveringArrayRow.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/covering/state/CoveringArraySubRow.o casa/covering/state/CoveringArraySubRow.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/covering/space/CoveringArraySpace.o casa/covering/space/CoveringArraySpace.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/covering/space/SingleChangeSpace.o casa/covering/space/SingleChangeSpace.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/covering/space/GraftSpace.o casa/covering/space/GraftSpace.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/covering/bookkeeping/Options.o casa/covering/bookkeeping/Options.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/annealing/Anneal.o casa/annealing/Anneal.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/annealing/AnnealingSuccess.o casa/annealing/AnnealingSuccess.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/annealing/Bounds.o casa/annealing/Bounds.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/annealing/AnnealingPartitioner.o casa/annealing/AnnealingPartitioner.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/algorithms/BinarySearch.o casa/algorithms/BinarySearch.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -c -o casa/Main.o casa/Main.C -Wredundant-decls -Wall -Werror -g -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include -DSEARCH_PROGRESS
g++ -o casa-1.1b common/utility/PascalTriangle.o common/utility/Combinadic.o common/utility/CombinadicIterator.o minisat/solver/Solver.o casa/sat/SAT.o casa/io/Usage.o casa/io/SpecificationFile.o casa/io/ConstraintFile.o casa/io/OutputFile.o casa/covering/state/CoveringArray.o casa/covering/state/CoveringArrayEntry.o casa/covering/state/CoveringArrayRow.o casa/covering/state/CoveringArraySubRow.o casa/covering/space/CoveringArraySpace.o casa/covering/space/SingleChangeSpace.o casa/covering/space/GraftSpace.o casa/covering/bookkeeping/Options.o casa/annealing/Anneal.o casa/annealing/AnnealingSuccess.o casa/annealing/Bounds.o casa/annealing/AnnealingPartitioner.o casa/algorithms/BinarySearch.o casa/Main.o 
etags casa/algorithms/BinarySearch.C casa/algorithms/BinarySearch.H casa/annealing/Anneal.C casa/annealing/Anneal.H casa/annealing/AnnealingFilter.H casa/annealing/AnnealingPartitioner.C casa/annealing/AnnealingPartitioner.H casa/annealing/AnnealingSuccess.C casa/annealing/AnnealingSuccess.H casa/annealing/Bounds.C casa/annealing/Bounds.H casa/covering/bookkeeping/Coverage.H casa/covering/bookkeeping/Options.C casa/covering/bookkeeping/Options.H casa/covering/cost/CoverageCost.H casa/covering/filter/CoveringArrayAnnealingFilter.H casa/covering/goal/CoverageGoal.H casa/covering/heuristic/CoveringArrayHeuristic.H casa/covering/report/IterationReport.H casa/covering/space/CoveringArraySpace.C casa/covering/space/CoveringArraySpace.H casa/covering/space/GraftSpace.C casa/covering/space/GraftSpace.H casa/covering/space/SingleChangeSpace.C casa/covering/space/SingleChangeSpace.H casa/covering/state/CoveringArray.C casa/covering/state/CoveringArrayEntry.C casa/covering/state/CoveringArray.H casa/covering/state/CoveringArrayRow.C casa/covering/state/CoveringArraySubRow.C casa/events/EventSource.H casa/events/Listener.H casa/io/ConstraintFile.C casa/io/ConstraintFile.H casa/io/OutputFile.C casa/io/OutputFile.H casa/io/SpecificationFile.C casa/io/SpecificationFile.H casa/io/Usage.C casa/io/Usage.H casa/Main.C casa/sat/SAT.C casa/sat/SAT.H casa/search/Filter.H casa/search/Goal.H casa/search/GreedyFilter.H casa/search/Guide.H casa/search/Heuristic.H casa/search/Node.H casa/search/SearchConfiguration.H casa/search/SearchFinish.H casa/search/Search.H casa/search/SearchIteration.H casa/search/StateGuide.H casa/search/StateSpace.H common/posix/getopt.h common/utility/Array.H common/utility/Combinadic.C common/utility/Combinadic.H common/utility/CombinadicIterator.C common/utility/CombinadicIterator.H common/utility/igreater.H common/utility/Lazy.H common/utility/PascalTriangle.C common/utility/PascalTriangle.H common/utility/pless.H common/utility/relation.H common/utility/SubstitutionArray.H minisat/include/Alg.h minisat/include/Heap.h minisat/include/Sort.h minisat/include/Vec.h minisat/solver/Solver.C minisat/solver/Solver.H minisat/solver/SolverTypes.H
root@pi314:/home/potato_head/GA/casa_1.1b# 

答案1

我通过快速的网页搜索没有找到有关此软件的任何信息,所以我不知道推荐的安装方法是否涉及运行前的配置步骤make。 如果有,./configure那不是办法,因为没有这样的文件。 并非所有用构建的软件make都有configure脚本。

通常我建议查阅README(或类似名称的)文件,但似乎可能没有。

构建带有 makefile 的软件有三种常见方法:

  • 运行./configure(然后,通常运行其他命令make)。但这似乎不适用于此处。当有这样的脚本时,它通常会生成(或偶尔自定义)Makefile
  • 手动编辑Makefile。这可能是此软件的预期方式。Makefile已经存在。
  • 只需运行make。这可能是该软件的预期方式。Makefile似乎是这样编写的,即使没有先进行任何更改,它也会构建软件。为了验证这一点,因为我不是作为 makefile 语法和语义方面的专家,我将其内容保存为Makefile一个空目录并运行make。这试图运行编译命令(当然失败了,因为我没有其余文件),这表明您的源代码存档可能附带了一个随时可用的 makefile。

简而言之,如果你还没有试过跑步make,那就试一试吧。


看来,当您运行时make,没有错误,并且它创建了一个名为的可执行文件g++ -o casa-1.1b

g++ -o casa-1.1b common/utility/PascalTriangle.o common/utility/Combinadic.o common/utility/CombinadicIterator.o minisat/solver/Solver.o casa/sat/SAT.o casa/io/Usage.o casa/io/SpecificationFile.o casa/io/ConstraintFile.o casa/io/OutputFile.o casa/covering/state/CoveringArray.o casa/covering/state/CoveringArrayEntry.o casa/covering/state/CoveringArrayRow.o casa/covering/state/CoveringArraySubRow.o casa/covering/space/CoveringArraySpace.o casa/covering/space/SingleChangeSpace.o casa/covering/space/GraftSpace.o casa/covering/bookkeeping/Options.o casa/annealing/Anneal.o casa/annealing/AnnealingSuccess.o casa/annealing/Bounds.o casa/annealing/AnnealingPartitioner.o casa/algorithms/BinarySearch.o casa/Main.o

该命令将所有.o文件(通过编译源代码档案中的各个.c文件创建)链接到程序中casa-1.1b

看起来该文件就在您运行的目录中make,因为g++生成该文件的命令似乎指定了相对于该文件夹的路径。./casa-1.1b在该目录中运行可能会运行该程序。

如果是,您可以从那里运行它或手动复制必要的文件来安装它。(该可执行文件可能是您必须复制的唯一文件,也可能还有其他文件。)

相关内容