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

Google OR-Tools package #507

Open
DiTo97 opened this issue Jun 20, 2021 · 8 comments
Open

Google OR-Tools package #507

DiTo97 opened this issue Jun 20, 2021 · 8 comments
Labels

Comments

@DiTo97
Copy link

DiTo97 commented Jun 20, 2021

Chaquopy version

9.1

Python version

3.7.7

Gradle version

4.2.1

Relevant parts of your build.gradle file

apply plugin: 'com.android.application'
apply plugin: 'com.chaquo.python'

android {
compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig {
    python {
        // Link the Python executable
        buildPython "C:\path\to\python.exe"

        pip {
            install "numpy"
            install "ortools"
        }
    }
}

}

Describe your issue

I have possibly tried anything that I could have done following the setup guidelines in your documentation, but Google OR-Tools package won't let the Android app build by any chance; conversely, NumPy does not pose any problems.

This is the error message that I have been getting:

Could not find a version that satisfies the requirement ortools.
No matching distribution found for ortools.

As you state in this section of the FAQ, https://chaquo.com/chaquopy/doc/current/faq.html#chaquopy-cannot-compile-native-code, I think the issue is that you don't have a pre-built wheel for the OR-Tools package. Am I right in saying that? Is there any chance you will add it to Chaquopy in the near future?

I could try to use OR-Tools Java library, but since the app I am developing with Chaquopy has a pretty large Python logic on its back I would prefer not to, unless there is absolutely no other way out of this.

@mhsmith
Copy link
Member

mhsmith commented Jun 20, 2021

Thanks for the report. This package isn't currently a priority, but I'll update this issue if we add it in the future. And if anyone else wants it too, please click the thumbs-up button above.

According to google/or-tools#1130, OR-Tools isn't available for Java on Android either.

Have a look at the list of other packages Chaquopy supports: maybe one of them could be used as an alternative.

@DiTo97
Copy link
Author

DiTo97 commented Jun 21, 2021

Thanks for the report. This package isn't currently a priority, but I'll update this issue if we add it in the future. And if anyone else wants it too, please click the thumbs-up button above.

According to google/or-tools#1130, OR-Tools isn't available for Java on Android either.

Have a look at the list of other packages Chaquopy supports: maybe one of them could be used as an alternative.

Thank you, then, for taking a look at it.

Before dwelling on a client-server approach (with the Android app letting OR-Tools do the dirty work on the server), I tried to install it as a wheel since I saw you have this possibility with Chaquopy. I changed the whole configuration to match the one suggested in https://chaquo.com/chaquopy/doc/current/versions.html, moving to Python 3.8.6 and Gradle 4.1.1.

I then downloaded the wheel from https://pypi.org/project/ortools/#files with cp38 and x86_64 as tags, put it in a folder named wheels under the Android app's project root folder and asked pip to install in the build.gradle, specifying the x86_64 ABI type, similarly to what you show in the Requirements section of the Gradle setup guide.

Unfortunately I keep getting the ortools-9.0.9048-cp38-cp38-*.whl is not a supported wheel on this platform error. So, am I missing something here, or is installing a pip wheel on Chaquopy not as straightforward as I thought?

@mhsmith
Copy link
Member

mhsmith commented Jun 21, 2021

The only wheels that can be installed on Chaquopy are either pure-Python ones (with "none-any" in their name), or native Android ones like those in our repository.

If you'd like to try building an OR-Tools wheel for Android, you could license the package build tool which we use to build everything in our repository. The tool supports CMake, which it looks like is the recommended way of building an OR-Tools wheel. We would provide support for the tool itself, but we have no expertise in OR-Tools specifically, so it would be up to you understand their build system and deal with any package-specific issues. For more details, see #175 (comment).

@mhsmith
Copy link
Member

mhsmith commented Dec 22, 2022

It's been over a year and only one person has requested this package, so we won't be adding it in the foreseeable future.

However, the package build tool is now open-source, so if you'd like to try building this package yourself, follow the instructions here. And if you're successful, please make a pull request so we can add it to the public repository.

If anyone else wants this package, please click the thumbs-up button above and post a comment, and I'll reopen the issue.

@mhsmith mhsmith closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2022
@tomika
Copy link

tomika commented Jun 22, 2024

It would be nice to have an Android package

@mhsmith mhsmith reopened this Jun 22, 2024
@DiTo97
Copy link
Author

DiTo97 commented Jun 23, 2024

@mhsmith, guess I'm no longer standing alone! 💪

@tomika
Copy link

tomika commented Jun 23, 2024

You're definitely not. My only solution was to create a webservice with or-tools based backend, but this way you have to be online :/ It would be far better to solve the problem locally.

@DiTo97
Copy link
Author

DiTo97 commented Jun 23, 2024

@tomika, exactly how I solved back in the day.

if the optimization process is very large and complex, decentralizing it to a dedicated backend still has its place, but it would be nice to solve easier ones on edge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants