BUG: Build the cblas_ wrappers correctly

This commit is contained in:
Rohit Goswami 2024-04-20 22:49:28 +00:00 committed by Mateusz Sokół
parent b5fe9ba789
commit c8d1599411
1 changed files with 21 additions and 12 deletions

View File

@ -572,10 +572,13 @@ foreach conf : _blas_roots
endforeach endforeach
endif endif
# Construct the actual symbol names # Construct the actual symbol names, and mangled symbols
# TODO: This might be conditional on other options
sym_name = conf['base'].replace('?', type) sym_name = conf['base'].replace('?', type)
sym_underscored = f'@sym_name@_'
if conf.get('cblas', false) if conf.get('cblas', false)
cblas_sym_name = 'cblas_' + sym_name cblas_sym_name = 'cblas_' + sym_name
cblas_sym_underscored = f'@cblas_sym_name@_'
endif endif
# Construct conditionals # Construct conditionals
@ -590,8 +593,13 @@ foreach conf : _blas_roots
# Make mangled symbols # Make mangled symbols
# TODO: This might be conditional on other options # TODO: This might be conditional on other options
sym_underscored = f'@sym_name@_'
compiler_args += [ # Create the static library for each symbol
lib = static_library(
sym_name,
sources: conf['fname'],
include_directories: _inc,
c_args: compiler_args + [
f'-DASMNAME=@sym_name@', f'-DASMNAME=@sym_name@',
f'-DASMFNAME=@sym_underscored@', f'-DASMFNAME=@sym_underscored@',
f'-DNAME=@sym_underscored@', f'-DNAME=@sym_underscored@',
@ -599,13 +607,6 @@ foreach conf : _blas_roots
f'-DCHAR_NAME="@sym_underscored@"', f'-DCHAR_NAME="@sym_underscored@"',
f'-DCHAR_CNAME="@sym_name@"' f'-DCHAR_CNAME="@sym_name@"'
] ]
# Create the static library for each symbol
lib = static_library(
sym_name,
sources: conf['fname'],
include_directories: _inc,
c_args: compiler_args
) )
_interface_libs += lib _interface_libs += lib
@ -620,7 +621,15 @@ foreach conf : _blas_roots
cblas_sym_name, cblas_sym_name,
sources: conf['fname'], sources: conf['fname'],
include_directories: _inc, include_directories: _inc,
c_args: compiler_args + ['-DCBLAS'] c_args: compiler_args + [
'-DCBLAS',
f'-DASMNAME=@cblas_sym_name@',
f'-DASMFNAME=@cblas_sym_underscored@',
f'-DNAME=@cblas_sym_underscored@',
f'-DCNAME=@cblas_sym_name@',
f'-DCHAR_NAME="@cblas_sym_underscored@"',
f'-DCHAR_CNAME="@cblas_sym_name@"'
]
) )
_interface_libs += cblas_lib _interface_libs += cblas_lib
endif endif