Skip to content

Commit

Permalink
Meosn build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
peekxc committed Oct 5, 2023
1 parent 1793ca7 commit 8783cd6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ _cpp_args = compiler.get_supported_arguments(
'-fvisibility=hidden',
# '-flto=thin' # LTO optimization only for release builds
# '-flto' # monolithic LTO
'-Wno-deprecated-anon-enum-enum-conversion' # to silence Eigen 3.4 warnings
'-Wno-deprecated-anon-enum-enum-conversion', # to silence Eigen 3.4 warnings
'-fopenmp' # will need openmp
)


## Include directories
incdir_numpy = run_command(py, ['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'], check : true).stdout().strip()
# incdir_eigen = run_command(py, ['-c', 'import os; os.chdir(".."); import eigenpip; print(eigenpip.get_include())'], check : true).stdout().strip()
Expand Down Expand Up @@ -151,21 +153,26 @@ env.set('USE_CBLAS', '1') ## Turn off CBLAS
# blas_incdir = run_command(py, ['-c', 'import scipy as sp; print(sp.__config__.blas_opt_info[\'include_dirs\'])'], check : true).stdout().strip()
# inc_blas = include_directories(blas_incdir)

## BLAS / LAPACK
## Add BLAS
## see: https://github.com/mesonbuild/meson/issues/2835
blas_options = get_option('blas') == '' ? : [get_option('blas')]
foreach blas_imp : ['openblas', 'OpenBLAS', 'blis', 'accelerate', 'mkl', 'atlas', 'netlib', 'blas', 'BLAS']
if blas_imp not in blas_options
blas_options += [blas_imp]
endif
endforeach
blas = dependency(blas_options, required: true)
dependency_map += {'BLAS' : blas }

## Add LAPACK
lapack_options = get_option('lapack') == '' ? [] : [get_option('lapack')]
foreach lapack_imp : ['openblas', 'OpenBLAS', 'blis', 'accelerate', 'mkl', 'atlas', 'netlib', 'blas', 'BLAS']
if lapack_imp not in lapack_options
lapack_options += [lapack_imp]
endif
endforeach
lapack = dependency(lapack_options, required: true)
dependency_map += {'LAPACK' : lapack }

# blas_preferred =
# lapack_preferred =
Expand All @@ -177,9 +184,9 @@ endforeach
# if lapack_preferred == '':
# end

blas = dependency(blas_options, required: true)


# cblas = dependency('cblas', required: true)
lapack = dependency(lapack_options, required: true)
#blas_linker_flags = blas.get_variable(cmake: 'blas', default_value : '-lblas')


Expand Down Expand Up @@ -220,10 +227,7 @@ lapack = dependency(lapack_options, required: true)
# lapack = dependency(lapack_name, required: true)
# endif

dependency_map = {
'BLAS': blas,
'LAPACK': lapack
}


## Dependencies information
# foreach name, dep : dependency_map
Expand Down
2 changes: 1 addition & 1 deletion src/primate/diagonalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def lanczos(A: Union[LinearOperator, sparray], v0: Optional[np.ndarray] = None,
Description
-----------
This function implements the Lanczos method, or as he called it, the method of minimized iterations.
This function implements the Lanczos method, or as Lanczos called it, the _method of minimized iterations_.
"""
v0 = np.random.uniform(size=A.shape[1], low=-1.0, high=+1.0) if v0 is None else np.array(v0)
Expand Down

0 comments on commit 8783cd6

Please sign in to comment.