You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For v8.0 we are migrating to use maven to create java package
Todo List:
Use Maven in CMake based build
Add Maven package to CMake based build
Use Maven for samples (ortools/*/samples)
Use Maven for examples (examples/contrib examples/java)
Use Maven for tests (examples/tests)
Use Maven in Make based build
Add Maven packages to Make based build
Use Maven for samples
Use Maven for examples
Use Maven for tests
Rework archive to use Maven packages
Linux archive
MacOS archive
Windows archive
Add internal doc in:
ortools/java/README.md
ortools/java/doc/local_pipeline.dot
cmake/doc/java.md
Reacted by jurisk, Ivan Mashintsev, Elliot Marx, Veniamin Viflyantsev, Narek, Nikita Solovyev, Liu JiaXing, tobinam, Sam Groenjes, abhinavgaur and 14 more
I would definitely appreciate being able to integrate or-tools using Maven
Reacted by Daniel Khashabi, jurisk, Mizux Seiha, Georgios Savvidis, Oleg, Pavan Kumar Chaitanya L, Martin Schneider, Saitel Agudelo, Jo WTF, Nelson Estevão and 8 more
Yes I would like to provide a maven (gradle ? ivy ?) package for or-tools ASAP and ideas are welcome !
How I see it currently:
1.Have a clean and modern CMake project to replace Makefile (cf WIP mizux/cmake branch)
2. Have a gradle project with cpp-plugin/JNI to wrap libortools.so
3. Use gradle plugin "maven-publish'
4. Profit !
@magneticflux- & @lalithsuresh thank you for the heads-up, I just tested it out and it's great. I can develop locally on OSX and deploy on Linux easily. Appreciate it!
Extract the zip file and run these 2 commands inside the folder: mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="ortools-win32-x86-64-8.0.8283.jar" -DpomFile="pom-runtime.xml" mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="ortools-java-8.0.8283.jar" -DpomFile="pom-local.xml"
Add the following dependencies to your project (in my case, to run or-tools over windows) : <dependency> <groupId>com.skaggsm.ortools</groupId> <artifactId>ortools-natives-all</artifactId> <version>8.0.8283</version> <type>pom</type> </dependency> <dependency> <groupId>com.google.ortools</groupId> <artifactId>ortools-java</artifactId> <version>8.0.8283</version> </dependency> <dependency> <groupId>com.google.ortools</groupId> <artifactId>ortools-win32-x86-64</artifactId> <version>8.0.8283</version> </dependency>
Run a test file , calling first the loader and then setting up the solver: @Test public void test(){ OrToolsHelper.loadLibrary(); MPSolver solver = MPSolver.createSolver("SCIP"); }
For those that had trouble running Makefile in order to install the jars follows a detailed set-up guide based on @magneticflux- 's solution:
1. Guarantee maven (mvn) executable folder (e.g. /bin) is on your classpath
2. Download binaries (version 8.0) for your OS at https://github.com/google/or-tools/releases/tag/v8.0. For Windows the link is https://github.com/google/or-tools/releases/download/v8.0/or-tools_VisualStudio2019-64bit_v8.0.8283.zip
3. Extract the zip file and run these 2 commands inside the folder:
`mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="ortools-win32-x86-64-8.0.8283.jar" -DpomFile="pom-runtime.xml"`
`mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="ortools-java-8.0.8283.jar" -DpomFile="pom-local.xml"`
4. Add the following dependencies to your project (in my case, to run or-tools over windows) :
` <dependency> <groupId>com.skaggsm.ortools</groupId> <artifactId>ortools-natives-all</artifactId> <version>8.0.8283</version> <type>pom</type> </dependency> <dependency> <groupId>com.google.ortools</groupId> <artifactId>ortools-java</artifactId> <version>8.0.8283</version> </dependency> <dependency> <groupId>com.google.ortools</groupId> <artifactId>ortools-win32-x86-64</artifactId> <version>8.0.8283</version> </dependency>`
5. Run a test file , calling first the loader and then setting up the solver:
` @Test public void test(){ OrToolsHelper.loadLibrary(); MPSolver solver = MPSolver.createSolver("SCIP"); }`
I'm not sure why you're installing both my distribution and the official one. You don't need both; mine has everything included and has extra extraction functionality.
With the sunsetting of JCenter, this is more urgent for me in particular. I'm not keen on shouldering the cost of hosting large binaries myself going forward, so I'd like my solution to just depend on official binaries on Maven Central.
@Mizux thanks! I just tested the Darwin version and it works.
note: I failed the linux artifact which is currently depending on GLIBC 2.33
Could you elaborate more on this?
If it helps, I'm getting an error about needing GLIBC 2.29 when running on Ubuntu 18.04.
java.lang.UnsatisfiedLinkError: /tmp/ortools-java7239044082451951181/linux-x86-64/libjniortools.so: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/ortools-java7239044082451951181/linux-x86-64/libortools.so)
see #2520
TLDR the runtime has been built against GLIBC 33 (archlinux) need to build the package against an "older" Linux distro
This is great news, and we appreciate your hard work!
Question: Is there a solution to have this work with Docker? For example, it works fine for me locally but whenever I run my docker build it cannot find the JNI/Library resource files like it can when I run locally, it extracts and discovers them automatically with my Spring/Java build.
Activity
lperron commentedon Jun 30, 2016
These are actual contributed and we did not do it.
I will contact the author to see if we can transfer it to or-tools.
Thanks
Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53
00
2016-06-30 0:20 GMT+02:00 Daniel Khashabi notifications@github.com:
punkeel commentedon Aug 26, 2016
I would definitely appreciate being able to integrate or-tools using Maven
dlahlou commentedon Aug 26, 2016
Hello Punkeel,
It's on our to-do list to support Maven. Thank you.
Regards,
Driss
On Aug 26, 2016 03:36, "PunKeel" notifications@github.com wrote:
I would definitely appreciate being able to integrate or-tools using Maven
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#202 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ASwpfG_r17r_em0h0ROiUDNRupAb5C2cks5qjkL8gaJpZM4JBn-L
.
guizmaii commentedon Nov 30, 2017
Any news ?
fcorneli commentedon Dec 8, 2017
Maven support would be interesting...
Mizux commentedon Dec 8, 2017
hi all,
Yes I would like to provide a maven (gradle ? ivy ?) package for or-tools ASAP and ideas are welcome !
How I see it currently:
1.Have a clean and modern CMake project to replace Makefile (cf WIP mizux/cmake branch)
2. Have a gradle project with cpp-plugin/JNI to wrap libortools.so
3. Use gradle plugin "maven-publish'
4. Profit !
[-]new maven releases? [/-][+]Add Maven Support [/+]49 remaining items
amucunguzi commentedon Nov 18, 2020
@dillonmabry our team has been using this: https://github.com/panavis/google-or-tools-maven. We hope that there will be an official release soon. @Mizux.
suming commentedon Nov 21, 2020
@amucunguzi thank you for working on this! I saw that https://github.com/panavis/google-or-tools-maven doesn't have a dependency for mac -- is that on it's way at all?
magneticflux- commentedon Nov 21, 2020
@suming My version #202 (comment) has all OS distributions available 👀
lalithsuresh commentedon Nov 21, 2020
Yes, I've been using @magneticflux-'s version on OSX and it works fine.
suming commentedon Nov 21, 2020
@magneticflux- & @lalithsuresh thank you for the heads-up, I just tested it out and it's great. I can develop locally on OSX and deploy on Linux easily. Appreciate it!
dillonmabry commentedon Dec 6, 2020
Using this version currently with no issues, thanks for your support! Works as expected.
ErickPol commentedon Dec 22, 2020
For those that had trouble running Makefile in order to install the jars follows a detailed set-up guide based on @magneticflux- 's solution:
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="ortools-win32-x86-64-8.0.8283.jar" -DpomFile="pom-runtime.xml"mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="ortools-java-8.0.8283.jar" -DpomFile="pom-local.xml"<dependency> <groupId>com.skaggsm.ortools</groupId> <artifactId>ortools-natives-all</artifactId> <version>8.0.8283</version> <type>pom</type> </dependency> <dependency> <groupId>com.google.ortools</groupId> <artifactId>ortools-java</artifactId> <version>8.0.8283</version> </dependency> <dependency> <groupId>com.google.ortools</groupId> <artifactId>ortools-win32-x86-64</artifactId> <version>8.0.8283</version> </dependency>@Test public void test(){ OrToolsHelper.loadLibrary(); MPSolver solver = MPSolver.createSolver("SCIP"); }magneticflux- commentedon Dec 23, 2020
I'm not sure why you're installing both my distribution and the official one. You don't need both; mine has everything included and has extra extraction functionality.
jbellis commentedon Jan 11, 2021
Is there a ticket for maven central publishing?
magneticflux- commentedon Mar 24, 2021
With the sunsetting of JCenter, this is more urgent for me in particular. I'm not keen on shouldering the cost of hosting large binaries myself going forward, so I'd like my solution to just depend on official binaries on Maven Central.
Mizux commentedon Apr 21, 2021
FYI, first 8.2 RC (8.2.9004)
https://search.maven.org/search?q=g:com.google.ortools
https://mvnrepository.com/artifact/com.google.ortools
note: I failed the linux artifact which is currently depending on GLIBC 2.33 (archlinux ^^;)
example usage: https://github.com/or-tools/java_or-tools/blob/6df2f03abe2b869f197eafe4c0846a376dbe04a0/pom.xml#L51-L59
lalithsuresh commentedon Apr 21, 2021
@Mizux thanks! I just tested the Darwin version and it works.
Could you elaborate more on this?
If it helps, I'm getting an error about needing GLIBC 2.29 when running on Ubuntu 18.04.
Mizux commentedon Apr 22, 2021
see #2520
TLDR the runtime has been built against GLIBC 33 (archlinux) need to build the package against an "older" Linux distro
dillonmabry commentedon May 5, 2021
This is great news, and we appreciate your hard work!
Question: Is there a solution to have this work with Docker? For example, it works fine for me locally but whenever I run my docker build it cannot find the JNI/Library resource files like it can when I run locally, it extracts and discovers them automatically with my Spring/Java build.
I am using JDK 11 and Maven if that helps.
Thank you!
Mizux commentedon May 6, 2021
@dillonmabry let's open a new issue with your docker issue.
note: You are not the only one with this feedback IIRC but I was never be able to reproduce it...
see: https://github.com/or-tools/java_or-tools/blob/main/Dockerfile and https://github.com/or-tools/java_or-tools/runs/2441985470?check_suite_focus=true