Skip to content

oliviercailloux/google-or-tools-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google OR-Tools for Java

Build Status Artifact on Maven Central

A project to publish Google OR-Tools as a dependable dependency in Maven.

This project contains no specific source code (except for a simple test class). Everything comes from Google OR-Tools.

Depending on Google OR-Tools

Here is how to use this project as a dependency in your own project.

  • Add this project as a dependency (find its Maven coordinates using the badge above) of your project

  • To configure your library path correctly for tests, configure maven-surefire-plugin, see this pom as an example

  • Copy the lib folder of this project into your own project (for linux, hoping that it will work), or replace its content with libraries appropriate for your OS: check inside the lib folder of the release version corresponding to your OS

  • Copy the test class from this project into your own project

  • Run the unit test using Maven: it should load the native library, run the solver, and come out green

  • To configure Eclipse so that it finds the native library, in the project properties, Java Build Path, Source tab, google-or-tools/src/test/java, Native library location, specify as Location path: google-or-tools/lib (for other IDEs, adapt accordingly)

  • Run io.github.oliviercailloux.google_or_tools.TestRun as JUnit test from your IDE, it should pass

The above configures your library path correctly only for running tests. You will probably want to make sure that your library path is set correctly for normal operation as well. Multiple manners exist, depending on your particular needs, how you want to distribute your project, …

About more recent versions

For reasons of time, I do not intend to keep this library systematically up-to-date. In other words, the version published here is older than the last version of Google OR-Tools, on which the developer site is based. See also this issue.

Please do not ask for updates: I will update only as my own projects require (meaning, rarely, if ever). Please rather add your voice – or thumb – here in hope that the main developers publish the library to Maven Central themselves. In the meantime, you can also fork this repository and update it under your own groupId: given the instructions below, it might (hopefully?) be easy.

Making Google OR-Tools for Java

Here is how to re-make this project from scratch (except for the test class and pom.xml, which I created manually).

  • install prerequisites

  • set ${dest} variable

  • clone OR-Tools in a folder whose full path contain no space

  • git checkout v6.7.2

  • make third_party

  • make java

  • mv "ortools/gen/com" "${dest}/src/main/java/"

  • rmdir "${dest}/src/main/java/com/google/ortools/flatzinc" "${dest}/src/main/java/com/google/ortools/properties" "${dest}/src/main/java/com/google/ortools/sat"

  • Download the library for Ubuntu 14 (this version seems to runs both on Travis and on my Debian system, probably out of pure luck)

  • Extract the archive, move or-tools_Ubuntu-14.04-64bit_v6.7.4981/lib/libortools.so and libjniortools.so to "${dest}/lib/"

About

Google OR-Tools for Java

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages