2023-05-13 01:29:40 +03:00
|
|
|
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/
|
|
|
|
|
|
|
|
build:
|
|
|
|
dependencies:
|
|
|
|
cmake.org: '*'
|
|
|
|
working-directory: build
|
|
|
|
script:
|
2024-04-05 01:19:28 +03:00
|
|
|
# our llvm doesn't like this flag
|
|
|
|
- run: sed -i 's/ -exhaustive-register-search//g' system.cmake
|
|
|
|
if: linux/x86-64
|
|
|
|
working-directory: ../cmake
|
2023-11-13 19:19:37 +03:00
|
|
|
- cmake .. $ARGS
|
|
|
|
- make --jobs {{ hw.concurrency }}
|
2023-05-13 01:29:40 +03:00
|
|
|
- make install
|
|
|
|
|
|
|
|
## removing a redundant directory with a duplicate file
|
2024-01-05 00:12:53 +03:00
|
|
|
- run: if test -d openblas/openblas; then rm -r openblas/openblas; fi
|
2023-05-13 01:29:40 +03:00
|
|
|
working-directory: ${{prefix}}/include
|
|
|
|
- run: |
|
|
|
|
mv openblas/* .
|
|
|
|
rmdir openblas
|
|
|
|
ln -s . openblas
|
|
|
|
working-directory: ${{prefix}}/include
|
2023-11-13 19:19:37 +03:00
|
|
|
env:
|
|
|
|
ARGS:
|
|
|
|
- -DCMAKE_INSTALL_PREFIX="{{prefix}}"
|
|
|
|
- -DCMAKE_BUILD_TYPE=Release
|
|
|
|
- -DCMAKE_C_FLAGS="-fPIC"
|
|
|
|
- -DCMAKE_CXX_FLAGS="-fPIC"
|
|
|
|
x86-64:
|
|
|
|
ARGS:
|
|
|
|
- -DDYNAMIC_ARCH=ON
|
2023-05-13 01:29:40 +03:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
script: |
|
|
|
|
mv $FIXTURE test.c
|
|
|
|
cc test.c -lopenblas -pthread $CFLAGS $LDFLAGS
|
|
|
|
./a.out
|
2023-11-13 18:04:41 +03:00
|
|
|
env:
|
|
|
|
linux:
|
|
|
|
CFLAGS: -fPIC
|
|
|
|
LDFLAGS: -pie
|