caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: nicolas.ratier@femto-st.fr
Cc: caml users <caml-list@inria.fr>, Liang Wang <liang.wang@cl.cam.ac.uk>
Subject: Re: [Caml-list] Problem with: opam install conf-openblas (openSUSE 13.2, OCaml 4.06.1, opam 1.2.2)
Date: Mon, 10 Sep 2018 11:22:20 +0200	[thread overview]
Message-ID: <CAPFanBHtO4gEnUPw2N6g=4rJz6ZcmVj0PUDfbzxpD6kboxoVNA@mail.gmail.com> (raw)
In-Reply-To: <ca5eb607-27b4-d4bb-d2e9-fd62b5118214@femto-st.fr>

Dear Nicolas,

Your question is a bit specialized, and I think it would be a better
fit as an opam-repository issue

  https://github.com/ocaml/opam-repository/issues

or an email to the maintainer of the conf-openblas package (let me cc:
the maintainer, Liang Wang, here)

  https://opam.ocaml.org/packages/conf-openblas/

That said, here would be an approach to answer it: you can find in the
source of the conf-openblas "opam" file (available from the link
above)

  https://github.com/ocaml/opam-repository/blob/master/packages/conf-openblas/conf-openblas.0.2.0/opam

the list of tests that are done on the user's machine to test whether
openblas is accessible. Currently the tests are as follows:

build: [
["sh" "-exc" "cc $CFLAGS -I/usr/include/openblas test.c -lopenblas"]
{os = "fedora" | os = "centos" | os = "opensuse"}
["sh" "-exc" "cc $CFLAGS -I/usr/local/opt/openblas/include test.c
-L/usr/local/opt/openblas/lib -lopenblas"] {os = "darwin"}
["sh" "-exc" "cc $CFLAGS test.c -lopenblas"] {os != "fedora" & os !=
"centos" & os != "opensuse" & os != "darwin"}
]

(for example, maybe relying on pkg-config to find the library in
addition to the current test could work?)

If you can find a way to enrich those tests so that the test passes on
your machine (it detects your installation of openblas), and they keep
working for everyone else, you should feel free to submit a
pull-request on the OPAM repository.

To test changes to an opam fine locally, you should use "opam pin" as
documented here:
  https://opam.ocaml.org/doc/Usage.html#opam-pin

Note that one can move the detection logic out of the 'opam' file into
an external script, which can be convenient if the logic becomes
richer. You just have to store the script in the files/ subdirectory
of the package, and call it from the "build" rule. This is done for
example in the conf-libev package:
  https://github.com/ocaml/opam-repository/tree/master/packages/conf-libev/conf-libev.4-11/opam
  https://github.com/ocaml/opam-repository/blob/master/packages/conf-libev/conf-libev.4-11/files/build.sh
  https://github.com/ocaml/opam-repository/blob/master/packages/conf-libev/conf-libev.4-11/files/discover.ml

Finally: there is an interdependency between the way an external
library is detected in its conf-* packages, and the way depending
software finds it during its build. If a conf- file uses pkg-config,
the user package may also use pkg-config to select the build flag, so
merely extending the conf- package with non-pkg-config detection
(without hardening the depending packages) is not a satisfying
solution. If you extend the detection logic of conf-openblas, it would
be nice to check that the depending packages (in this case, I believe
only "owl") still build, or consider extending them with the same
logic.

Best

On Mon, Sep 10, 2018 at 10:09 AM Nicolas Ratier
<nicolas.ratier@femto-st.fr> wrote:
>
> Dear OCaml list,
>
> openblas is installed in my computer, but opam fail to find it.
> The opam message is: idon't find the file "cblas.h"(see 2)
>
> $ ls /usr/include/openblas/
> cblas.h  f77blas.h  lapacke_config.h  lapacke.h lapacke_mangling.h
> lapacke_utils.h  openblas_config.h
>
> I have the same problem with plplot (I need both to useowl)
>
> I work on:(Command: uname -mrs & lsb_release -ds)
> Linux 3.16.7-42-desktop x86_64
> "openSUSE 13.2 (Harlequin) (x86_64)"
> OCaml 4.06.1
> opam 1.2.2
>
> How to solve this ?
> I compile OpenBLAS from source (see 1)
> Is there a place to re-install OpenBLAS to be seen by Opam ?
>
> Thank you very much for your help
> Nicolas
>
> ==========================================================================
> 1
> ==========================================================================
>
>   OpenBLAS build complete. (BLAS CBLAS LAPACK LAPACKE)
>
>    OS               ... Linux
>    Architecture     ... x86_64
>    BINARY           ... 64bit
>    C compiler       ... GCC  (command line : gcc)
>    Fortran compiler ... GFORTRAN  (command line : gfortran)
>    Library Name     ... libopenblas_haswellp-r0.2.20.a (Multi threaded;
> Max num-threads is 12)
>
> To install the library, you can run "make
> PREFIX=/path/to/your/installation install".
>
> ===========================================================================
> 2
> ===========================================================================
> $ opam install conf-openblas
>
> =-=- Processing actions
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> [ERROR] The compilation of conf-openblas failed at "sh -exc cc $CFLAGS
> test.c -lopenblas".
>
> #=== ERROR while installing conf-openblas.0.2.0
> ===============================#
> # opam-version 1.2.2
> # os           linux
> # command      sh -exc cc $CFLAGS test.c -lopenblas
> # path /home/nicolas/.opam/4.06.1/build/conf-openblas.0.2.0
> # compiler     4.06.1
> # exit-code    1
> # env-file
> /home/nicolas/.opam/4.06.1/build/conf-openblas.0.2.0/conf-openblas-14498-dd682e.env
> # stdout-file
> /home/nicolas/.opam/4.06.1/build/conf-openblas.0.2.0/conf-openblas-14498-dd682e.out
> # stderr-file
> /home/nicolas/.opam/4.06.1/build/conf-openblas.0.2.0/conf-openblas-14498-dd682e.err
> ### stderr ###
> # + cc test.c -lopenblas
> # test.c:1:19: fatal error: cblas.h: Aucun fichier ou dossier de ce type
> #  #include <cblas.h>
> #                    ^
> # compilation terminated.
>
>
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

  reply	other threads:[~2018-09-10  9:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-10 15:55 [Caml-list] OCaml release 4.07.0 Damien Doligez
2018-07-11 21:01 ` Ian Zimmerman
2018-07-11 21:12   ` Ian Zimmerman
2018-07-12  0:11   ` Jacques Garrigue
2018-09-10  8:07 ` [Caml-list] Problem with: opam install conf-openblas (openSUSE 13.2, OCaml 4.06.1, opam 1.2.2) Nicolas Ratier
2018-09-10  9:22   ` Gabriel Scherer [this message]
2018-09-10 15:45   ` Nicolas Ratier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPFanBHtO4gEnUPw2N6g=4rJz6ZcmVj0PUDfbzxpD6kboxoVNA@mail.gmail.com' \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=liang.wang@cl.cam.ac.uk \
    --cc=nicolas.ratier@femto-st.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).