Bug 201965 - math/openblas doesn't install header files
Summary: math/openblas doesn't install header files
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Felder
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-07-29 11:06 UTC by Peter Jeremy
Modified: 2018-03-03 12:03 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (phd_kimberlite)


Attachments
Patches and their poudriere log (395.80 KB, application/octet-stream)
2015-08-07 12:59 UTC, Eijiro Shibusawa
phd_kimberlite: maintainer-approval+
Details
Alternative Makefile patch (3.35 KB, patch)
2015-09-13 10:21 UTC, Peter Jeremy
no flags Details | Diff
patch to head (2.51 KB, patch)
2016-02-19 15:58 UTC, Eijiro Shibusawa
phd_kimberlite: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Jeremy freebsd_committer freebsd_triage 2015-07-29 11:06:06 UTC
The math/openblas installation process only installs the libraries.  This makes it impossible to actually use the library because the necessary header files are missing.

$ pkg info -l openblas
openblas-0.2.14,1:
        /usr/local/lib/libopenblas.a
        /usr/local/lib/libopenblas.so
        /usr/local/lib/libopenblas.so.0
        /usr/local/lib/libopenblasp.a
        /usr/local/lib/libopenblasp.so
        /usr/local/lib/libopenblasp.so.0
        /usr/local/share/licenses/openblas-0.2.14,1/BSD3CLAUSE
        /usr/local/share/licenses/openblas-0.2.14,1/LICENSE
        /usr/local/share/licenses/openblas-0.2.14,1/catalog.mk

As a minimum, cblas.h needs to be installed.  Based on Makefile.install, this depends on openblas_config.h (which is built by Makefile.install).
Comment 1 Eijiro Shibusawa 2015-08-01 13:06:50 UTC
(In reply to Peter Jeremy from comment #0)

Hi,

Currently I have no plan to add cblas.h to the installation process.
If you require cblas.h please install math/cblas and specify libopenblas at link time.
Although I can modify the port to be installing the header file, 
this will require conflict mark to other cblas implementation (math/cblas and math/atlas).
I think that the conflict mark restricts the flexibility of BLAS library selection at link time.

However, because this port is used many users, convenience for C interface also should be considered.
[plan A]
* maintain current installation
[plan B]
* install cblas.h to /use/local/include and add conflict mark to cblas
[plan C]
* install cblas.h to some other place (e.g., /usr/local/include/openblas)

How do you think about this?

Best regards, Shibusawa
Comment 2 Peter Jeremy freebsd_committer freebsd_triage 2015-08-04 20:03:17 UTC
Plan A effectively makes openblas useless unless you solely use packages and hope that the openblas ABI (not API) precisely matches the ABI for whichever other BLAS was used to compile the packages that depend on BLAS.

My preference would be option B - looking at some of the other BLAS implementations, it seems to be a tossup whether they conflict or not.

Option C is probably workable.

A fourth option would be to make installing the header files an config option - which would also toggle the conflicts.
Comment 3 Eijiro Shibusawa 2015-08-07 12:59:20 UTC
Created attachment 159637 [details]
Patches and their poudriere log

Ok, I have created two patches corresponding to the option B and D, respectively.
The attached contains the two patches and their poudriere logs.

Before you decide which patch will be committed,
please obtain agreement of at least one committer who maintains dependency of this port.
If you use the Phabricator, I would appreciate it if you let me know the URL.

Thanks in advance, Shibusawa
Comment 4 Peter Jeremy freebsd_committer freebsd_triage 2015-09-12 23:24:40 UTC
I've tried using the patch for option D and, whilst it installs /usr/local/include/cblas.h, it doesn't install the "common.h" that cblas.h includes.  This leads to failures similar to the following:

In file included from ./include/caffe/util/mkl_alternate.hpp:11:
/usr/local/include/cblas.h:5:10: fatal error: 'common.h' file not found
#include "common.h"
         ^
1 error generated.
Comment 5 Peter Jeremy freebsd_committer freebsd_triage 2015-09-13 10:21:20 UTC
Created attachment 160965 [details]
Alternative Makefile patch

Attached is an alternative patch to the Makefile for option D.  Using this patch, I could build an application that needs BLAS.
Comment 6 Eijiro Shibusawa 2016-02-19 15:58:21 UTC
Created attachment 167178 [details]
patch to head

Please notice that this is a conditional approval under the agreement described in comment #3.
Because conflict mark may affect all ports which depend to math/openblas.

Shibusawa
Comment 7 Mark Felder freebsd_committer freebsd_triage 2016-03-14 16:31:29 UTC
Is the last patch you provided in this PR the one that needs to be committed? Is there any further work or investigation that needs to be done?

Thanks
Comment 8 Otacílio de Araújo Ramos Neto 2016-06-01 13:40:15 UTC
When this patch will be commited?
Comment 9 Otacílio de Araújo Ramos Neto 2016-06-01 14:23:24 UTC
I have tried compiling using patch "patch_to_head" and got this error:

===>   Generating temporary packing list
/bin/mkdir -p /usr/ports/math/openblas/work/include/openblas
cd /usr/ports/math/openblas/work/ &&  for i in cblas.h cblas_noconst.h; do  /usr/bin/sed 's:include ":include "openblas/:'  /usr/ports/math/openblas/work/OpenBLAS-0.2.15/$i > include/$i ;  done
sed: /usr/ports/math/openblas/work/OpenBLAS-0.2.15/cblas_noconst.h: No such file or directory
*** Error code 1

Stop.
Comment 10 Walter Schwarzenfeld 2018-01-13 20:14:14 UTC
Openblas has now version  0.2.20. Is this still relevant.
Comment 11 Walter Schwarzenfeld 2018-03-03 12:03:05 UTC
I close here. Should there still problems with newer version, please open a new PR.