openvenues / libpostal

A C library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data.
MIT License
4.04k stars 417 forks source link

Ubuntu 16.04 - Makefile:4175: recipe for target 'all-local' failed #167

Closed phackwer closed 7 years ago

phackwer commented 7 years ago

I consistently get a compiling error after downloading the base files. I have all dependencies installed, and yet got those errors. Error happens on both my local desktop and on a Docker I've setup (I can share the Dockerfile if you guys want to give it a try). Here is what I've installed as deps:

apt-get install -y --allow-unauthenticated software-properties-common \ python-software-properties supervisor build-essential git curl \ autoconf automake libtool pkg-config libsnappy-dev

Here is the error:

New libpostal data file available % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 10.2M 100 10.2M 0 0 1656k 0 0:00:06 0:00:06 --:--:-- 2056k address_expansions/ address_expansions/address_dictionary.dat numex/ numex/numex.dat transliteration/ transliteration/transliteration.dat Checking for new libpostal geodb data file... New libpostal geodb data file available Downloading multipart: http://libpostal.s3.amazonaws.com/geodb.tar.gz, size=486746092, num_chunks=7 Downloading part 1: filename=/usr/local/share/libpostal/geodb.tar.gz.1, offset=0, max=67108863 Downloading part 5: filename=/usr/local/share/libpostal/geodb.tar.gz.5, offset=268435456, max=335544319 Downloading part 7: filename=/usr/local/share/libpostal/geodb.tar.gz.7, offset=402653184, max=486746092 Downloading part 3: filename=/usr/local/share/libpostal/geodb.tar.gz.3, offset=134217728, max=201326591 Downloading part 2: filename=/usr/local/share/libpostal/geodb.tar.gz.2, offset=67108864, max=134217727 Downloading part 6: filename=/usr/local/share/libpostal/geodb.tar.gz.6, offset=335544320, max=402653183 Downloading part 4: filename=/usr/local/share/libpostal/geodb.tar.gz.4, offset=201326592, max=268435455 geodb/ geodb/geodb.spi geodb/geodb.spl geodb/geodb_feature_graph.dat geodb/geodb_features.trie geodb/geodb_names.trie geodb/geodb_postal_codes.dat Checking for new libpostal parser data file... New libpostal parser data file available Downloading multipart: http://libpostal.s3.amazonaws.com/parser.tar.gz, size=190250553, num_chunks=2 Downloading part 1: filename=/usr/local/share/libpostal/parser.tar.gz.1, offset=0, max=67108863 Downloading part 2: filename=/usr/local/share/libpostal/parser.tar.gz.2, offset=67108864, max=190250553 address_parser/ address_parser/address_parser.dat address_parser/address_parser_vocab.trie address_parser/address_parser_phrases.trie Checking for new libpostal language classifier data file... New libpostal language classifier data file available Downloading multipart: http://libpostal.s3.amazonaws.com/language_classifier.tar.gz, size=672728402, num_chunks=10 Downloading part 1: filename=/usr/local/share/libpostal/language_classifier.tar.gz.1, offset=0, max=67108863 Downloading part 2: filename=/usr/local/share/libpostal/language_classifier.tar.gz.2, offset=67108864, max=134217727 Downloading part 8: filename=/usr/local/share/libpostal/language_classifier.tar.gz.8, offset=469762048, max=536870911 Downloading part 6: filename=/usr/local/share/libpostal/language_classifier.tar.gz.6, offset=335544320, max=402653183 Downloading part 10: filename=/usr/local/share/libpostal/language_classifier.tar.gz.10, offset=603979776, max=672728402 Downloading part 9: filename=/usr/local/share/libpostal/language_classifier.tar.gz.9, offset=536870912, max=603979775 Downloading part 5: filename=/usr/local/share/libpostal/language_classifier.tar.gz.5, offset=268435456, max=335544319 Downloading part 4: filename=/usr/local/share/libpostal/language_classifier.tar.gz.4, offset=201326592, max=268435455 Downloading part 3: filename=/usr/local/share/libpostal/language_classifier.tar.gz.3, offset=134217728, max=201326591 Downloading part 7: filename=/usr/local/share/libpostal/language_classifier.tar.gz.7, offset=402653184, max=469762047 make[3]: [all-local] Error 123 Makefile:4175: recipe for target 'all-local' failed make[3]: Leaving directory '/libpostal/src' make[2]: [all-recursive] Error 1 Makefile:3886: recipe for target 'all-recursive' failed make[2]: Leaving directory '/libpostal/src' make[1]: [all-recursive] Error 1 Makefile:436: recipe for target 'all-recursive' failed make[1]: Leaving directory '/libpostal' Makefile:344: recipe for target 'all' failed make: [all] Error 2 The command '/bin/sh -c cd libpostal && ./bootstrap.sh && ./configure && make && make install && ldconfig' returned a non-zero code: 2 phackwer@phackwer:~/Projects/geofinder/devops$ gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

phackwer commented 7 years ago

I've added the snappy binary package and it compiled.

Please, add this package as a requirement!

albarrentine commented 7 years ago

libsnappy-dev is all that's required (installing it automatically installs the binary package). Ran an Ubuntu 16.04 Docker just now and could not reproduce a compilation error. It looks like what actually happened above is that language_classifier.tar.gz didn't finish downloading, possibly due to lack of disk space (libpostal needs ~2.2G).

Please check that there's enough space free on disk. To run only the data download, try ./src/libpostal_data download all and make sure it returns successfully.

phackwer commented 7 years ago

Yeah, just realized I was using the wifi!!! Damn! hahahahah! Connected the cable and everything ran well. Thank you,

zhengcongyin commented 5 years ago

I still get this error while following the instruction...

mathiasgrimm commented 2 years ago

Late to the party but might still help one or two.

I also run into this problem that the data download would be aborted due to networking issues (wifi, packet drop, etc) and while building a docker image it can get very tedious to go through the whole compilation (make) process over and over again.

To me, what worked was to split the compile and the data download into two separated steps. First I compile and install without any data and then I download all the data.

...

RUN cd libpostal \
    && ./bootstrap.sh \
    && ./configure --disable-data-download --datadir=/var/task/libpostal/data

RUN cd libpostal && make -j4 && make install
RUN cd libpostal && libpostal_data download all /var/task/libpostal/data/libpostal

...

IMPORTANT --datadir and download all need to have different values like shown in this example. This is a working example and libpostal automatically appends libpostal to the end of what you defined in your --datadir

By doing this we can run docker build many times until it's able to download all the data while by-passing the compilation step, as docker caches it.