Im trying to run a c++ program on github. (available at the following link 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
./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/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
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.
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.
Before running
./configure
try runningautoreconf -f -i
. The autoreconf program automatically runs autoheader, aclocal, automake, autopoint and libtoolize as required.Edit to add: This is usually caused by checking out code from Git instead of extracting it from a
.zip
or.tar.gz
archive. In order to trigger rebuilds when files change, Git does not preserve files' timestamps, so theconfigure
script 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 ofautoreconf
.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.
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.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
./configure
had to be very carefully selected to make sure they would work on every broken old shell just about everywhere.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
./configure
script.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 sucessfullymake gawk
:diff --git a/Makefile.in b/Makefile.in
Basically, I changed things so that the harmless
true
shell command is substituted for all the Auto-stuff programs.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.
Before the above patch:
After the patch:
There we go. As you can see, the
CDPATH=
command lines there are where the Auto-stuff was being invoked, where you see thetrue
commands. These report successful termination, and so it just falls through that junk to do the darned build, which is perfectly configured.I did
make gawk
because there are some subdirectories that get built which fail; the trick has to be repeated for their respective Makefiles.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,
./configure
andmake
without you having to patch anything or install any Automake or Autoconf materials.Ideally, a pull of their Git head should also behave that way.
2018, yet another solution ...
https://github.com/apereo/mod_auth_cas/issues/97
in some cases simply running
and nothing else .... solves the problem.
You do that in the directory
/pcre2-10.30
.What a nightmare.
(This usually did not solve the problem in 2017, but now usually does seem 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.)
Often, you don't need any
auto*
tools and the simplest solution is to simply runtouch aclocal.m4 configure
in the relevant folder (and also runtouch
onMakefile.am
andMakefile.in
if they exist). This will update the timestamp ofaclocal.m4
and remind the system thataclocal.m4
is up-to-date and doesn't need to be rebuilt. After this, it's probably best to empty yourbuild
directory and rerunconfigure
from scratch after doing this. I run into this problem regularly. For me, the root cause is that I copy a library (e.g.mpfr
code forgcc
) from another folder and the timestamps change.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
automake
and friends, then use the appropriate package-manager for your distribution.Install aclocal which comes with automake:
Try again:
You can install the version you need easily:
First get source:
Unpack it:
Build and install:
Use it:
aclocal (GNU automake) 1.15
Now when aclocal is called, you get the right version.
The problem is not
automake
package, is the repositorysudo apt-get install automake
Installs version
aclocal-1.4
, that's why you can't find1.5
(In Ubuntu 14,15)Use this script to install latest https://github.com/gp187/nginx-builder/blob/master/fix/aclocal.sh