C++ 如何克服“您的系统中缺少‘aclocal-1.15’”警告?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33278928/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 14:14:52  来源:igfitidea点击:

How to overcome "'aclocal-1.15' is missing on your system" warning?

c++githubmakefileautomake

提问by Liam Flynn

Im trying to run a c++ program on github. (available at the following link https://github.com/mortehu/text-classifier)

我试图在 github 上运行一个 C++ 程序。(可在以下链接https://github.com/mortehu/text-classifier 获得

I have a mac, and am trying to run it in the terminal. I think I have downloaded autoconf and automake but am not sure. To run the program I am going to the correct folder in terminal then running

我有一台 mac,正在尝试在终端中运行它。我想我已经下载了 autoconf 和 automake 但我不确定。要运行该程序,我将转到终端中的正确文件夹,然后运行

./configure && make 

But I get the error:

但我收到错误:

WARNING: 'aclocal-1.15' is missing on your system. You should only need it if you modified 'acinclude.m4' or 'configure.ac' or m4 files included by 'configure.ac'. The 'aclocal' program is part of the GNU Automake package: http://www.gnu.org/software/automakeIt also requires GNU Autoconf, GNU m4 and Perl in order to run: http://www.gnu.org/software/autoconfhttp://www.gnu.org/software/m4/http://www.perl.org/make: *** [aclocal.m4] Error 127

警告:您的系统上缺少“aclocal-1.15”。仅当您修改了“acinclude.m4”或“configure.ac”或“configure.ac”包含的 m4 文件时才需要它。“aclocal”程序是 GNU Automake 软件包的一部分:http: //www.gnu.org/software/automake它还需要 GNU Autoconf、GNU m4 和 Perl 才能运行:http: //www.gnu.org /software/autoconf http://www.gnu.org/software/m4/ http://www.perl.org/制作:*** [aclocal.m4] 错误 127

I have xcode and g++ and all the things required to run c programs, but as is probably obvious, I have no idea what Im doing.

我有 xcode 和 g++ 以及运行 c 程序所需的所有东西,但很明显,我不知道我在做什么。

What is the easiest, simplest way to run the program in the above link? I realise it comes with a readme and example usage but I can not get that to work.

在上面的链接中运行程序的最简单、最简单的方法是什么?我意识到它带有自述文件和示例用法,但我无法让它工作。

回答by mortehu

Before running ./configuretry running autoreconf -f -i. The autoreconf program automatically runs autoheader, aclocal, automake, autopoint and libtoolize as required.

在运行之前./configure尝试运行autoreconf -f -i。autoreconf 程序根据需要自动运行 autoheader、aclocal、automake、autopoint 和 libtoolize。

Edit to add:This is usually caused by checking out code from Git instead of extracting it from a .zipor .tar.gzarchive. In order to trigger rebuilds when files change, Git does not preserve files' timestamps, so the configurescript might appear to be out of date. As others have mentioned, there are ways to get around this if you don't have a sufficiently recent version of autoreconf.

编辑添加:这通常是由于从 Git 检出代码而不是从.zip.tar.gz存档中提取代码引起的。为了在文件更改时触发重建,Git 不会保留文件的时间戳,因此 configure脚本可能看起来已经过时。正如其他人所提到的,如果您没有足够新的autoreconf.

Another edit:This error can also be caused by copying the source folder extracted from an archive with scp to another machine. The timestamps can be updated, suggesting that a rebuild is necessary. To avoid this, copy the archive and extract it in place.

另一个编辑:这个错误也可能是由于将使用 scp 从存档中提取的源文件夹复制到另一台机器上引起的。时间戳可以更新,表明需要重建。为避免这种情况,请复制存档并将其解压缩到位。

回答by emlai

Often, you don't need any auto*tools and the simplest solution is to simply run touch aclocal.m4 configurein the relevant folder (and also run touchon Makefile.amand Makefile.inif they exist). This will update the timestamp of aclocal.m4and remind the system that aclocal.m4is up-to-date and doesn't need to be rebuilt. After this, it's probably best to empty your builddirectory and rerun configurefrom scratch after doing this. I run into this problem regularly. For me, the root cause is that I copy a library (e.g. mpfrcode for gcc) from another folder and the timestamps change.

通常情况下,你不需要任何auto*工具和简单的解决方法是简单地运行touch aclocal.m4 configure在相关文件夹(也运行touchMakefile.amMakefile.in如果它们存在)。这将更新时间戳aclocal.m4并提醒系统aclocal.m4是最新的并且不需要重建。在此之后,最好清空您的build目录并configure在执行此操作后从头开始重新运行。我经常遇到这个问题。对我来说,根本原因是我从另一个文件夹复制了一个库(例如 的mpfr代码gcc)并且时间戳发生了变化。

Of course, this trick isn't valid if you really do need to regenerate those files, perhaps because you have manually changed them. But hopefully the developers of the package distribute up-to-date files.

当然,如果您确实需要重新生成这些文件,则此技巧无效,这可能是因为您手动更改了它们。但希望包的开发人员分发最新的文件。



And of course, if you do want to install automakeand friends, then use the appropriate package-manager for your distribution.

当然,如果你想安装automake和朋友,然后使用适当的包管理器为您的发行版。



Install aclocal which comes with automake:

安装 automake 附带的 aclocal:

brew install automake          # for Mac
apt-get install automake       # for Ubuntu

Try again:

再试一次:

./configure && make 

回答by Frederick Ollinger

You can install the version you need easily:

您可以轻松安装所需的版本:

First get source:

先获取源码:

$ wget https://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz

Unpack it:

打开包装:

$ tar -xzvf automake-1.15.tar.gz

Build and install:

构建和安装:

$ cd automake-1.15
$ ./configure  --prefix=/opt/aclocal-1.15
$ make
$ sudo mkdir -p /opt
$ sudo make install

Use it:

用它:

$ export PATH=/opt/aclocal-1.15/bin:$PATH
$ aclocal --version

aclocal (GNU automake) 1.15

aclocal (GNU automake) 1.15

Now when aclocal is called, you get the right version.

现在,当调用 aclocal 时,您会得到正确的版本。

回答by Droopycom

A generic answer that may or not apply to this specific case:

可能适用于或不适用于此特定情况的通用答案:

As the error message hint at, aclocal-1.15 should only be required if you modified files that were used to generate aclocal.m4

正如错误消息提示的那样,仅当您修改了用于生成 aclocal.m4 的文件时才需要 aclocal-1.15

If you don't modify any of those files (including configure.ac) then you should not need to have aclocal-1.15.

如果您不修改任何这些文件(包括 configure.ac),那么您就不需要 aclocal-1.15。

In my case, the problem was not that any of those files was modified but somehow the timestamp on configure.ac was 6 minutes later compared to aclocal.m4.

就我而言,问题不在于这些文件中的任何一个被修改,而是 configure.ac 上的时间戳与 aclocal.m4 相比晚了 6 分钟。

I haven't figured out why, but a clean clone of my git repo solved the issue for me. Maybe something linked to git and how it created files in the first place.

我还没有弄清楚原因,但是我的 git repo 的一个干净克隆为我解决了这个问题。也许与 git 相关的东西以及它最初是如何创建文件的。

Rather than rerunning autoconf and friends, I would just try to get a clean clone and try again.

与其重新运行 autoconf 和朋友,我只想尝试获得一个干净的克隆并重试

It's also possible that somebody committed a change to configure.ac but didn't regenerate the aclocal.m4, in which case you indeed have to rerun automake and friends.

也有可能有人对 configure.ac 进行了更改,但没有重新生成 aclocal.m4,在这种情况下,您确实必须重新运行 automake 和朋友。

回答by Kaz

The whole point of Autotools is to provide an arcane M4-macro-based language which ultimately compiles to a shell script called ./configure. You can ship this compiled shell script with the source code and that script should do everything to detect the environment and prepare the program for building. Autotools should only be required by someone who wants to tweak the tests and refresh that shell script.

Autotools 的全部意义在于提供一种神秘的基于 M4 宏的语言,该语言最终编译为名为./configure. 您可以将这个编译好的 shell 脚本与源代码一起发送,该脚本应该做所有事情来检测环境并准备程序以进行构建。只有想要调整测试和刷新 shell 脚本的人才需要 Autotools。

It defeats the point of Autotools if GNU This and GNU That has to be installed on the system for it to work. Originally, it was invented to simplify the porting of programs to various Unix systems, which could not be counted on to have anything on them. Even the constructs used by the generated shell code in ./configurehad to be very carefully selected to make sure they would work on every broken old shell just about everywhere.

如果必须在系统上安装 GNU This 和 GNU That 才能使其工作,那么它就失去了 Autotools 的意义。最初,它的发明是为了简化程序到各种 Unix 系统的移植,不能指望这些系统上有任何东西。甚至生成的 shell 代码使用的构造./configure也必须非常仔细地选择,以确保它们可以在几乎所有地方的每个损坏的旧 shell 上工作。

The problem you're running into is due to some broken Makefile steps invented by people who simply don't understand what Autotools is for and the role of the final ./configurescript.

您遇到的问题是由于一些人发明了一些损坏的 Makefile 步骤,他们根本不了解 Autotools 的用途以及最终./configure脚本的作用。

As a workaround, you can go into the Makefile and make some changes to get this out of the way. As an example, I'm building the Git head of GNU Awk and running into this same problem. I applied this patch to Makefile.in, however, and I can sucessfully make gawk:

作为一种解决方法,您可以进入 Makefile 并进行一些更改以解决此问题。例如,我正在构建 GNU Awk 的 Git 负责人并遇到了同样的问题。Makefile.in但是,我将此补丁应用于,并且可以成功make gawk

diff --git a/Makefile.in b/Makefile.in

diff --git a/Makefile.in b/Makefile.in

index 5585046..b8b8588 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -312,12 +312,12 @@ distcleancheck_listfiles = find . -type f -print

 # Directory for gawk's data files. Automake supplies datadir.
 pkgdatadir = $(datadir)/awk
-ACLOCAL = @ACLOCAL@
+ACLOCAL = true
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
+AUTOCONF = true
+AUTOHEADER = true
+AUTOMAKE = true
 AWK = @AWK@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@

Basically, I changed things so that the harmless trueshell command is substituted for all the Auto-stuff programs.

基本上,我改变了一些东西,以便无害的trueshell 命令替换所有 Auto-stuff 程序。

The actual build steps for Gawk don't need the Auto-stuff! It's only involved in some rules that get invoked if parts of the Auto-stuff have changed and need to be re-processed. However, the Makefile is structured in such a way that it fails if the tools aren't present.

Gawk 的实际构建步骤不需要 Auto-stuff!它只涉及一些规则,如果 Auto-stuff 的部分发生变化并且需要重新处理,这些规则就会被调用。然而,Makefile 的结构是这样的,如果工具不存在,它就会失败。

Before the above patch:

在上述补丁之前:

$ ./configure
[...]
$ make gawk
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/kaz/gawk/missing aclocal-1.15 -I m4
/home/kaz/gawk/missing: line 81: aclocal-1.15: command not found
WARNING: 'aclocal-1.15' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make: *** [aclocal.m4] Error 127

After the patch:

补丁后:

$ ./configure
[...]
$ make gawk
CDPATH="${ZSH_VERSION+.}:" && cd . && true -I m4
CDPATH="${ZSH_VERSION+.}:" && cd . && true
gcc -std=gnu99 -DDEFPATH='".:/usr/local/share/awk"' -DDEFLIBPATH="\"/usr/local/lib/gawk\"" -DSHLIBEXT="\"so"\" -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -DNDEBUG -MT array.o -MD -MP -MF .deps/array.Tpo -c -o array.o array.c 
[...]
gcc -std=gnu99  -g -O2 -DNDEBUG  -Wl,-export-dynamic -o gawk array.o awkgram.o builtin.o cint_array.o command.o debug.o dfa.o eval.o ext.o field.o floatcomp.o gawkapi.o gawkmisc.o getopt.o getopt1.o int_array.o io.o main.o mpfr.o msg.o node.o profile.o random.o re.o regex.o replace.o str_array.o symbol.o version.o      -ldl -lm
$ ./gawk --version
GNU Awk 4.1.60, API: 1.2
Copyright (C) 1989, 1991-2015 Free Software Foundation.
[...]

There we go. As you can see, the CDPATH=command lines there are where the Auto-stuff was being invoked, where you see the truecommands. These report successful termination, and so it just falls through that junk to do the darned build, which is perfectly configured.

我们走了。如您所见,CDPATH=那里的命令行是调用 Auto-stuff 的地方,您可以在其中看到true命令。这些报告成功终止,因此它只是通过那些垃圾来执行完美配置的该死的构建。

I did make gawkbecause there are some subdirectories that get built which fail; the trick has to be repeated for their respective Makefiles.

我这样做make gawk是因为有一些构建失败的子目录;必须为它们各自的 Makefile 重复这个技巧。

If you're running into this kind of thing with a pristine, official tarball of the program from its developers, then complain. It should just unpack, ./configureand makewithout you having to patch anything or install any Automake or Autoconf materials.

如果您在使用来自其开发人员的程序的原始官方 tarball 时遇到这种情况,请抱怨。它应该只是解压缩,./configuremake无需您修补任何东西或安装任何 Automake 或 Autoconf 材料。

Ideally, a pull of their Git head should also behave that way.

理想情况下,拉他们的 Git 头也应该这样做。

回答by Fattie

2018, yet another solution ...

2018 年,又一个解决方案......

https://github.com/apereo/mod_auth_cas/issues/97

https://github.com/apereo/mod_auth_cas/issues/97

in some casessimply running

某些情况下只是运行

$ autoreconf -f -i

and nothing else .... solves the problem.

没有别的......解决了这个问题。

You do that in the directory /pcre2-10.30.

您在目录中执行此操作/pcre2-10.30

What a nightmare.

什么样的恶梦。

(This usually did notsolve the problem in 2017, but now usually doesseem to solve the problem - they fixed something. Also, it seems your Dockerfile should now usually start with "FROM ibmcom/swift-ubuntu" ; previously you had to give a certain version/dev-build to make it work.)

(这通常并没有解决这个问题在2017年,但现在一般不会似乎来解决这个问题-他们固定的东西而且,看来你Dockerfile现在应该通常以“FROM ibmcom /快捷Ubuntu的”开始;以前你不得不放弃。某个版本/开发构建以使其工作。)

回答by Brian Carcich

I think the touch command is the right answer e.g. do something like

我认为触摸命令是正确的答案,例如做类似的事情

touch --date="`date`" aclocal.m4 Makefile.am configure Makefile.in

before [./configure && make].

在 [./configure && make] 之前。

Sidebar I: Otherwise, I agree with @kaz: adding dependencies for aclocal.m4 and/or configure and/or Makefile.am and/or Makefile.in makes assumptions about the target system that may be invalid. Specifically, those assumptions are

侧边栏 I:否则,我同意 @kaz:为 aclocal.m4 和/或 configure 和/或 Makefile.am 和/或 Makefile.in 添加依赖项对可能无效的目标系统做出假设。具体来说,这些假设是

1) that all target systems have autotools,

1) 所有目标系统都有自动工具,

2) that all target systems have the same version of autotools (e.g. automake.1.15 in this case).

2) 所有目标系统都具有相同版本的 autotools(例如在本例中为 automake.1.15)。

3) that if either (1) or (2) are not true for any user, that the user is extracting the package from a maintainer-produced TAR or ZIP format that maintains timestamps of the relevant files, in which case all autotool/configure/Makefile.am/Makefile.in dependencies in the configure-generated Makefile will be satisfied beforethe make command is issued.

3) 如果 (1) 或 (2) 对任何用户都不正确,则用户正在从维护者生成的 TAR 或 ZIP 格式中提取包,该格式维护相关文件的时间戳,在这种情况下,所有的 autotool/configure在发出 make 命令之前,将满足配置生成的 Makefile 中的 /Makefile.am/Makefile.in 依赖项。

The second assumption fails on many Mac systems because automake.1.14 is the "latest" for OSX (at least that is what I see in MacPorts, and apparently the same is true for brew).

第二个假设在许多 Mac 系统上失败,因为 automake.1.14 是 OSX 的“最新版本”(至少这是我在 MacPorts 中看到的,显然 brew 也是如此)。

The third assumption fails spectacularly in a world with Github. This failure is an example of an "everyone thinks they are normative" mindset; specifically, the maintainers, who are the onlyclass of users that should need to edit Makefile.am, have now put everyoneinto that class.

在有 Github 的世界中,第三个假设显然失败了。这种失败是“每个人都认为他们是规范的”心态的一个例子;具体来说,维护者是唯一需要编辑 Makefile.am 的用户类,现在已经将每个人都放入该类。

Perhaps there is an option in autowhatever that keeps these dependencies from being added to Makefile.in and/or Makefile.

也许 autowhatever 中有一个选项可以防止将这些依赖项添加到 Makefile.in 和/或 Makefile。

Sidebar II [Why @kaz is right]: of course it is obvious, to me and other cognoscenti, to simply try a sequence of [touch] commands to fool the configure-created Makefile from re-running configure and the autotools. But that is not the point of configure; the point of configure is to ensure as many users on as many different systems as as possible can simply do [./configure && make] and move on; most users are not interested in "shaving the yak" e.g. debugging faulty assumptions of the autotools developers.

侧边栏 II [为什么@kaz 是对的]:当然,对我和其他专家来说,很明显,只需尝试一系列 [touch] 命令来欺骗 configure 创建的 Makefile 重新运行 configure 和 autotools。但这不是配置的重点;configure 的目的是确保尽可能多的不同系统上的尽可能多的用户可以简单地执行 [./configure && make] 并继续;大多数用户对“剃掉牦牛”不感兴趣,例如调试 autotools 开发人员的错误假设。

Sidebar III: it could be argued that ./configure, now that autotools adds these dependencies, is the wrong build tool to use with Github-distributed packages.

边栏 III:可以说 ./configure,现在 autotools 添加了这些依赖项,是用于 Github 分布式包的错误构建工具。

Sidebar IV: perhaps configure-based Github repos should put the necessary touch command into their readme, e.g. https://github.com/drbitboy/Tycho2_SQLite_RTree.

侧边栏 IV:也许基于配置的 Github 存储库应该将必要的 touch 命令放入他们的自述文件中,例如https://github.com/drbitboy/Tycho2_SQLite_RTree

回答by Pian0_M4n

The problem is not automakepackage, is the repository

问题不是automake包,是存储库

sudo apt-get install automake

sudo apt-get install automake

Installs version aclocal-1.4, that's why you can't find 1.5(In Ubuntu 14,15)

安装版本aclocal-1.4,这就是你找不到的原因1.5(在 Ubuntu 14,15 中)

Use this script to install latest https://github.com/gp187/nginx-builder/blob/master/fix/aclocal.sh

使用此脚本安装最新的 https://github.com/gp187/nginx-builder/blob/master/fix/aclocal.sh

回答by Fattie

2017 - High Sierra

2017 - 高山脉

It is really hard to get autoconf 1.15 working on Mac. We hired an expert to get it working. Everything worked beautifully.

在 Mac 上运行 autoconf 1.15 真的很难。我们聘请了一位专家来让它发挥作用。一切都很顺利。

Later I happened to upgrade a Mac to High Sierra.

后来我碰巧将 Mac 升级到 High Sierra。

The Docker pipeline stopped working!

Docker 管道停止工作!

Even though autoconf 1.15 isworking fine on the Mac.

虽然autoconf的1.15在Mac上工作正常。

How to fix,

怎么修,

Short answer, I simply trashed the local repo, and checked out the repo again.

简短的回答,我只是删除了本地存储库,然后再次查看了存储库。

This suggestion is noted in the mix on this QA page and elsewhere.

此建议已在此 QA 页面和其他地方的混合中注明。

It then worked fine!

然后它工作正常!

It likely has something to do with the aclocal.m4 and similar files. (But who knows really). I endlessly massaged those files ... but nothing.

它可能与 aclocal.m4 和类似文件有关。(但谁知道呢)。我无休止地按摩这些文件......但没有。

For some unknown reason if you just scratch your repo and get the repo again: everything works!

出于某种未知的原因,如果您只是划伤您的回购并再次获得回购:一切正常!

I tried for hours every combo of touching/deleting etc etc the files in question, but no. Just check out the repo from scratch!

我尝试了几个小时的触摸/删除等相关文件的每个组合,但没有。只需从头开始检查回购!