Skip to content

[new package] Initial libminpack insertion.#20643

Merged
MehdiChinoune merged 4 commits into
msys2:masterfrom
luau-project:new-package-libminpack
Apr 17, 2024
Merged

[new package] Initial libminpack insertion.#20643
MehdiChinoune merged 4 commits into
msys2:masterfrom
luau-project:new-package-libminpack

Conversation

@luau-project

Copy link
Copy Markdown
Contributor

Description

MINPACK [1] [2] [3] is a battle-tested software written in Fortran 77 for solving a system of nonlinear equations and nonlinear least squares problems. It is widely used in science, and currently employed on SciPy optimization [4].

Build

For mingw32, mingw64 and ucrt64, the build script uses gfortran to perform the build. On clang64 and clangarm64, it uses LLVM flang to build.

Tests

I have tested minpack binaries on all mingw archs on my Windows 11 virtual machine even out of msys2 tree, exception goes to clangarm64. Since the toolset is the same used by clang64, I am confident it is going to work on clangarm64 too.

@luau-project

Copy link
Copy Markdown
Contributor Author

The changes described below were motivated mostly by the valuable suggestions of @MehdiChinoune that arrived on my email, but I can't see on this board for whatever reason. I am going to write down and discuss briefly all the proposed and addressed changes.

Suggestions Outline

  • @MehdiChinoune asked to set up a sane package version (pkgver). Agreed;
  • @MehdiChinoune asked to drop mingw32 support. Probably it is a project decision due the low number of downloads for that environment, so it is ok;
  • @MehdiChinoune asked to not use debian repositories as the main source of distribution files. I didn't agree totally on that due debian reputation, but I followed the advice because the people directly involved with minpack (https://www.netlib.org/minpack) would benefit the links pointing to their website;
  • @MehdiChinoune also asked to refactor PKGBUILD code for the logic to be wrapped in the build function. Agreed on that.

Changes

In order to not use debian distribution files, and since the official minpack website (https://www.netlib.org/minpack) does not provide a file to download the library completely, I had to get each fortran file separetely. Moreover, since there's not a baked configure script in the sources and I don't have the skills to work with autotools, I had to write a CMake build / install script from scratch for both shared and static libraries. In the process to write the cmake script, I decided to add a pkgconfig file (minpack.pc) as install output.

Note

Even though the PKGBUILD script does not test the produced binaries explicitly, I tested them (except clangarm64) in my Windows 11 VM out of msys2 tree and such binaries worked as expected, once the required DLLs were placed aside.

Note

This new PKGBUILD version keeps the idea of building minpack library with flang on clang64 and clangarm64 environments, and uses the mature gfortran on mingw64 and ucrt64.

@MehdiChinoune

Copy link
Copy Markdown
Collaborator

I have pushed some little changes to clean PKGBUILD.

@MehdiChinoune
MehdiChinoune merged commit 17a7be9 into msys2:master Apr 17, 2024
@luau-project
luau-project deleted the new-package-libminpack branch April 18, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants