Code Monkey home page Code Monkey logo

google-or-tools-java's Introduction

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/"

google-or-tools-java's People

Contributors

oliviercailloux avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.