{ "info": { "author": "Gerhard Br\u00e4unlich", "author_email": "g.braeunlich@disroot.org", "bugtrack_url": null, "classifiers": [], "description": "[![DOI](https://zenodo.org/badge/143015117.svg)](https://zenodo.org/badge/latestdoi/143015117)\n\n# IPyOpt\n\nIPyOpt is a python module that allows you to use\n[Ipopt](http://www.coin-or.org/Ipopt/) in Python.\nIt was developed by Eric Xu when he was a PhD student at [Washington\nUniversity](https://wustl.edu/) and issued under the BSD license.\nOriginal repository: [xuy/pyipopt](https://github.com/xuy/pyipopt).\n\n## Installation\n\n### Dependencies\n\nIPyOpt depends on the following packages:\n\n1. A compiler and a linker, e.g. gcc, ld\n2. [Ipopt](https://projects.coin-or.org/Ipopt)\n3. [Numpy](http://numpy.scipy.org/)\n4. Python.h (part of the python source code, you can download it from\n [Python.org](http://python.org))\n\n### Install\n\nFirst, get the latest source code using:\n\n```sh\n$ git clone http://github.com/g-braeunlich/IPyOpt.git\n```\n\nCheck whether a file `ipopt.pc` was distributed with your Ipopt installation.\nIf this is the case and `ipopt.pc` is in the search path of `pkg-config`\n(on unix systems:\n`/usr/lib/pkgconfig`, `/usr/share/pkgconfig`, `/usr/local/lib/pkgconfig`,\n`/usr/local/share/pkgconfig`), nothing has to be modified.\n\nIn this case run\n\n```sh\n$ python setup.py build\n$ sudo python setup.py install\n```\n\t\nIf `pkg-config` is not available for your system, you will need to\npass appropriate information to `setup.py` by setting the environment\nvariable `CFLAGS`. Example:\n```sh\n$ CFLAGS=\"-I/usr/include/coin/ -l/usr/lib64 -lipopt -lmumps_common -ldmumps -lzmumps -lsmumps -lcmumps -llapack -lblas -lblas -lblas -lm -ldl' ./setup.py build\n$ sudo python setup.py install\n```\n\t\nIf you have an `ipopt.pc` which is not in the `pkg-config` search path,\nspecify the path via the `PKG_CONFIG_PATH` environment variable (see below).\nIf you cannot find an `ipopt.pc` in your `ipopt` installation, there is an\nexample pc file in the directory `pkgconfig`.\nCopy it to a location (best of all directly in a subfolder named\n`pkgconfig` of your Ipopt installation) and edit it to reflect the\nlibrary and include paths of the dependencies.\n\nThen do\n\n```sh\n$ PKG_CONFIG_PATH= python setup.py build\n$ sudo python setup.py install\n```\n\n## Usage\n\nYou can use IPyOpt like this:\n\n```python\nimport ipyopt\n# define your call back functions\nnlp = ipyopt.Problem(...)\nnlp.solve(...)\n```\n\nYou can also check out `examples/hs071.py` to see how to use IPyOpt.\n\nIPyOpt as a module comes with docstring. You can poke around \nit by using Python's `help()` command.\n\n## Testing\n\nI have included an example \n\nTo see if you have IPyOpt ready, use the following command under the\n`examples`'s directory. \n\n```sh\n$ python hs071.py\n```\n\t\nThe file `hs071.py` contains a toy optimization problem. If everything\nis OK, IPyOpt will invoke Ipopt to solve it for you. This python file\nis self-documented and can be used as a template for writing your own\noptimization problems. \n\nIPyOpt is a legitimate Python module, you can inspect it by using\nstandard Python commands like `dir` or `help`. All functions in\nIPyOpt are documented in details.\n\n**Hessian Estimation**: since Hessian estimation is usually tedious,\nIpopt can solve problems without Hessian estimation. IPyOpt also\nsupports this feature. The file `hs071.py` demonstrates the idea. If\nyou provide the `ipyopt.Problem` constructor with an `eval_h` callback\nfunction as well as the `apply_new` callback function, Ipopt will\ndelegate the Hessian matrix calculation to your function (otherwise\nIpopt will approximate Hessian for you).\n\n## Contributing\n\n1. Fork it.\n2. Create a branch (`git checkout -b new_branch`)\n3. Commit your changes (`git commit -am \"your awesome message\"`)\n4. Push to the branch (`git push origin new_branch`)\n5. Create a pull request\n6. Nag me about it if I am lazy.\n\n## Troubleshooting\n\n### Check Ipopt\n\nIPyOpt links to Ipopt's C library. If that library is not available IPyOpt will fail\nduring module initialization. To check the availability of this library, you can go to\n`$IPOPT_DIR/Ipopt/examples/hs071_c/`\nand issue `make` to ensure you can compile and run the toy example supplied by Ipopt. \n\n### Miscellaneous problems\n\n* Error:\n ```python\n import ipyopt\n ```\n ```\n ImportError: can not find libipopt.so.0\n ```\n\n* Solution:\n find it and copy it to a folder that ld can access\n\n* Error:\n ```python\n import ipyopt\n ```\n ```\n ImportError: /usr/lib/libipopt.so.0: undefined symbol: _gfortran_XXX\n ```\n\n* Solution: \n check if your `hs071_c` example work. It is very likely that your\n ipopt library is not correctly compiled.\n\n* Error:\n ```python\n import ipyopt\n ```\n ```\n ImportError: /usr/lib/libipopt.so.0: undefined symbol: SetIntermediateCallback\n ```\n\n* Solution:\n SetIntermediateCallback is a function added since Ipopt 3.9.1.\n (see https://projects.coin-or.org/Ipopt/changeset/1830 )\n Make sure you have an Ipopt version >= 3.9.1\n\n* Error:\n ```python\n import ipyopt\n ```\n ```\n ImportError: /usr/lib/libipopt.so.0: undefined symbol: ma19ad_\n ```\n\n* Solution:\n First, use \n ```sh\n nm /usr/lib/libipopt.so.0 | grep ma19ad_ \n ```\n to see if it is marked with U. It should. This means that\n `libipopt.so.0` is not aware of `libcoinhsl.so.0`. You can fix this by\n adding `-lcoinhsl` to the `CFLAGS` variable (see section install). It seems to me that\n this happens in the recent versions of ipopt. Eventually IPyOpt\n will have a better building mechanism, and I will fix this soon. \n\n* Error:\n ```python\n import ipyopt\n ```\n ```\n ImportError: /usr/lib/libipopt.so.0: undefined symbol: SomeKindOfSymbol\n ```\n\t\n* Solution:\n I can assure you that it is NOT a bug of IPyOpt. It is very\n likely that you did not link the right package when compiling\n IPyOpt. \n\t\n First, use \n ```sh\n nm /usr/lib/libipopt.so.0 | grep SomeKindOfSymbol\n ```\n to see if this symbol is indeed missing. Do a Google search to find the library file, and \n add `-lWhateverLibrary` to the `CFLAGS` variable (see section install). \n\t\n Ipopt is built using various third-party libraries. Different\n machines may have different set of libraries. You should \n try to locate these dependencies and indicate them when compiling\n IPyOpt. This is just a limitation of dynamic linking libraries\n and is not related to IPyOpt. Please do not report a missing symbol\n error as a \"bug\" to me unless you are 100% sure it is the problem\n of IPyOpt.\n\t\n\n## Contact\n\nGerhard Br\u00e4unlich \n\n## Credits\n* Modifications on logger made by OpenMDAO at NASA Glenn Research Center, 2010 and 2011\n* Added \"eval_intermediate_callback\" by OpenMDAO at NASA Glenn Research Center, 2010 and 2011\n* Modifications on the SAFE_FREE macro made by Guillaume Jacquenot, 2012\n* Changed logger from code contributed by alanfalloon", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/g-braeunlich/ipyopt", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ipyopt", "package_url": "https://pypi.org/project/ipyopt/", "platform": "", "project_url": "https://pypi.org/project/ipyopt/", "project_urls": { "Homepage": "https://github.com/g-braeunlich/ipyopt" }, "release_url": "https://pypi.org/project/ipyopt/0.9.2/", "requires_dist": null, "requires_python": "", "summary": "An IPOpt connector for Python", "version": "0.9.2" }, "last_serial": 5645402, "releases": { "0.9.0.post1": [ { "comment_text": "", "digests": { "md5": "7af6a05ce46e3a678aaf6db72752b135", "sha256": "09de15944d5ae81331e8fa809427888166743a6d08bc832d2f8fe1355e6a48f5" }, "downloads": -1, "filename": "ipyopt-0.9.0.post1.tar.gz", "has_sig": false, "md5_digest": "7af6a05ce46e3a678aaf6db72752b135", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14393, "upload_time": "2019-06-19T07:25:16", "url": "https://files.pythonhosted.org/packages/bc/59/3044a181197801114091892d4f2d5f385874269702eed4a0e562d2974815/ipyopt-0.9.0.post1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "4a80a058f7806466f6af3d3ccfb68c3f", "sha256": "5a105ef68227304c0bb81c7583cf9ea83d27bfc3584a7a2e531fdef991d49e03" }, "downloads": -1, "filename": "ipyopt-0.9.2.tar.gz", "has_sig": false, "md5_digest": "4a80a058f7806466f6af3d3ccfb68c3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23051, "upload_time": "2019-08-07T14:42:54", "url": "https://files.pythonhosted.org/packages/2c/8a/1847c60ca3cedf9397af254a7cc608b2657f293309d058f83c2d66f80e3a/ipyopt-0.9.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4a80a058f7806466f6af3d3ccfb68c3f", "sha256": "5a105ef68227304c0bb81c7583cf9ea83d27bfc3584a7a2e531fdef991d49e03" }, "downloads": -1, "filename": "ipyopt-0.9.2.tar.gz", "has_sig": false, "md5_digest": "4a80a058f7806466f6af3d3ccfb68c3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23051, "upload_time": "2019-08-07T14:42:54", "url": "https://files.pythonhosted.org/packages/2c/8a/1847c60ca3cedf9397af254a7cc608b2657f293309d058f83c2d66f80e3a/ipyopt-0.9.2.tar.gz" } ] }