@@ -144,6 +144,50 @@ print_usage()
144
144
library. If the shared library build is disabled, the
145
145
static library build must remain enabled.
146
146
147
+ --omit-symbols=LIST
148
+
149
+ Omit a custom set of compatibility symbols when building
150
+ BLIS. When given, LIST is parsed as a comma-separated
151
+ list of symbol names (excluding any trailing underscore).
152
+ This option is useful when (1) the user is planning to
153
+ link BLIS with another library that provides conflicting
154
+ symbols, and (2) the user wishes the symbols in this
155
+ other library to prevail at link time without relying on
156
+ weak/strong symbol semantics. Note that currently ONLY
157
+ the following symbols are supported for omission:
158
+
159
+ crot zrot lsame
160
+ csymv zsymv xerbla
161
+ csyr zsyr xerbla_array
162
+ csyr2 zsyr2
163
+
164
+ --enable-lapack-compat, --disable-lapack-compat
165
+
166
+ Enable strict compatibility with LAPACK. This option
167
+ causes BLIS to be built without some routines that we
168
+ consider to be BLAS compatibility routines but that
169
+ also happen to be provided by LAPACK. This option is
170
+ equivalent to using the --omit-symbols=LIST option
171
+ where LIST contains the following symbols:
172
+
173
+ crot zrot lsame
174
+ csymv zsymv xerbla
175
+ csyr zsyr xerbla_array
176
+ csyr2 zsyr2
177
+
178
+ --enable-scalapack-compat, --disable-scalapack-compat
179
+
180
+ Enable strict compatibility with ScaLAPACK. This option
181
+ causes BLIS to be built without some routines that we
182
+ consider to be BLAS compatibility routines but that
183
+ also happen to be provided by ScaLAPACK. This option is
184
+ equivalent to using the --omit-symbols=LIST option
185
+ where LIST contains the following symbols:
186
+
187
+ csymv zsymv
188
+ csyr zsyr
189
+ csyr2 zsyr2
190
+
147
191
--enable-rpath, --disable-rpath
148
192
149
193
Enable (disabled by default) setting an install_name for
@@ -303,12 +347,6 @@ print_usage()
303
347
which are determined by the BLIS subconfiguration used at
304
348
runtime.) By default, these customized files are disabled.
305
349
306
- --enable-scalapack-compat, --disable-scalapack-compat
307
-
308
- Enable strict compatibility with ScaLAPACK, which may
309
- requiring disabling certain conflicting functionality
310
- available through the BLAS and/or CBLAS interfaces.
311
-
312
350
-a NAME --enable-addon=NAME
313
351
314
352
Enable the code provided by an addon. An addon consists
@@ -3015,10 +3053,14 @@ blis_main()
3015
3053
enable_amd_frame_tweaks=' no'
3016
3054
enable_memkind=' ' # The default memkind value is determined later on.
3017
3055
enable_trsm_preinversion=' yes'
3056
+ enable_lapack_compat=' no'
3018
3057
enable_scalapack_compat=' no'
3019
3058
force_version=' no'
3020
3059
complex_return=' default'
3021
3060
3061
+ # The symbol omission list.
3062
+ omit_symbol_list=' '
3063
+
3022
3064
# The addon flag and names.
3023
3065
addon_flag=' '
3024
3066
addon_list=' '
@@ -3155,6 +3197,10 @@ blis_main()
3155
3197
enable_shared=' no'
3156
3198
;;
3157
3199
3200
+ omit-symbols=* )
3201
+ omit_symbol_list=${OPTARG#* =}
3202
+ ;;
3203
+
3158
3204
enable-rpath)
3159
3205
enable_rpath=' yes'
3160
3206
;;
@@ -3272,6 +3318,13 @@ blis_main()
3272
3318
enable_amd_frame_tweaks=' no'
3273
3319
;;
3274
3320
3321
+ enable-lapack-compat)
3322
+ enable_lapack_compat=' yes'
3323
+ ;;
3324
+ disable-lapack-compat)
3325
+ enable_lapack_compat=' no'
3326
+ ;;
3327
+
3275
3328
enable-scalapack-compat)
3276
3329
enable_scalapack_compat=' yes'
3277
3330
;;
@@ -3675,6 +3728,54 @@ blis_main()
3675
3728
exit 1
3676
3729
fi
3677
3730
3731
+ # Check for the LAPACK compatibility option before the option for symbol
3732
+ # omission since the former can imply/augment the latter.
3733
+ if [[ ${enable_lapack_compat} = yes ]]; then
3734
+ echo " ${script_name} : LAPACK compatibility is enabled."
3735
+ enable_lapack_compat_01=1
3736
+ problematic_symbols=" crot,zrot,csymv,zsymv,csyr,zsyr,csyr2,zsyr2,lsame,xerbla,xerbla_array"
3737
+ omit_symbol_list=" ${omit_symbol_list} ,${problematic_symbols} "
3738
+ else
3739
+ echo " ${script_name} : LAPACK compatibility is disabled."
3740
+ enable_lapack_compat_01=0
3741
+ fi
3742
+
3743
+ # Check for the ScaLAPACK compatibility option before the option for symbol
3744
+ # omission since the former can imply/augment the latter.
3745
+ if [[ ${enable_scalapack_compat} = yes ]]; then
3746
+ echo " ${script_name} : ScaLAPACK compatibility is enabled."
3747
+ enable_scalapack_compat_01=1
3748
+ problematic_symbols=" csymv,zsymv,csyr,zsyr,csyr2,zsyr2"
3749
+ omit_symbol_list=" ${omit_symbol_list} ,${problematic_symbols} "
3750
+ else
3751
+ echo " ${script_name} : ScaLAPACK compatibility is disabled."
3752
+ enable_scalapack_compat_01=0
3753
+ fi
3754
+
3755
+ # Check if we are omitting any symbols.
3756
+ if [[ ${omit_symbol_list} != " " ]]; then
3757
+
3758
+ # Create a list of #defines, one for each symbol the user requested
3759
+ # that we omit. Note that first we convert the list's commas into
3760
+ # spaces.
3761
+
3762
+ # Start by changing the comma-separated list to a space-separated list.
3763
+ omit_symbol_list=$( echo " ${omit_symbol_list} " | sed -e " s/,/ /g" )
3764
+
3765
+ # Remove duplicates.
3766
+ # omit_symbol_list=$(rm_duplicate_words_simple "${omit_symbol_list}")
3767
+
3768
+ # Sort the list, removing duplicates (via -u).
3769
+ omit_symbol_list=$( echo " ${omit_symbol_list} " | xargs -n1 | sort -u)
3770
+
3771
+ echo " ${script_name} : omitting the following symbols from BLIS:"
3772
+ for omit_symbol_name in ${omit_symbol_list} ; do
3773
+ echo " ${script_name} : ${omit_symbol_name} "
3774
+ done
3775
+ else
3776
+ echo " ${script_name} : no symbols will be omitted."
3777
+ fi
3778
+
3678
3779
# Check if we are building with or without operating system support.
3679
3780
if [[ ${enable_system} = yes ]]; then
3680
3781
echo " ${script_name} : enabling operating system support."
@@ -3947,13 +4048,6 @@ blis_main()
3947
4048
echo " ${script_name} : memory tracing output is disabled."
3948
4049
enable_mem_tracing_01=0
3949
4050
fi
3950
- if [[ ${enable_scalapack_compat} = yes ]]; then
3951
- echo " ${script_name} : ScaLAPACK compatibility is enabled."
3952
- enable_scalapack_compat_01=1
3953
- else
3954
- echo " ${script_name} : ScaLAPACK compatibility is disabled."
3955
- enable_scalapack_compat_01=0
3956
- fi
3957
4051
if [[ ${has_memkind} = yes ]]; then
3958
4052
if [[ -z ${enable_memkind} ]]; then
3959
4053
# If no explicit option was given for libmemkind one way or the other,
@@ -4216,6 +4310,28 @@ blis_main()
4216
4310
addon_list_includes=" ${addon_list_includes} #include ${addon_header} \n"
4217
4311
done
4218
4312
4313
+ # Make sure that omit_symbol_list only contains lowercase letters, digits,
4314
+ # underscores, and commas.
4315
+ omit_symbol_list_check=$( echo " ${omit_symbol_list} " | sed -e " s/[a-z0-9_, ]//g" )
4316
+
4317
+ if [[ " ${omit_symbol_list_check} " != " " ]]; then
4318
+ echo " ${script_name} : --omit-symbol=LIST option contains unexpected characters: ${omit_symbol_list_check} "
4319
+ exit 1
4320
+ fi
4321
+
4322
+ # Create a list of #defines, one for each symbol the user requested that we
4323
+ # omit. Note that first we convert the list's commas into spaces.
4324
+ omit_symbol_list=$( echo " ${omit_symbol_list} " | sed -e " s/,/ /g" )
4325
+ for sym in ${omit_symbol_list} ; do
4326
+
4327
+ # Convert the current config name to uppercase.
4328
+ sym=$( echo " ${sym} " | tr ' [:lower:]' ' [:upper:]' )
4329
+
4330
+ # Create a #define and add it to the running list.
4331
+ omit_define=" BLIS_DISABLE_${sym} "
4332
+ omit_symbol_list_defines=" ${omit_symbol_list_defines} #define ${omit_define} \n"
4333
+ done
4334
+
4219
4335
4220
4336
# -- Determine whether we are performing an out-of-tree build --------------
4221
4337
@@ -4310,6 +4426,7 @@ blis_main()
4310
4426
add_config_var config_name_define
4311
4427
add_config_var config_list_defines
4312
4428
add_config_var kernel_list_defines
4429
+ add_config_var omit_symbol_list_defines
4313
4430
add_config_var enable_tls enable_tls_01
4314
4431
add_config_var enable_openmp enable_openmp_01
4315
4432
add_config_var enable_openmp_as_def enable_openmp_as_def_01
0 commit comments