Merging upstream changes from openvenues/libpostal. Tweeked AppVeyor to package artifacts after setting /LARGEADDRESSAWARE on 32-bit build.
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
version: 1.0.{build}
|
version: 1.0.{build}
|
||||||
image: Visual Studio 2015
|
image: Visual Studio 2015
|
||||||
|
skip_branch_with_pr: true
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -36,10 +33,9 @@ build_script:
|
|||||||
bash -lc "cd $Env:WDIR && ./bootstrap.sh"
|
bash -lc "cd $Env:WDIR && ./bootstrap.sh"
|
||||||
bash -lc "cd $Env:WDIR && ./configure --datadir=/c"
|
bash -lc "cd $Env:WDIR && ./configure --datadir=/c"
|
||||||
bash -lc "cd $Env:WDIR && make -j4"
|
bash -lc "cd $Env:WDIR && make -j4"
|
||||||
bash -lc "cd $Env:WDIR && make install"
|
bash -lc "cd $Env:WDIR && make check"
|
||||||
bash -lc "cd $Env:WDIR && cp src/.libs/libpostal-*.dll libpostal.dll"
|
bash -lc "cd $Env:WDIR && cp src/.libs/libpostal-*.dll libpostal.dll"
|
||||||
& 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\lib.exe' /def:libpostal.def /out:libpostal.lib /machine:$Env:PLATFORM
|
& 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\lib.exe' /def:libpostal.def /out:libpostal.lib /machine:$Env:PLATFORM
|
||||||
7z a libpostal.zip $Env:APPVEYOR_BUILD_FOLDER\libpostal.dll $Env:APPVEYOR_BUILD_FOLDER\libpostal.def $Env:APPVEYOR_BUILD_FOLDER\libpostal.exp $Env:APPVEYOR_BUILD_FOLDER\libpostal.lib $Env:APPVEYOR_BUILD_FOLDER\src\libpostal.h
|
|
||||||
if ($Env:BIT -eq "32") {
|
if ($Env:BIT -eq "32") {
|
||||||
$Paths = @(
|
$Paths = @(
|
||||||
(Join-Path $Env:APPVEYOR_BUILD_FOLDER "src"),
|
(Join-Path $Env:APPVEYOR_BUILD_FOLDER "src"),
|
||||||
@@ -48,6 +44,7 @@ build_script:
|
|||||||
(Join-Path $Env:APPVEYOR_BUILD_FOLDER "test\.libs"))
|
(Join-Path $Env:APPVEYOR_BUILD_FOLDER "test\.libs"))
|
||||||
Get-ChildItem -Path $Paths | ?{ $_.Name -Match '\.(exe|dll)$' } | % { & 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\editbin.exe' /NOLOGO /LARGEADDRESSAWARE $_.FullName }
|
Get-ChildItem -Path $Paths | ?{ $_.Name -Match '\.(exe|dll)$' } | % { & 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\editbin.exe' /NOLOGO /LARGEADDRESSAWARE $_.FullName }
|
||||||
}
|
}
|
||||||
|
7z a libpostal.zip $Env:APPVEYOR_BUILD_FOLDER\libpostal.dll $Env:APPVEYOR_BUILD_FOLDER\libpostal.def $Env:APPVEYOR_BUILD_FOLDER\libpostal.exp $Env:APPVEYOR_BUILD_FOLDER\libpostal.lib $Env:APPVEYOR_BUILD_FOLDER\src\libpostal.h
|
||||||
}
|
}
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ install:
|
|||||||
- if [ "$CC" = "gcc" ]; then export CC="gcc-4.8"; fi
|
- if [ "$CC" = "gcc" ]; then export CC="gcc-4.8"; fi
|
||||||
script:
|
script:
|
||||||
- ./configure --datadir=$(pwd)/data
|
- ./configure --datadir=$(pwd)/data
|
||||||
- make
|
- make -j4
|
||||||
- if [[ $DICTIONARIES_CHANGED -ne 0 ]]; then ./src/build_address_dictionary; fi;
|
- if [[ $DICTIONARIES_CHANGED -ne 0 ]]; then ./src/build_address_dictionary; fi;
|
||||||
- if [[ $NUMEX_CHANGED -ne 0 ]]; then ./src/build_numex_table; fi;
|
- if [[ $NUMEX_CHANGED -ne 0 ]]; then ./src/build_numex_table; fi;
|
||||||
- if [[ $TRANSLIT_CHANGED -ne 0 ]]; then ./src/build_trans_table; fi;
|
- if [[ $TRANSLIT_CHANGED -ne 0 ]]; then ./src/build_trans_table; fi;
|
||||||
|
|||||||
19
README.md
19
README.md
@@ -91,8 +91,8 @@ Individual users can also help support open geo NLP research by making a monthly
|
|||||||
<a href="https://opencollective.com/libpostal/backer/28/website" target="_blank"><img src="https://opencollective.com/libpostal/backer/28/avatar.svg"></a>
|
<a href="https://opencollective.com/libpostal/backer/28/website" target="_blank"><img src="https://opencollective.com/libpostal/backer/28/avatar.svg"></a>
|
||||||
<a href="https://opencollective.com/libpostal/backer/29/website" target="_blank"><img src="https://opencollective.com/libpostal/backer/29/avatar.svg"></a>
|
<a href="https://opencollective.com/libpostal/backer/29/website" target="_blank"><img src="https://opencollective.com/libpostal/backer/29/avatar.svg"></a>
|
||||||
|
|
||||||
Installation
|
Installation (Mac/Linux)
|
||||||
------------
|
------------------------
|
||||||
|
|
||||||
Before you install, make sure you have the following prerequisites:
|
Before you install, make sure you have the following prerequisites:
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ git clone https://github.com/openvenues/libpostal
|
|||||||
cd libpostal
|
cd libpostal
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
./configure --datadir=[...some dir with a few GB of space...]
|
./configure --datadir=[...some dir with a few GB of space...]
|
||||||
make
|
make -j4
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
# On Linux it's probably a good idea to run
|
# On Linux it's probably a good idea to run
|
||||||
@@ -139,7 +139,10 @@ For example, if you write a program called app.c, you can compile it like this:
|
|||||||
gcc app.c `pkg-config --cflags --libs libpostal`
|
gcc app.c `pkg-config --cflags --libs libpostal`
|
||||||
```
|
```
|
||||||
|
|
||||||
**On Windows (MSys2/MinGW)**
|
Installation (Windows)
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
**MSys2/MinGW**
|
||||||
|
|
||||||
For Windows the build procedure currently requires MSys2 and MinGW. This can be downloaded from http://msys2.org. Please follow the instructions on the MSys2 website for installation.
|
For Windows the build procedure currently requires MSys2 and MinGW. This can be downloaded from http://msys2.org. Please follow the instructions on the MSys2 website for installation.
|
||||||
|
|
||||||
@@ -160,7 +163,7 @@ cd libpostal
|
|||||||
cp -rf windows/* ./
|
cp -rf windows/* ./
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
./configure --datadir=[...some dir with a few GB of space...]
|
./configure --datadir=[...some dir with a few GB of space...]
|
||||||
make
|
make -j4
|
||||||
make install
|
make install
|
||||||
```
|
```
|
||||||
Notes: When setting the datadir, the `C:` drive would be entered as `/c`. The libpostal build script automatically add `libpostal` on the end of the path, so '/c' would become `C:\libpostal\` on Windows.
|
Notes: When setting the datadir, the `C:` drive would be entered as `/c`. The libpostal build script automatically add `libpostal` on the end of the path, so '/c' would become `C:\libpostal\` on Windows.
|
||||||
@@ -675,6 +678,12 @@ Bug reports, issues and pull requests are welcome. Please read the [contributing
|
|||||||
|
|
||||||
Submit issues at: https://github.com/openvenues/libpostal/issues.
|
Submit issues at: https://github.com/openvenues/libpostal/issues.
|
||||||
|
|
||||||
|
|
||||||
|
Shoutouts
|
||||||
|
---------
|
||||||
|
|
||||||
|
Special thanks to @BenK10 for the initial Windows build and @AeroXuk for integrating it seamlessly into the project and setting up an Appveyor build.
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ AC_TYPE_UINT8_T
|
|||||||
AC_CHECK_TYPES([ptrdiff_t])
|
AC_CHECK_TYPES([ptrdiff_t])
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_CHECK_FUNCS([malloc realloc getcwd gettimeofday memmove memset regcomp setlocale sqrt strdup strndup])
|
AC_CHECK_FUNCS([malloc realloc drand48 getcwd gettimeofday memmove memset regcomp setlocale sqrt strdup strndup])
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
libpostal.pc
|
libpostal.pc
|
||||||
|
|||||||
@@ -12,7 +12,11 @@
|
|||||||
* to anyone/anything when using this software.
|
* to anyone/anything when using this software.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//I've rearranged the source into a header-only implementation for drand48() -Benjamin Kusin
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_DRAND48
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "drand48.h"
|
#include "drand48.h"
|
||||||
@@ -68,3 +72,5 @@ double drand48(void)
|
|||||||
{
|
{
|
||||||
return erand48(_rand48_seed);
|
return erand48(_rand48_seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // HAVE_DRAND48
|
||||||
|
|||||||
@@ -12,11 +12,15 @@
|
|||||||
* to anyone/anything when using this software.
|
* to anyone/anything when using this software.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//I've rearranged the source into a header-only implementation for drand48() -Benjamin Kusin
|
|
||||||
|
|
||||||
#ifndef _DRAND48_H
|
#ifndef _DRAND48_H
|
||||||
#define _DRAND48_H
|
#define _DRAND48_H
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_DRAND48
|
||||||
|
|
||||||
#define RAND48_SEED_0 (0x330e)
|
#define RAND48_SEED_0 (0x330e)
|
||||||
#define RAND48_SEED_1 (0xabcd)
|
#define RAND48_SEED_1 (0xabcd)
|
||||||
#define RAND48_SEED_2 (0x1234)
|
#define RAND48_SEED_2 (0x1234)
|
||||||
@@ -37,5 +41,7 @@ double erand48(unsigned short xseed[3]);
|
|||||||
|
|
||||||
double drand48(void);
|
double drand48(void);
|
||||||
|
|
||||||
|
#endif // HAVE_DRAND48
|
||||||
|
|
||||||
#endif // _DRAND48_H
|
#endif // _DRAND48_H
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_STRNDUP
|
#ifndef HAVE_STRNDUP
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
#ifndef STRNDUP_H
|
#ifndef STRNDUP_H
|
||||||
#define STRNDUP_H
|
#define STRNDUP_H
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_STRNDUP
|
#ifndef HAVE_STRNDUP
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ AC_TYPE_UINT8_T
|
|||||||
AC_CHECK_TYPES([ptrdiff_t])
|
AC_CHECK_TYPES([ptrdiff_t])
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_CHECK_FUNCS([malloc realloc getcwd gettimeofday memmove memset regcomp setlocale sqrt strdup strndup])
|
AC_CHECK_FUNCS([malloc realloc drand48 getcwd gettimeofday memmove memset regcomp setlocale sqrt strdup strndup])
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
libpostal.pc
|
libpostal.pc
|
||||||
|
|||||||
Reference in New Issue
Block a user