Protobuf: Cannot build and install: Missing configure

Created on 5 Nov 2015  路  5Comments  路  Source: protocolbuffers/protobuf

Hello,

I need to build protobuf and I'm trying to do exactly what the INSTALL doc says. But I'm stuck on the first step:

"1. cd' to the directory containing the package's source code and type./configure' to configure the package for your system."

This does not work for me:
$ ./configure
bash: ./configure: No such file or directory

As far as I can see, there is no file named "configure" in the entire repository:
$ find . -name "configure"
$
(found nothing)

Most helpful comment

I had the same problem and here's the fix:
autoreconf -f -i -Wall,no-obsolete
This line was taken from ./autogen.sh but was not executing properly on RedHat so I just ran it on the command-line. Then you can run ./configure successfully.

All 5 comments

Noticed that the INSTALL doc also mentions the "autoconf" program which should actually create the configure script (nevertheless the INSTALL document does not say that it is required to run it).

So I tried to run autoconf:

$ autoconf
configure.ac:17: error: possibly undefined macro: AM_MAINTAINER_MODE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:43: error: possibly undefined macro: AM_INIT_AUTOMAKE
configure.ac:61: error: possibly undefined macro: AM_CONDITIONAL
configure.ac:87: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.ac:155: error: possibly undefined macro: AC_CXX_STL_HASH

Now the configure is there. However it still does not work:

$ ./configure
./configure: line 2170: syntax error near unexpected token enable' ./configure: line 2170:AM_MAINTAINER_MODE(enable)'

Have you tried running autoconf as the actual shell script distributed with protobuf source? From your example it looks like you're invoking a globally installed (via PATH) autoconf which may, or may not be, the thing you need.

Try this:
cd <protobuf-src-dir> && ./autoconf.sh

and then:

./configure

Might also be relevant: https://github.com/google/protobuf/issues/847

I had the same problem and here's the fix:
autoreconf -f -i -Wall,no-obsolete
This line was taken from ./autogen.sh but was not executing properly on RedHat so I just ran it on the command-line. Then you can run ./configure successfully.

You need to run ./autogen.sh first. This is mentioned in src/README.md (not sure if this was there or not at the time this bug was filed). Resolving.

@haberman
the autgen.sh fails as well for protobuf 2.5 which is needed to build older hadoop versions. The link to the old google test suite is gone. I made it work by changing the autogen.sh

Error Text

~/src/oss/protobuf$ ./autogen.sh 
Google Test not present.  Fetching gtest-1.5.0 from the web...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1586  100  1586    0     0   1026      0  0:00:01  0:00:01 --:--:--  1027
bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Fix

# Check that gtest is present.  Usually it is already there since the
# directory is set up as an SVN external.
if test ! -e gtest; then
  echo "Google Test not present.  Fetching gtest-1.5.0 from the web..."
  #Add the new path to download the google test with redirection since gihub redirects
  curl -L https://github.com/google/googletest/archive/release-1.5.0.tar.gz | tar zx
  mv googletest-release-1.5.0 gtest
  #curl http://googletest.googlecode.com/files/gtest-1.5.0.tar.bz2 | tar jx
  #mv gtest-1.5.0 gtest
fi
Was this page helpful?
0 / 5 - 0 ratings