-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for LP64/ILP64 interface via modules keyword
- Loading branch information
Showing
3 changed files
with
123 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
project('test blas and lapack', 'c') | ||
|
||
openblas_dep = dependency('openblas', required: false) | ||
# NOTE: this is for local testing, we probably only want a LP64 openblas | ||
# in the Meson CI. We need to check symbols though! We may now pick up a | ||
# wrong binary | ||
openblas_dep = dependency('openblas', required: false, modules: ['interface: ilp64']) | ||
if not openblas_dep.found() | ||
error('MESON_SKIP_TEST: OpenBLAS library not available') | ||
endif | ||
|
||
c_exe = executable('cblas_lapack_c', 'cblas_lapack.c', | ||
dependencies: [openblas_dep]) | ||
blas_c_args = [] | ||
blas_interface = openblas_dep.get_variable('interface') | ||
if blas_interface == 'ilp64' | ||
blas_c_args += '-DBLAS_SYMBOL_SUFFIX=64_' | ||
elif blas_interface != 'lp64' | ||
error('no interface var for OpenBLAS dependency!') | ||
endif | ||
|
||
c_exe = executable('cblas_lapack_c', | ||
'cblas_lapack.c', | ||
c_args: blas_c_args, | ||
dependencies: [openblas_dep] | ||
) | ||
test('openblas_dep', c_exe, timeout: 30) | ||
|
||
if add_languages('fortran', required: false) | ||
f_exe = executable('openblas_fortran', 'main.f90', | ||
dependencies: [openblas_dep]) | ||
f_exe = executable('openblas_fortran', | ||
'main.f90', | ||
dependencies: [openblas_dep] | ||
) | ||
test('openblas_fortran', f_exe, timeout: 30) | ||
endif |