chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
807 stars 132 forks source link

How to build cvxopt package with GLPK support #1085

Open kmykman opened 8 months ago

kmykman commented 8 months ago

I use cvoxpt in the public package repository. I need to use glpk in cvoxpt but I got error.

ImportError("cannot import name 'glpk' from 'cvxopt'")

I saw from this in part "Install with GLPK support", it needs to install GLPK and then install CVXOPT with GLPK bindings.

CVXOPT_BUILD_GLPK=1
CVXOPT_GLPK_LIB_DIR=/path/to/glpk-X.X/lib
CVXOPT_GLPK_INC_DIR=/path/to/glpk-X.X/include
pip install cvxopt

Is that only can be achieved by building a new whl file? If so, how should the metadata yaml file be written? I have tried

package:
  name: cvxopt
  version: "1.2.5"
requirements:
  host:
    -url: https://ftp.gnu.org/gnu/glpk/glpk-4.35.tar.gz

but seems like it is wrong.

mhsmith commented 8 months ago

If GLPK is a native library, then you'll have to build that as a separate package first, and then probably patch cvxopt to set these environment variables during the build.

See the chaquopy-libzmq and pyzmq examples mentioned in the README, and pay attention to the section about "If any changes are needed to make the build work"