Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose address_parser executable #17

Merged
merged 1 commit into from
May 24, 2024
Merged

expose address_parser executable #17

merged 1 commit into from
May 24, 2024

Conversation

missinglink
Copy link
Member

this PR resolves #16

root@c6f384e8a86d:/# tree /libpostal/
/libpostal/
├── bin
│   ├── address_parser
│   └── libpostal_data
├── include
│   └── libpostal
│       └── libpostal.h
└── lib
    ├── libpostal.a
    ├── libpostal.la
    ├── libpostal.so -> libpostal.so.1.0.1
    ├── libpostal.so.1 -> libpostal.so.1.0.1
    ├── libpostal.so.1.0.1
    └── pkgconfig
        └── libpostal.pc

5 directories, 9 files
root@c6f384e8a86d:/# /libpostal/bin/address_parser <<< '12 example lane, example'
Loading models...

Welcome to libpostal's address parser.

Type in any address to parse and print the result.

Special commands:
.exit to quit the program


Result:

{
  "house_number": "12",
  "road": "example lane example"
}

root@c6f384e8a86d:/# echo $?
0
root@c6f384e8a86d:/#

@missinglink
Copy link
Member Author

missinglink commented May 21, 2024

I'm going to hold off merging this until speaking with @orangejulius

It might be that the original intent of fb62faa was to avoid placing the lib files in /libpostal/lib and therefore not being on LD_LIBRARY_PATH. [edit] Also the libpostal.h header file.

If that's the case then we might need to adjust this slightly so that the libs end up in the standard location but the executables end up in /libpostal, which is probably easiest done by just copying them

@missinglink
Copy link
Member Author

OK I added a second commit which should be ideal since it:

  • installs to the default OS location
  • copies all the libs, headers and executables across
  • tests itself

@missinglink missinglink force-pushed the executables branch 5 times, most recently from 87cd4a1 to e68e6bf Compare May 24, 2024 13:39
@missinglink
Copy link
Member Author

I've updated this to simplify it a lot. Seems I was mistaken about $DESTDIR, which is working correctly. The address_parser binary is located in the src directory rather than the build output.

@missinglink
Copy link
Member Author

with this change it's now possible to execute the address parser directly from inside the image:

docker run --rm -i pelias/libpostal_baseimage address_parser <<< '12 foo street'
Loading models...

Welcome to libpostal's address parser.

Type in any address to parse and print the result.

Special commands:
.exit to quit the program


Result:

{
  "house_number": "12",
  "road": "foo street"
}

@missinglink missinglink changed the title expose executables in /libpostal dir expose address_parser executable May 24, 2024
@missinglink missinglink changed the title expose address_parser executable expose address_parser executable May 24, 2024
@missinglink missinglink merged commit 53348d2 into master May 24, 2024
1 check passed
@missinglink missinglink deleted the executables branch May 24, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide executable binaries in image
1 participant