Skip to content

Commit

Permalink
230912.014331.HKT revise README
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Sep 11, 2023
1 parent ce9da0d commit ba2b7eb
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [How](#how)
- [Current status](#current-status)
- [Modern Fortran](#modern-fortran)
- [C](#c)
- [MATLAB](#matlab)
- [Python](#python)
- [Other languages](#other-languages)
Expand Down Expand Up @@ -204,37 +205,41 @@ to distribute this large amount of tests to multiple Team accounts as follows.
After almost **three** years of intensive coding, **the [modern Fortran version](./fortran) of
PRIMA has been finished by December 2022.**

#### MATLAB

- An [interface](./matlab/interfaces/prima.m) is provided for [using the **modern** Fortran implementation in MATLAB](./README_mat.md).
- <a name="newuoa_mat"></a>A [pure MATLAB version of NEWUOA](./matlab/interfaces/+newuoa_mat/) is implemented. It was
generated straightforwardly (indeed, **automatically**) from an earlier version of the
**modern** Fortran code (with the help of Mr. Galann Pennec). The other four solvers will be
implemented in MATLAB similarly.

#### Python

- The inclusion of PRIMA into SciPy is [under discussion](https://github.com/scipy/scipy/issues/18118). It will replace the [buggy](#bug-fixes) and unmaintained Fortran 77 version of [COBYLA underlying `scipy.optimize.minimize`](https://docs.scipy.org/doc/scipy/reference/optimize.minimize-cobyla.html#optimize-minimize-cobyla), and make the other four solvers available to all SciPy users.
- My ultimate objective is to have a native Python implementation of PRIMA **independent of Fortran**, similar to what we have done with NEWUOA in MATLAB as [mentioned above](#newuoa_mat).

#### C

A C binding to the Fortran library is written in the c folder. It can be compiled using CMake:

A C binding to the Fortran library is available in the [`c` folder](https://github.com/libprima/prima/tree/main/c).
It can be compiled using CMake as follows:
```bash
git clone --depth 1 https://github.com/libprima/prima.git
cd prima
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install -DBUILD_SHARED_LIBS=OFF
cmake --build build --target install
```

It should create the **primaf** library for Fortran use, located in the build/fortran directory,
and the **primac** library for C compilation, located in build/c to be used with the **prima.h** header in c/include/prima.

Examples on how to use the library from an external code are available in c/examples and fortran/examples:

Examples on how to use the library from an external code are available in [`c/examples`](https://github.com/libprima/prima/tree/main/c/examples).
Below is an illustration with COBYLA.
```bash
cd c/examples/cobyla
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install -DPRIMA_DIR=$PWD/../../../install/lib/cmake/prima/
cmake --build build --target install
./install/bin/cobyla_example
```

#### MATLAB

- An [interface](./matlab/interfaces/prima.m) is provided for [using the **modern** Fortran implementation in MATLAB](./README_mat.md).
- <a name="newuoa_mat"></a>A [pure MATLAB version of NEWUOA](./matlab/interfaces/+newuoa_mat/) is implemented. It was
generated straightforwardly (indeed, **automatically**) from an earlier version of the
**modern** Fortran code (with the help of Mr. Galann Pennec). The other four solvers will be
implemented in MATLAB similarly.

#### Python

- The inclusion of PRIMA into SciPy is [under discussion](https://github.com/scipy/scipy/issues/18118). It will replace the [buggy](#bug-fixes) and unmaintained Fortran 77 version of [COBYLA underlying `scipy.optimize.minimize`](https://docs.scipy.org/doc/scipy/reference/optimize.minimize-cobyla.html#optimize-minimize-cobyla), and make the other four solvers available to all SciPy users.
- My ultimate objective is to have a native Python implementation of PRIMA **independent of Fortran**, similar to what we have done with NEWUOA in MATLAB as [mentioned above](#newuoa_mat).

#### Other languages

Expand Down

0 comments on commit ba2b7eb

Please sign in to comment.