HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
libprima
prima
Fortran2023–2026
libprima / prima

prima

PRIMA is a package for solving general nonlinear optimization problems without using derivatives. It provides the reference implementation for Powell's derivative-free optimization methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. PRIMA means Reference Implementation for Powell's methods with Modernization and Amelioration, P for Powell.

8Distinct people
18Mentions
0Explicit recommenders
421GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

PRIMA is a package for solving general nonlinear optimization problems without using derivatives. It provides the reference implementation for Powell's derivative-free optimization methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. PRIMA means Reference Implementation for Powell's methods with Modernization and Amelioration, P for Powell.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year18 dated mentions

Observed mentions: 2023-04-21 15:53:38 UTC to 2026-07-13 08:57:06 UTC.

02462023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 7 mentions; 2 submissions, 5 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC716
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC725
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC303

What Hacker News says

18 sources
I just recently made some Python wrappers for a Modern Fortran optimization library for derivative free optimization. https://github.com/libprima/prima It basically had to go through Fortran -> C -> C++ (with pybind11) -> Python. At one point we had a slightly simpler setup with Fortran -> C -> Python (with ctypes), but ended up going with pybind11 after some discussion with the SciPy folks who steered us away from ctypes.
In PyPy has been working for me for several years now
The developer of PRIMA here. If you use method "cobyla" from scipy.optimize.minimize, then answer is now. PRIMA already performs far better (in terms of the number of function evaluations). See the comparison at https://github.com/libprima/prima#improvements . The bugs are indeed only a secondary reason: they can only be triggered under special situations. They may not affect your usage at all (when it does affect you, the consequence is catastrophophic).
In Prima has got a Python interface
PRIMA is a package for solving general nonlinear optimization problems without using derivatives. It provides the reference implementation for Powell's renowned derivative-free optimization methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. The "P" in the name stands for Powell, and "RIMA" is an acronym for "Reference Implementation with Modernization and Amelioration". Thanks to the huge efforts of Nickolai Belakovski, PRIMA now has an official Python interface. It talks to Python via pybind11 and its C API instead of using F2PY. I hope PRIMA will provide an example of binding modern Fortran libraries with Python. Concerning Python, the next steps of PRIMA will be - making PRIMA available on PyPI; - making PRIMA available on Conda; - getting PRIMA into SciPy (see https://github.com/libprima/prima/issues/112 ). PRIMA is part of a
Read the rest
research project funded by the Hong Kong Research Grants Council and the Department of Applied Mathematics (AMA) at the Hong Kong Polytechnic University (PolyU). The current version is ready to be used in Fortran, in C, in Python, in MATLAB, and in Julia. ------ Who was Powell? (from https://github.com/libprima/prima#who-was-powell) Michael James David Powell FRS [1] was "a British numerical analyst who was among the pioneers of computational mathematics" [2]. He was the inventor/early contributor of quasi-Newton method [3], trust region method [4], augmented Lagrangian method [5], and SQP method [6]. Each of them is a pillar of modern numerical optimization. He also made significant contributions to approximation theory and methods [7]. Among numerous honors, Powell was one of the two recipients of the first Dantzig Prize [8] from the Mathematical Programming Society (MOS) and Society for Industrial and Applied Mathematics (SIAM). This is considered the highest award in optimization. [1] https://en.wikipedia.org/wiki/Michael_J._D._Powell []https://royalsocietypublishing.org/doi/full/10.1098/rsbm.201... [3] https://en.wikipedia.org/wiki/Quasi-Newton_method [4] https://en.wikipedia.org/wiki/Trust_region [5] https://en.wikipedia.org/wiki/Augmented_Lagrangian_method [6] https://en.wikipedia.org/wiki/Sequential_quadratic_programmi... [7] https://www.cambridge.org/highereducation/books/approximatio... [8] https://en.wikipedia.org/wiki/Dantzig_Prize
In Prima has got a Python interface
Who was Powell? (from https://github.com/libprima/prima#who-was-powell) Michael James David Powell FRS [1] was "a British numerical analyst who was among the pioneers of computational mathematics" [2]. He was the inventor/early contributor of quasi-Newton method [3], trust region method [4], augmented Lagrangian method [5], and SQP method [6]. Each of them is a pillar of modern numerical optimization. He also made significant contributions to approximation theory and methods [7]. Among numerous honors, Powell was one of the two recipients of the first Dantzig Prize [8] from the Mathematical Programming Society (MOS) and Society for Industrial and Applied Mathematics (SIAM). This is considered the highest award in optimization. [1] https://en.wikipedia.org/wiki/Michael_J._D._Powell [2] https://royalsocietypublishing.org/doi/full/10.1098/rs
Read the rest
In MJD Powell FRS in "Oral History of SIAM" [pdf]
1. nagfor Release 7.1(Hanzomon) Build 7149 released on March 5, 2024, fixed all the bugs spotted, but introduced an ICE when compiling PRIMA ( http://www.libprima.net ). The ICE has nothing to do with half-precision real, because it occurs when PRIMA is configured to use single or double precision. It can be reproduced by ``` git clone https://github.com/libprima/prima.git && cd prima && git checkout ec42cb0 && cd fortran/examples/lincoa && make ntest ``` 2. nagfor 7.2 released on 6 March, 2024 included neither the ICE nor the fixes for the bugs.
In Nagfor supports half-precision floating-point numbers
A native port is indeed planned. However, since we are talking about a project of about 10K lines of code (though many of the lines are comments), such a port will not be delivered very soon. In fact, native implementations of PRIMA in Python, MATLAB, C++, Julia, and R will all be done in the future. See https://github.com/libprima/prima#other-languages . But they will take time. PRIMA has been a one-man project since it started three years ago. Community help is greatly needed. Thanks.
In SciPy: Interested in adopting PRIMA, but little appetite for more Fortran code
It sounds like this was a difficult task. The motivation to fulfill Prof. Powell's request and help the community of derivative-free optimization users must have been strong. Congratulations on your achievement! From the GitHub README: > In the past years, while working on PRIMA, I have spotted a dozen of bugs in reputable Fortran compilers and two bugs in MATLAB. Each of them represents days of bitter debugging, which finally led to the conclusion that it was not a problem in my code but a flaw in the Fortran compilers or in MATLAB. From a very unusual angle, this reflects how intensive the coding has been. > The bitterness behind this "fun" fact is exactly why I work on PRIMA: I hope that all the frustrations that I have experienced will not happen to any user of Powell's methods anymore. I hope I am the last one in the world to decode
Read the rest
a maze of 244 GOTOs in 7939 lines of Fortran 77 code — I have been doing this for three years and I do not want anyone else to do it again. https://github.com/libprima/prima#a-fun-fact
In Optimization Without Derivatives: Prima Fortran Version and Inclusion in SciPy
Agreed. If (approximate) 1st-order information can be obtained in any way (even by *carefully* deployed finite difference), then gradient-based methods should be used. It is wrong to use DFO in such cases. > DFOs tend to have issues past a few dozens variables. It seems that the PRIMA git repo https://github.com/libprima/prima shows results on problems of hundreds of variables. Not sure how to interpret the results.
In Optimization Without Derivatives: Prima Fortran Version and Inclusion in SciPy

Showing the 15 most recent of 18 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.