Skip to content

Commit add531d

Browse files
committed
use DYNAMIC_LIST to limit the number of kernels compiled into the wheel
1 parent 20c179a commit add531d

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

tools/build_openblas.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ if [ "$build_bits" == 64 ]; then
6464
extra="-fno-asynchronous-unwind-tables"
6565
vc_arch="X64"
6666
plat_tag="win_amd64"
67+
dynamic_list="PRESCOTT NEHALEM SANDYBRIDGE HASWELL SKYLAKEX"
6768
else
6869
march=pentium4
6970
extra="-mfpmath=sse -msse2"
7071
fextra="-m32"
7172
vc_arch="i386"
7273
plat_tag="win32"
74+
dynamic_list="PRESCOTT NEHALEM SANDYBRIDGE HASWELL"
7375
fi
7476
cflags="-O2 -march=$march -mtune=generic $extra"
7577
fflags="$fextra $cflags -frecursive -ffpe-summary=invalid,zero"
@@ -94,7 +96,8 @@ OPENBLAS_VERSION=$(git describe --tags --abbrev=8)
9496
# Variable used in creating output libraries
9597
make BINARY=$build_bits DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 \
9698
NUM_THREADS=24 NO_WARMUP=1 NO_AFFINITY=1 CONSISTENT_FPCSR=1 \
97-
BUILD_LAPACK_DEPRECATED=1 TARGET=PRESCOTT BUFFERSIZE=20\
99+
BUILD_LAPACK_DEPRECATED=1 TARGET=PRESCOTT BUFFERSIZE=20 \
100+
DYNAMIC_LIST="$dynamic_list" \
98101
LDFLAGS="$LDFLAGS" \
99102
COMMON_OPT="$cflags" \
100103
FCOMMON_OPT="$fflags" \

tools/build_steps.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,32 +125,35 @@ function do_build_lib {
125125
case $(get_os)-$plat in
126126
Linux-x86_64)
127127
local bitness=64
128-
local target_flags="TARGET=PRESCOTT"
128+
local target=PRESCOTT
129+
local dynamic_list="PRESCOTT NEHALEM SANDYBRIDGE HASWELL SKYLAKEX"
129130
;;
130131
Darwin-x86_64)
131132
local bitness=64
132-
local target_flags="TARGET=CORE2"
133+
local target_flags=CORE2
134+
local dynamic_list="CORE2 NEHALEM SANDYBRIDGE HASWELL SKYLAKEX"
133135
# Pick up the gfortran runtime libraries
134136
export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH
135137
;;
136138
*-i686)
137139
local bitness=32
138-
local target_flags="TARGET=PRESCOTT"
140+
local target_flags=PRESCOTT
141+
local dynamic_list="PRESCOTT NEHALEM SANDYBRIDGE HASWELL"
139142
;;
140143
Linux-aarch64)
141144
local bitness=64
142-
local target_flags="TARGET=ARMV8"
145+
local target=ARMV8
143146
;;
144147
Darwin-arm64)
145148
local bitness=64
146-
local target_flags="TARGET=VORTEX"
149+
local target=VORTEX
147150
;;
148151
*-s390x)
149152
local bitness=64
150153
;;
151154
*-ppc64le)
152155
local bitness=64
153-
local target_flags="TARGET=POWER8"
156+
local target=POWER8
154157
;;
155158
*) echo "Strange plat value $plat"; exit 1 ;;
156159
esac
@@ -177,10 +180,8 @@ function do_build_lib {
177180
CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \
178181
make BUFFERSIZE=20 DYNAMIC_ARCH=1 \
179182
USE_OPENMP=0 NUM_THREADS=64 \
180-
BINARY=$bitness $interface_flags $target_flags shared > /dev/null
181-
make BUFFERSIZE=20 DYNAMIC_ARCH=1 \
182-
USE_OPENMP=0 NUM_THREADS=64 \
183-
BINARY=$bitness $interface_flags $target_flags tests
183+
BINARY=$bitness $interface_flags TARGET=$target \
184+
DYNAMIC_LIST="$dynamic_list" > /dev/null
184185
make PREFIX=$BUILD_PREFIX $interface_flags install
185186
popd
186187
stop_spinner

0 commit comments

Comments
 (0)