{"id":18847790,"url":"https://github.com/jacobwilliams/slsqp","last_synced_at":"2026-01-24T08:04:57.760Z","repository":{"id":3442930,"uuid":"49037314","full_name":"jacobwilliams/slsqp","owner":"jacobwilliams","description":"Modern Fortran Edition of the SLSQP Optimizer","archived":false,"fork":false,"pushed_at":"2024-01-07T21:30:49.000Z","size":6981,"stargazers_count":92,"open_issues_count":3,"forks_count":20,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-12-30T13:57:03.243Z","etag":null,"topics":["constrained-optimization","fortran","fortran-package-manager","nnls","numerical-optimization","optimization","sqp"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobwilliams.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-01-05T02:42:41.000Z","updated_at":"2024-10-20T05:59:45.000Z","dependencies_parsed_at":"2023-01-13T12:30:52.648Z","dependency_job_id":"48159480-8d58-4484-8523-baa92f11816e","html_url":"https://github.com/jacobwilliams/slsqp","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fslsqp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fslsqp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fslsqp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fslsqp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobwilliams","download_url":"https://codeload.github.com/jacobwilliams/slsqp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239783815,"owners_count":19696448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["constrained-optimization","fortran","fortran-package-manager","nnls","numerical-optimization","optimization","sqp"],"created_at":"2024-11-08T03:09:41.465Z","updated_at":"2026-01-24T08:04:52.735Z","avatar_url":"https://github.com/jacobwilliams.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"![slsqp](media/logo.png)\n============\n\nModern Fortran Edition of the SLSQP Optimizer\n\n### Status\n\n[![Language](https://img.shields.io/badge/-Fortran-734f96?logo=fortran\u0026logoColor=white)](https://github.com/topics/fortran)\n[![GitHub release](https://img.shields.io/github/release/jacobwilliams/slsqp.svg)](https://github.com/jacobwilliams/slsqp/releases/latest)\n[![Build Status](https://github.com/jacobwilliams/slsqp/actions/workflows/CI.yml/badge.svg)](https://github.com/jacobwilliams/slsqp/actions)\n[![codecov](https://codecov.io/gh/jacobwilliams/slsqp/branch/master/graph/badge.svg)](https://codecov.io/gh/jacobwilliams/slsqp)\n[![last-commit](https://img.shields.io/github/last-commit/jacobwilliams/slsqp)](https://github.com/jacobwilliams/slsqp/commits/master)\n\n### Description\n\nThis is an updated version of the SLSQP nonlinear constrained optimization code. It can be used to solve nonlinear programming problems that seek to minimize a scalar performance index subject to nonlinear equality and inequality constraints as well as bounds on the variables.\n\nUpdates to the original code include:\n\n* It has been translated into free-form source.\n* It is now thread safe. The original version was not thread safe due to the use of saved variables in one of the subroutines.\n* It no longer uses obsolescent and non-standard Fortran features. It should now be 100% standard compliant (Fortran 2008).\n* It now has an easy-to-use object-oriented interface. The `slsqp_class` is used for all interactions with the solver. Methods include `initialize()`, `optimize()`, and `destroy()`.\n* It includes updated versions of some of the third-party routines used in the original code (BLAS, LINPACK, and NNLS).\n* Some new features were added to support printing error  messages and reporting iterations to the user.\n* The user can now specify the max and min `alpha` to use during the line search.\n* The user can supply a routine to compute the gradients of the objective function and constraints, or allow the code to estimate them using finite differences (backward, forward, or central).\n* The documentation strings in the code have been converted to [FORD](https://github.com/Fortran-FOSS-Programmers/ford) format, allowing for [nicely formatted documentation](https://jacobwilliams.github.io/slsqp/) to be auto-generated.\n* A couple of bug fixes noted elsewhere have been applied.\n\n### Building SLSQP\n\n#### **Fortran Package Manager**\n\nThe library can be built with the [Fortran Package Manager](https://github.com/fortran-lang/fpm) using the provided `fpm.toml` file like so:\n\n```bash\nfpm build --release\n```\n\nBy default, the library is built with double precision (`real64`) real values. Explicitly specifying the real kind can be done using the following processor flags:\n\nPreprocessor flag | Kind  | Number of bytes\n----------------- | ----- | ---------------\n`REAL32`  | `real(kind=real32)`  | 4\n`REAL64`  | `real(kind=real64)`  | 8\n`REAL128` | `real(kind=real128)` | 16\n\nFor example, to build a single precision version of the library, use:\n\n```\nfpm build --profile release --flag \"-DREAL32\"\n```\n\nTo use SLSQP within your fpm project, add the following to your `fpm.toml` file:\n\n```toml\n[dependencies]\nslsqp = { git=\"https://github.com/jacobwilliams/slsqp.git\" }\n```\n\nor, to use a specific version:\n```toml\n[dependencies]\nslsqp = { git=\"https://github.com/jacobwilliams/slsqp.git\", tag = \"1.3.0\" }\n```\n\n## Dependencies\n\nThe library requires some [BLAS](https://netlib.org/blas/) routines, which are included. However, the user may also choose to link to an external BLAS library. This can be done by using the `HAS_BLAS` compiler directive. For example:\n\n```\nfpm build --compiler gfortran --flag \"-DHAS_BLAS -lblas\"\n```\n\nHowever, note that an external BLAS can only be used if the library is compiled with double precision (`real64`) reals.\n\n### Documentation\n\n  The latest API documentation can be found [here](https://jacobwilliams.github.io/slsqp/). This was generated from the source code using [FORD](https://github.com/Fortran-FOSS-Programmers/ford).\n\n### License\n\n  * The original sourcecode and the modifications are released under a [permissive BSD-style license](https://github.com/jacobwilliams/slsqp/blob/master/LICENSE).\n\n### Development\n\n  * Development continues on [GitHub](https://github.com/jacobwilliams/slsqp).\n\n### References\n\n* [Original sourcecode at NETLIB](http://www.netlib.org/toms/733)\n* D. Kraft, \"[A software package for sequential quadratic programming](https://degenerateconic.com/uploads/2018/03/DFVLR_FB_88_28.pdf)\",\n  Technical Report DFVLR-FB 88-28, Institut für Dynamik der Flugsysteme,\n  Oberpfaffenhofen, July 1988.\n* D. Kraft, \"[Algorithm 733: TOMP--Fortran modules for optimal control calculations](http://dl.acm.org/citation.cfm?id=192124),\"\n  ACM Transactions on Mathematical Software, Vol. 20, No. 3, p. 262-281 (1994).\n* C. L. Lawson, R. J. Hanson, \"Solving Least Squares Problems\", Prentice Hall, 1974. (Revised 1995 edition)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwilliams%2Fslsqp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobwilliams%2Fslsqp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwilliams%2Fslsqp/lists"}