From: Arnout Vandecappelle Date: Sun, 26 May 2019 11:43:47 +0200 Subject: [Buildroot] [PATCH v2] package/python-numpy: fix occasional build failure with lapack In-Reply-To: References: <20190515210342.126951-1-giulio.benetti@micronovasrl.com> <20190518221352.0630eaa6@windsurf> <74098714-11ae-9897-a5fb-71db0f04c44a@micronovasrl.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net On 20/05/2019 19:49, Giulio Benetti wrote: > Adding Samuel+, > > Il 20/05/2019 19:48, Giulio Benetti ha scritto: >> Hello Thomas, >> >> Il 19/05/2019 16:47, Giulio Benetti ha scritto: >>> Hello Thomas, All, >>> >>> Il 18/05/2019 22:13, Thomas Petazzoni ha scritto: [snip] >>>> ? - What happens when both clapack and lapack are enabled ? >>> >>> Python-numpy will choose the accelerator according to this list: >>> https://www.numpy.org/devdocs/user/building.html#accelerated-blas-lapack-libraries >> This ^^^^^^^^^^^^^ is wrong. >> The problem is that both lapack and clapack library names are equal: >> liblapack.so So, you are saying that if you build both lapack and clapack, you get only one .so file? >> So what happens here is that python-numpy will use clapack headers, >> then it will link with liblapack.so causing linking error. >> Because liblapack.so is from lapack(not clapack) due to alphabetical >> order when building. >> >> Basically clapack is the c implementation of lapack, but in lapack it's >> been implemented lapacke(a c interface) that makes clapack useless at >> this point. >> >> I see 2 options: >> - remove clapack completely because it's the same as lapacke(embedded in >> lapack) >> - make clapack and lapack exclusive selectable in their Config.in like: >> ?? (clapack Config.in) >> ?? depends on !BR2_PACKAGE_LAPACK >> ?? and: >> ?? (lapack Config.in) >> ?? depends on !BR2_PACKAGE_CLAPACK We indeed have to make the mutually exclusive. There are a number of ways that we can do that. A. Add a dependency (not like above because it's a circular dependency). B. Turn it into a virtual package. C. Turn it into a choice (in addition to making it a virtual package). The latter is probably the proper way. Cfr. how it was done for openssl/libressl and libjpeg/turbo-jpeg. >> But IMHO we should proceed with dropping clapack. Why? it is maintained, and it is a dependency of armadillo... I had a deeper look, and actually lapack and clapack are the same, just compiled differently: lapack is built with the fortran compiler, clapack is generated with f2c (by upstream) and built with the C compiler. AFAIU, anything that uses lapack should also be able to use clapack and vice versa. We have two packages like that: numpy and armadillo. They both seem to support both lapack and clapack. So, it seems indeed removing clapack is the appropriate thing. Except: lapack requires a fortran compiler, which is not always available. So in that sense, it would actually be more appropriate to remove lapack... But maybe it would be better to normally use lapack, and only enable clapack when lapack isn't available (i.e. when there's no fortran compiler). Regards, Arnout >>>> Also, perhaps we need: >>>> >>>> ????select BR2_PACKAGE_LAPACK_COMPLEX if BR2_PACKAGE_LAPACK >> >> This ^^^^^^^^^^ instead never built succesfully. >> It built successfully only because I was trying to build with: >> make python-numpy-dirclean python-numpy >> instead of: >> make clean all >> >> So I had a mess of LAPACK libraries in my environment(sorry). >> >> Best regards-- >> Giulio Benetti >> CTO >> >> MICRONOVA SRL >> Sede: Via A. Niedda 3 - 35010 Vigonza (PD) >> Tel. 049/8931563 - Fax 049/8931346 >> Cod.Fiscale - P.IVA 02663420285 >> Capitale Sociale ? 26.000 i.v. >> Iscritta al Reg. Imprese di Padova N. 02663420285 >> Numero R.E.A. 258642 >> >>>> in the Config.in file, so that it's a bit easier for users: they don't >>>> have to know they need that specific sub-option of lapack. >>> >>> If lapack selected yes, but that should come after adding a choice menu IMHO. >>> >>> Kind regards >> >> _______________________________________________ >> buildroot mailing list >> buildroot at busybox.net >> http://lists.busybox.net/mailman/listinfo/buildroot >