| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile.common,v 1.5 2021/06/15 04:41:52 thor Exp $ | | 1 | # $NetBSD: Makefile.common,v 1.6 2021/06/15 15:06:23 thor Exp $ |
2 | # | | 2 | # |
3 | # used by math/openblas_pthread/Makefile | | 3 | # used by math/openblas_pthread/Makefile |
4 | # used by math/openblas_openmp/Makefile | | 4 | # used by math/openblas_openmp/Makefile |
5 | # used by math/openblas/Makefile | | 5 | # used by math/openblas/Makefile |
6 | # used by math/openblas64_pthread/Makefile | | 6 | # used by math/openblas64_pthread/Makefile |
7 | # used by math/openblas64_openmp/Makefile | | 7 | # used by math/openblas64_openmp/Makefile |
8 | # used by math/openblas64/Makefile | | 8 | # used by math/openblas64/Makefile |
9 | # | | 9 | # |
10 | # This is the common Makefile for OpenBLAS builds. It depends on | | 10 | # This is the common Makefile for OpenBLAS builds. It depends on |
11 | # OPENBLAS_VARIANT = (openblas|openblas_pthread|openblas_openmp) | | 11 | # OPENBLAS_VARIANT = (openblas|openblas_pthread|openblas_openmp) |
12 | # being set. | | 12 | # being set. |
13 | | | 13 | |
14 | DISTNAME= OpenBLAS-${OPENBLAS_VERSION} | | 14 | DISTNAME= OpenBLAS-${OPENBLAS_VERSION} |
| @@ -52,45 +52,43 @@ BUILD_DEFS+= OPENBLAS_THREAD_LIMIT | | | @@ -52,45 +52,43 @@ BUILD_DEFS+= OPENBLAS_THREAD_LIMIT |
52 | | | 52 | |
53 | .include "../../mk/bsd.prefs.mk" | | 53 | .include "../../mk/bsd.prefs.mk" |
54 | | | 54 | |
55 | # Using conservative default of 32 threads as that matches the | | 55 | # Using conservative default of 32 threads as that matches the |
56 | # limit for related stack arrays in OpenBLAS. Might raise it | | 56 | # limit for related stack arrays in OpenBLAS. Might raise it |
57 | # in future, anyway. There some memory usage/efficiency tradeoff | | 57 | # in future, anyway. There some memory usage/efficiency tradeoff |
58 | # when this number is excessively high. | | 58 | # when this number is excessively high. |
59 | OPENBLAS_THREAD_LIMIT?= 32 | | 59 | OPENBLAS_THREAD_LIMIT?= 32 |
60 | .if !empty(OPENBLAS_THREAD_LIMIT) | | 60 | .if !empty(OPENBLAS_THREAD_LIMIT) |
61 | MAKE_FLAGS+= NUM_THREADS=${OPENBLAS_THREAD_LIMIT:Q} | | 61 | MAKE_FLAGS+= NUM_THREADS=${OPENBLAS_THREAD_LIMIT:Q} |
62 | .endif | | 62 | .endif |
63 | BENCHMARK_MAXTHREADS?= 8 | | 63 | BENCHMARK_MAXTHREADS?= 8 |
64 | | | 64 | |
65 | .if ${MACHINE_ARCH:M*64} == "" | | 65 | .if empty(LP64PLATFORMS:@.PLAT.@${MACHINE_PLATFORM:M${.PLAT.}}@) |
66 | MAKE_FLAGS+= BINARY32=1 | | 66 | MAKE_FLAGS+= BINARY32=1 |
67 | . if !empty(OPENBLAS_VARIANT:M*64*) | | 67 | . if !empty(OPENBLAS_VARIANT:M*64*) |
68 | PKG_FAIL_REASON+= "${OPENBLAS_VARIANT} incompatible with non-64-bit platform" | | 68 | PKG_FAIL_REASON+= "${OPENBLAS_VARIANT} incompatible with non-64-bit platform" |
69 | . endif | | 69 | . endif |
70 | .else | | 70 | .else |
71 | MAKE_FLAGS+= BINARY64=1 | | 71 | MAKE_FLAGS+= BINARY64=1 |
72 | .endif | | 72 | .endif |
73 | | | 73 | |
74 | # Build with the C APIs, as do other optimized libraries. | | 74 | # Build with the C APIs, as do other optimized libraries. |
75 | #MAKE_FLAGS+= NO_CBLAS=0 NO_LAPACKE=0 | | 75 | #MAKE_FLAGS+= NO_CBLAS=0 NO_LAPACKE=0 |
76 | | | 76 | |
77 | # Separate headers and cmake stuff. | | 77 | # Separate headers and cmake stuff. |
78 | MAKE_FLAGS+= OPENBLAS_INCLUDE_DIR=${PREFIX}/include/${OPENBLAS_VARIANT} | | 78 | MAKE_FLAGS+= OPENBLAS_INCLUDE_DIR=${PREFIX}/include/${OPENBLAS_VARIANT} |
79 | MAKE_FLAGS+= OPENBLAS_CMAKE_DIR=${PREFIX}/lib/cmake/${OPENBLAS_VARIANT} | | 79 | MAKE_FLAGS+= OPENBLAS_CMAKE_DIR=${PREFIX}/lib/cmake/${OPENBLAS_VARIANT} |
80 | | | 80 | |
81 | # TODO: Set INTERFACE64=1 with additional OPENBLAS_VARIANTs. | | 81 | # Settled on no sumbol suffix for 64 bit. |
82 | # Need to settle on a convention for SYMBOLSUFFIX first, see | | | |
83 | # https://github.com/xianyi/OpenBLAS/issues/646 . | | | |
84 | MAKE_FLAGS+= FIXED_LIBNAME=1 | | 82 | MAKE_FLAGS+= FIXED_LIBNAME=1 |
85 | .if ${OPENBLAS_VARIANT} == openblas || ${OPENBLAS_VARIANT} == openblas64 | | 83 | .if ${OPENBLAS_VARIANT} == openblas || ${OPENBLAS_VARIANT} == openblas64 |
86 | MAKE_FLAGS+= USE_OPENMP=0 USE_THREAD=0 USE_LOCKING=1 | | 84 | MAKE_FLAGS+= USE_OPENMP=0 USE_THREAD=0 USE_LOCKING=1 |
87 | BENCHMARK_ENV= USE_SIMPLE_THREADED_LEVEL3=1 | | 85 | BENCHMARK_ENV= USE_SIMPLE_THREADED_LEVEL3=1 |
88 | .elif !empty(OPENBLAS_VARIANT:Mopenblas*_pthread) | | 86 | .elif !empty(OPENBLAS_VARIANT:Mopenblas*_pthread) |
89 | MAKE_FLAGS+= LIBNAMESUFFIX=pthread | | 87 | MAKE_FLAGS+= LIBNAMESUFFIX=pthread |
90 | MAKE_FLAGS+= USE_OPENMP=0 USE_THREAD=1 | | 88 | MAKE_FLAGS+= USE_OPENMP=0 USE_THREAD=1 |
91 | BENCHMARK_ENV= OPENBLAS_NUM_THREADS=${BENCHMARK_MAXTHREADS} | | 89 | BENCHMARK_ENV= OPENBLAS_NUM_THREADS=${BENCHMARK_MAXTHREADS} |
92 | .elif !empty(OPENBLAS_VARIANT:Mopenblas*_openmp) | | 90 | .elif !empty(OPENBLAS_VARIANT:Mopenblas*_openmp) |
93 | MAKE_FLAGS+= LIBNAMESUFFIX=openmp | | 91 | MAKE_FLAGS+= LIBNAMESUFFIX=openmp |
94 | MAKE_FLAGS+= USE_OPENMP=1 NO_AFFINITY=1 | | 92 | MAKE_FLAGS+= USE_OPENMP=1 NO_AFFINITY=1 |
95 | BENCHMARK_ENV= OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS} | | 93 | BENCHMARK_ENV= OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS} |
96 | .endif | | 94 | .endif |