Skip to content

Commit

Permalink
Merge pull request #9532 from ryanrhymes/master
Browse files Browse the repository at this point in the history
Add conf-openblas.0.1
  • Loading branch information
avsm authored Jun 19, 2017
2 parents 9b3e90e + 902a9ab commit 98e1451
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/conf-openblas/conf-openblas.0.1/descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Virtual package to install OpenBLAS and LAPACKE.
The package prepares OpenBLAS (CBLAS) and LAPACKE backend for Owl (OCaml numerical library). It can only be installed if OpenBLAS and LAPACKE are installed on the system.
11 changes: 11 additions & 0 deletions packages/conf-openblas/conf-openblas.0.1/files/centos_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

yes | yum update
yes | yum install git
yes | yum install gcc gcc-c++ gcc-gfortran make kernel-devel

git clone https://github.com/xianyi/OpenBLAS.git
cd OpenBLAS
make && make install
cd ..
rm -rf OpenBLAS
10 changes: 10 additions & 0 deletions packages/conf-openblas/conf-openblas.0.1/files/test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extern double cblas_dnrm2(int N, double *X, int INCX);

int main(int argc, char **argv)
{
int N = 3;
double X[] = { 1, 2, 3 };
int INCX = 1;
double res = cblas_dnrm2(N, X, INCX);
return 0;
}
22 changes: 22 additions & 0 deletions packages/conf-openblas/conf-openblas.0.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
opam-version: "1.2"
maintainer: "Liang Wang ([email protected])"
author: "Liang Wang ([email protected])"
homepage: "https://github.com/xianyi/OpenBLAS"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
dev-repo: "https://github.com/ocaml/opam-repository.git"
license: "BSD"
build: [
["%{build}%/centos_install.sh"] {os = "centos"}
["sh" "-exc" "cc $CFLAGS test.c -lopenblas"] {os = "alpine" }
["sh" "-exc" "cc $CFLAGS test.c -lopenblas"] {os = "ubuntu" }
["sh" "-exc" "cc $CFLAGS test.c -lopenblas"] {os = "debian" }
["sh" "-exc" "cc $CFLAGS test.c -L/opt/OpenBLAS/lib -lopenblas"] {os = "centos"}
["sh" "-exc" "cc $CFLAGS test.c -L/usr/local/opt/openblas/lib -lopenblas"] {os = "darwin"}
]
depexts: [
[["centos"] [""]]
[["alpine"] ["libc-dev openblas-dev"]]
[["ubuntu"] ["libopenblas-dev liblapacke-dev"]]
[["debian"] ["libopenblas-dev liblapacke-dev"]]
[["osx" "homebrew"] ["homebrew/science/openblas"]]
]

0 comments on commit 98e1451

Please sign in to comment.