mirror of
https://github.com/ivabus/pantry
synced 2024-11-26 02:15:06 +03:00
+openblas (#1464)
* +openblas * fix build * add -pthread; cleanup * fix cpu target for darwin/x86-64 * exclude darwin/x86-64 for now --------- Co-authored-by: Jacob Heider <jacob@tea.xyz>
This commit is contained in:
parent
2c3769702f
commit
d1eaadf428
1 changed files with 66 additions and 0 deletions
66
projects/openblas.net/package.yml
Normal file
66
projects/openblas.net/package.yml
Normal file
|
@ -0,0 +1,66 @@
|
|||
distributable:
|
||||
url: https://github.com/xianyi/OpenBLAS/releases/download/v{{version}}/OpenBLAS-{{version}}.tar.gz
|
||||
strip-components: 1
|
||||
|
||||
versions:
|
||||
github: xianyi/OpenBLAS/releases/tags
|
||||
strip: /^v/
|
||||
|
||||
platforms:
|
||||
- linux
|
||||
- darwin/aarch64
|
||||
# FIXME: illegal instruction on darwin/x86-64
|
||||
|
||||
build:
|
||||
dependencies:
|
||||
tea.xyz/gx/cc: c99
|
||||
tea.xyz/gx/make: '*'
|
||||
cmake.org: '*'
|
||||
working-directory: build
|
||||
script:
|
||||
- cmake .. -DCMAKE_INSTALL_PREFIX="{{prefix}}" -DCMAKE_BUILD_TYPE=Release
|
||||
- make --jobs {{ hw.concurrency }} $ARGS
|
||||
- make install
|
||||
|
||||
## removing a redundant directory with a duplicate file
|
||||
- run: rm -r openblas/openblas
|
||||
working-directory: ${{prefix}}/include
|
||||
- run: |
|
||||
mv openblas/* .
|
||||
rmdir openblas
|
||||
ln -s . openblas
|
||||
working-directory: ${{prefix}}/include
|
||||
# FIXME: illegal instruction on darwin/x86-64
|
||||
# line 25: 2290 Illegal instruction: 4 ./a.out
|
||||
# env:
|
||||
# darwin/x86-64:
|
||||
# ARGS:
|
||||
# - TARGET=CORE2
|
||||
|
||||
test:
|
||||
fixture: |
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include "cblas.h"
|
||||
|
||||
int main(void) {
|
||||
int i;
|
||||
double A[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0};
|
||||
double B[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0};
|
||||
double C[9] = {.5, .5, .5, .5, .5, .5, .5, .5, .5};
|
||||
cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans,
|
||||
3, 3, 2, 1, A, 3, B, 3, 2, C, 3);
|
||||
for (i = 0; i < 9; i++)
|
||||
printf("%lf ", C[i]);
|
||||
printf("\\n");
|
||||
if (fabs(C[0]-11) > 1.e-5) abort();
|
||||
if (fabs(C[4]-21) > 1.e-5) abort();
|
||||
return 0;
|
||||
}
|
||||
dependencies:
|
||||
tea.xyz/gx/cc: c99
|
||||
script: |
|
||||
mv $FIXTURE test.c
|
||||
cc test.c -lopenblas -pthread $CFLAGS $LDFLAGS
|
||||
./a.out
|
Loading…
Reference in a new issue