parent
868a8deb90
commit
4043b5a494
3 changed files with 115 additions and 10 deletions
57
srcpkgs/openblas/patches/v0.2.20-init.patch
Normal file
57
srcpkgs/openblas/patches/v0.2.20-init.patch
Normal file
|
@ -0,0 +1,57 @@
|
|||
--- driver/others/init.c.orig 2017-07-30 17:32:46.798217004 +0200
|
||||
+++ driver/others/init.c 2017-07-30 17:07:26.933137836 +0200
|
||||
@@ -781 +781 @@ void gotoblas_affinity_init(void) {
|
||||
-#ifndef USE_OPENMP
|
||||
+#ifndef USE_OPENMP
|
||||
@@ -785 +785 @@ void gotoblas_affinity_init(void) {
|
||||
-
|
||||
+
|
||||
@@ -829,4 +828,0 @@ void gotoblas_affinity_init(void) {
|
||||
- cpu_set_t *cpusetp;
|
||||
- int nums;
|
||||
- int ret;
|
||||
-
|
||||
@@ -838,36 +834 @@ void gotoblas_affinity_init(void) {
|
||||
-
|
||||
- nums = sysconf(_SC_NPROCESSORS_CONF);
|
||||
-
|
||||
-#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 3)
|
||||
- common->num_procs = nums;
|
||||
-#elif __GLIBC_PREREQ(2, 7)
|
||||
- cpusetp = CPU_ALLOC(nums);
|
||||
- if (cpusetp == NULL) {
|
||||
- common->num_procs = nums;
|
||||
- } else {
|
||||
- size_t size;
|
||||
- size = CPU_ALLOC_SIZE(nums);
|
||||
- ret = sched_getaffinity(0,size,cpusetp);
|
||||
- if (ret!=0)
|
||||
- common->num_procs = nums;
|
||||
- else
|
||||
- common->num_procs = CPU_COUNT_S(size,cpusetp);
|
||||
- }
|
||||
- CPU_FREE(cpusetp);
|
||||
-#else
|
||||
- ret = sched_getaffinity(0,sizeof(cpu_set_t), cpusetp);
|
||||
- if (ret!=0) {
|
||||
- common->num_procs = nums;
|
||||
- } else {
|
||||
-#if !__GLIBC_PREREQ(2, 6)
|
||||
- int i;
|
||||
- int n = 0;
|
||||
- for (i=0;i<nums;i++)
|
||||
- if (CPU_ISSET(i,cpusetp)) n++;
|
||||
- common->num_procs = n;
|
||||
- }
|
||||
-#else
|
||||
- common->num_procs = CPU_COUNT(sizeof(cpu_set_t),cpusetp);
|
||||
-#endif
|
||||
-
|
||||
-#endif
|
||||
+ common -> num_procs = sysconf(_SC_NPROCESSORS_CONF);;
|
||||
@@ -876 +837 @@ void gotoblas_affinity_init(void) {
|
||||
- fprintf(stderr, "\nOpenBLAS Warning : The number of CPU/Cores(%d) is beyond the limit(%d). Terminated.\n", common->num_procs, MAX_CPUS);
|
||||
+ fprintf(stderr, "\nOpenBLAS Warining : The number of CPU/Cores(%d) is beyond the limit(%d). Terminated.\n", common->num_procs, MAX_CPUS);
|
||||
@@ -889 +850 @@ void gotoblas_affinity_init(void) {
|
||||
- for(i = 0; i < common -> avail_count; i++) common -> final_num_procs += rcount(common -> avail[i]) + 1; //Make the max cpu number.
|
||||
+ for(i = 0; i < common -> avail_count; i++) common -> final_num_procs += rcount(common -> avail[i]) + 1; //Make the max cpu number.
|
41
srcpkgs/openblas/patches/v0.2.20-memory.patch
Normal file
41
srcpkgs/openblas/patches/v0.2.20-memory.patch
Normal file
|
@ -0,0 +1,41 @@
|
|||
--- driver/others/memory.c.orig 2017-07-30 17:33:01.590217775 +0200
|
||||
+++ driver/others/memory.c 2017-07-30 17:07:26.933137836 +0200
|
||||
@@ -178,5 +177,0 @@ int get_num_procs(void) {
|
||||
-cpu_set_t *cpusetp;
|
||||
-size_t size;
|
||||
-int ret;
|
||||
-int i,n;
|
||||
-
|
||||
@@ -184,32 +178,0 @@ int i,n;
|
||||
-#if !defined(OS_LINUX)
|
||||
- return nums;
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(__GLIBC_PREREQ)
|
||||
- return nums;
|
||||
-#endif
|
||||
-#if !__GLIBC_PREREQ(2, 3)
|
||||
- return nums;
|
||||
-#endif
|
||||
-
|
||||
-#if !__GLIBC_PREREQ(2, 7)
|
||||
- ret = sched_getaffinity(0,sizeof(cpu_set_t), cpusetp);
|
||||
- if (ret!=0) return nums;
|
||||
- n=0;
|
||||
-#if !__GLIBC_PREREQ(2, 6)
|
||||
- for (i=0;i<nums;i++)
|
||||
- if (CPU_ISSET(i,cpusetp)) n++;
|
||||
- nums=n;
|
||||
-#else
|
||||
- nums = CPU_COUNT(sizeof(cpu_set_t),cpusetp);
|
||||
-#endif
|
||||
- return nums;
|
||||
-#endif
|
||||
-
|
||||
- cpusetp = CPU_ALLOC(nums);
|
||||
- if (cpusetp == NULL) return nums;
|
||||
- size = CPU_ALLOC_SIZE(nums);
|
||||
- ret = sched_getaffinity(0,size,cpusetp);
|
||||
- if (ret!=0) return nums;
|
||||
- nums = CPU_COUNT_S(size,cpusetp);
|
||||
- CPU_FREE(cpusetp);
|
|
@ -1,26 +1,32 @@
|
|||
# Template file for 'openblas'
|
||||
pkgname=openblas
|
||||
version=0.2.19
|
||||
version=0.2.20
|
||||
revision=1
|
||||
wrksrc="OpenBLAS-${version}"
|
||||
build_style=gnu-makefile
|
||||
make_build_args="HOSTCC=gcc USE_OPENMP=1"
|
||||
make_install_args="PREFIX=/usr"
|
||||
make_build_args=" HOSTCC=gcc USE_OPENMP=1"
|
||||
hostmakedepends="perl gcc-fortran"
|
||||
makedepends="cblas-devel lapack-devel lapacke-devel libgomp-devel"
|
||||
makedepends="libgomp-devel"
|
||||
short_desc="Basic Linear Algebra Subprograms based on GotoBLAS2"
|
||||
maintainer="Julien Dehos <dehos@lisic.univ-littoral.fr>"
|
||||
homepage="http://www.openblas.net/"
|
||||
license="3-clause-BSD"
|
||||
distfiles="https://github.com/xianyi/${pkgname}/archive/v${version}.tar.gz"
|
||||
checksum="9c40b5e4970f27c5f6911cb0a28aa26b6c83f17418b69f8e5a116bb983ca8557"
|
||||
checksum="5ef38b15d9c652985774869efd548b8e3e972e1e99475c673b25537ed7bcf394"
|
||||
|
||||
case "${XBPS_TARGET_MACHINE}" in
|
||||
armv6*) make_build_args+=" TARGET=ARMV6" ;;
|
||||
armv7*) make_build_args+=" TARGET=ARMV7" ;;
|
||||
aarch64*) make_build_args+=" TARGET=ARMV8" ;;
|
||||
i686*) make_build_args+=" BINARY=32 " ;;
|
||||
armv6*) make_build_args+=" TARGET=ARMV6" ;;
|
||||
armv7*) make_build_args+=" TARGET=ARMV7" ;;
|
||||
aarch64*) make_build_args+=" TARGET=ARMV8" ;;
|
||||
i686*) make_build_args+=" BINARY=32 DYNAMIC_ARCH=1" ;;
|
||||
x86_64*) make_build_args+=" BINARY=64 DYNAMIC_ARCH=1" ;;
|
||||
esac
|
||||
|
||||
post_extract() {
|
||||
sed -i 's#OPENBLAS_INCLUDE_DIR := .*$#OPENBLAS_INCLUDE_DIR := $(PREFIX)/include/openblas#' Makefile.install
|
||||
}
|
||||
|
||||
post_install() {
|
||||
vlicense LICENSE
|
||||
}
|
||||
|
@ -29,8 +35,9 @@ openblas-devel_package() {
|
|||
depends="${sourcepkg}>=${version}_${revision}"
|
||||
short_desc+=" - development files"
|
||||
pkg_install() {
|
||||
vmove usr/include
|
||||
vmove usr/lib/cmake/openblas
|
||||
vmove usr/include/openblas
|
||||
vmove usr/lib/cmake
|
||||
vmove usr/lib/pkgconfig
|
||||
vmove usr/lib/libopenblas*.a*
|
||||
vmove usr/lib/libopenblas.so
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue