mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Improve finding of BLAS libraries in macOS / Macports
MacPorts' lapack is not guaranteed to produce libblas.dylib. For example if the +openblas variant is used, then lapack uses openblas. This commit tries to find and use libopenblas.dylib if libblas.dylib is not found. Fixes usage of BLAS_ROOT
This commit is contained in:
		| @@ -20,11 +20,13 @@ if(DEFINED ENV{BLAS_ROOT}) | |||||||
| endif() | endif() | ||||||
|  |  | ||||||
| find_library(BLAS_LIBRARIES | find_library(BLAS_LIBRARIES | ||||||
|     libblas.dylib |     NAMES libblas.dylib libopenblas.dylib | ||||||
|     PATHS |     PATHS | ||||||
|  |         ${BLAS_ROOT_USER_DEFINED} | ||||||
|  |         ${BLAS_ROOT_USER_DEFINED}/lapack | ||||||
|         /opt/local/lib/lapack |         /opt/local/lib/lapack | ||||||
|  |         /opt/local/lib/ | ||||||
|         /usr/local/opt/lapack/lib |         /usr/local/opt/lapack/lib | ||||||
|         /usr/local/lib |  | ||||||
|     NO_DEFAULT_PATH |     NO_DEFAULT_PATH | ||||||
|     NO_SYSTEM_ENVIRONMENT_PATH |     NO_SYSTEM_ENVIRONMENT_PATH | ||||||
|     NO_CMAKE_ENVIRONMENT_PATH |     NO_CMAKE_ENVIRONMENT_PATH | ||||||
| @@ -34,6 +36,7 @@ find_library(BLAS_LIBRARIES | |||||||
|  |  | ||||||
| if(BLAS_LIBRARIES) | if(BLAS_LIBRARIES) | ||||||
|     set(BLAS_FOUND TRUE) |     set(BLAS_FOUND TRUE) | ||||||
|  |     message(STATUS "BLAS library found at ${BLAS_LIBRARIES}") | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -41,9 +44,9 @@ find_library(LAPACK_LIBRARIES | |||||||
|     liblapack.dylib |     liblapack.dylib | ||||||
|     PATHS |     PATHS | ||||||
|         ${BLAS_ROOT_USER_DEFINED} |         ${BLAS_ROOT_USER_DEFINED} | ||||||
|  |         ${BLAS_ROOT_USER_DEFINED}/lapack | ||||||
|         /opt/local/lib/lapack |         /opt/local/lib/lapack | ||||||
|         /usr/local/opt/lapack/lib |         /usr/local/opt/lapack/lib | ||||||
|         /usr/local/lib |  | ||||||
|     NO_DEFAULT_PATH |     NO_DEFAULT_PATH | ||||||
|     NO_SYSTEM_ENVIRONMENT_PATH |     NO_SYSTEM_ENVIRONMENT_PATH | ||||||
|     NO_CMAKE_ENVIRONMENT_PATH |     NO_CMAKE_ENVIRONMENT_PATH | ||||||
| @@ -53,4 +56,5 @@ find_library(LAPACK_LIBRARIES | |||||||
|  |  | ||||||
| if(LAPACK_LIBRARIES) | if(LAPACK_LIBRARIES) | ||||||
|     set(LAPACK_FOUND TRUE) |     set(LAPACK_FOUND TRUE) | ||||||
|  |     message(STATUS "LAPACK library found at ${LAPACK_LIBRARIES}") | ||||||
| endif() | endif() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez