tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: BLAS in pkgsrc: present and future



On 2019-04-24 07:54, Dr. Thomas Orgis wrote:
Am Wed, 17 Apr 2019 20:26:15 -0400
schrieb Greg Troxel <gdt%lexort.com@localhost>:

pkgsrc has long had a concept, not necessarily clearly mapped to
variable namespaces, of "package-settable variables" and "user-settable
variables".
Right now, there is BLAS_TYPE as user-settable (mk.conf) and the final
variable set for the build, the blas.bl3.mk logic only filling it in.
BLAS_ACCEPTED is per-package. Then, there's BLAS_LIBS, LAPACK_LIBS
being set, and the internal _BLAS_PACKAGE and _BLAS_TYPE (and
_BLAS_TYPES, as implementation detail).

BLAS_PREFERRED= #user
BLAS_ACCEPTED= #package
_BLAS_VERSION= # internal

There is a question of having PKGSRC_ prefixes, as seems to be the
modern trend.
So, we are discussing renaming of BLAS_TYPE to PKGSRC_BLAS_TYPE, or
indeed replacement by PKGSRC_BLAS_PREFERRED?

Since we have BLAS_ACCEPTED, I guess one should keep the option of a
second choice if the main BLAS is not compatible. So, I'm for extending
the blas.bl3.mk to support PKGSRC_BLAS_PREFERRED.

But the result of the matching with BLAS_ACCEPTED (without PKGSRC_
prefix ­— or do we want to plaster package Makefiles with PKGSRC_
everywhere?) shall still be called BLAS_TYPE? Or _BLAS_TYPE?
I'd like to keep BLAS_LIBS and LAPACK_LIBS, as these are not uncommon
to be the actual environment variables that you need to set for BLAS
choice in builds.

I wonder about the semantics of PKGSRC_BLAS_PREFERRED. Does ‘prefer’
imply that any BLAS not on the list is not acceptable? Or should a
package that does not support any of the preferred BLAS get built with
another default?

Do we actually have much of a problem with namespace collision in the
Makefiles? In theory, it's a mess. But is it in practice? Do we have a
consensus to prefix all new variables in included Makefile fragments
with PKGSRC_? Or do we just continue to handle conflicts as they arise?


Alrighty then,

Thomas

I see a clear semantic difference between PREFERRED and ACCEPTED.

The former would allow implementations not listed and the latter would not.

I think the system should choose the first implementation listed in [PKGSRC_]BLAS_PREFERRED in all cases except where it conflicts with [PKGSRC_]BLAS_ACCEPTED, in which case is chooses the first in ACCEPTED.

In the case where a given implementation is broken on a given platform, the user can work around it by changing PREFERRED to one that works until the package is fixed.

We cannot limit an installation to one BLAS implementation without causing serious problems.  One of my genomics apps, plink, currently dumps core when built with openblas and works fine with netlib. Some other apps won't achieve acceptable performance with netlib (where BLAS routines are bottleneck).

I don't think there are any major risks to installing multiple BLAS versions.  I've been doing it for years with FreeBSD ports, where each port selects its own implementation independently.

I don't think there's much chance of collisions using BLAS_*, but it is theoretically possible that an application could use something like BLAS_PREFERRED with different semantics.  Using PKGSRC_BLAS_* might be better just for the sake of self-documentation, so people know at a glance that they're looking at a PKGSRC knob rather than an upstream knob.

Cheers,

    JB


Home | Main Index | Thread Index | Old Index