mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 12:19:12 +08:00
Enable incomplete BLAS/Lapack builds when no fortran compiler has been found.
Works here with gcc. Hopefully this will work for MSVC too.
This commit is contained in:
parent
1d796acb05
commit
ebfed5a512
@ -343,7 +343,6 @@ else()
|
|||||||
add_subdirectory(test EXCLUDE_FROM_ALL)
|
add_subdirectory(test EXCLUDE_FROM_ALL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT MSVC)
|
|
||||||
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
|
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
|
||||||
add_subdirectory(blas)
|
add_subdirectory(blas)
|
||||||
add_subdirectory(lapack)
|
add_subdirectory(lapack)
|
||||||
@ -351,7 +350,6 @@ if(NOT MSVC)
|
|||||||
add_subdirectory(blas EXCLUDE_FROM_ALL)
|
add_subdirectory(blas EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(lapack EXCLUDE_FROM_ALL)
|
add_subdirectory(lapack EXCLUDE_FROM_ALL)
|
||||||
endif()
|
endif()
|
||||||
endif(NOT MSVC)
|
|
||||||
|
|
||||||
add_subdirectory(unsupported)
|
add_subdirectory(unsupported)
|
||||||
|
|
||||||
|
@ -13,16 +13,25 @@ if( NOT DEFINED EIGEN_Fortran_COMPILER_WORKS OR EIGEN_Fortran_COMPILER_WORKS)
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_Fortran_COMPILER_WORKS)
|
|
||||||
|
|
||||||
add_custom_target(blas)
|
add_custom_target(blas)
|
||||||
|
|
||||||
set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp xerbla.cpp
|
set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp xerbla.cpp)
|
||||||
|
|
||||||
|
if(CMAKE_Fortran_COMPILER_WORKS)
|
||||||
|
|
||||||
|
message(WARNING " No fortran compiler has been detected, the blas build will be incomplete.")
|
||||||
|
|
||||||
|
set(EigenBlas_SRCS ${EigenBlas_SRCS}
|
||||||
complexdots.f
|
complexdots.f
|
||||||
srotm.f srotmg.f drotm.f drotmg.f
|
srotm.f srotmg.f drotm.f drotmg.f
|
||||||
lsame.f chpr2.f ctbsv.f dspmv.f dtbmv.f dtpsv.f ssbmv.f sspr.f stpmv.f zhpr2.f ztbsv.f chbmv.f chpr.f ctpmv.f dspr2.f dtbsv.f sspmv.f stbmv.f stpsv.f zhbmv.f zhpr.f ztpmv.f chpmv.f ctbmv.f ctpsv.f dsbmv.f dspr.f dtpmv.f sspr2.f stbsv.f zhpmv.f ztbmv.f ztpsv.f
|
lsame.f chpr2.f ctbsv.f dspmv.f dtbmv.f dtpsv.f ssbmv.f sspr.f stpmv.f
|
||||||
|
zhpr2.f ztbsv.f chbmv.f chpr.f ctpmv.f dspr2.f dtbsv.f sspmv.f stbmv.f stpsv.f
|
||||||
|
zhbmv.f zhpr.f ztpmv.f chpmv.f ctbmv.f ctpsv.f dsbmv.f dspr.f dtpmv.f sspr2.f
|
||||||
|
stbsv.f zhpmv.f ztbmv.f ztpsv.f
|
||||||
)
|
)
|
||||||
|
|
||||||
|
endif(CMAKE_Fortran_COMPILER_WORKS)
|
||||||
|
|
||||||
add_library(eigen_blas_static ${EigenBlas_SRCS})
|
add_library(eigen_blas_static ${EigenBlas_SRCS})
|
||||||
add_library(eigen_blas SHARED ${EigenBlas_SRCS})
|
add_library(eigen_blas SHARED ${EigenBlas_SRCS})
|
||||||
|
|
||||||
@ -38,6 +47,7 @@ install(TARGETS eigen_blas eigen_blas_static
|
|||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
ARCHIVE DESTINATION lib)
|
ARCHIVE DESTINATION lib)
|
||||||
|
|
||||||
|
if(CMAKE_Fortran_COMPILER_WORKS)
|
||||||
|
|
||||||
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
|
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
|
||||||
add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest
|
add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest
|
||||||
@ -45,4 +55,5 @@ else()
|
|||||||
add_subdirectory(testing EXCLUDE_FROM_ALL)
|
add_subdirectory(testing EXCLUDE_FROM_ALL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif(CMAKE_Fortran_COMPILER_WORKS)
|
endif()
|
||||||
|
|
||||||
|
@ -13,15 +13,16 @@ if( NOT DEFINED EIGEN_Fortran_COMPILER_WORKS OR EIGEN_Fortran_COMPILER_WORKS)
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_Fortran_COMPILER_WORKS)
|
|
||||||
|
|
||||||
add_custom_target(lapack)
|
add_custom_target(lapack)
|
||||||
include_directories(../blas)
|
include_directories(../blas)
|
||||||
|
|
||||||
set(EigenLapack_SRCS
|
set(EigenLapack_SRCS
|
||||||
single.cpp double.cpp complex_single.cpp complex_double.cpp
|
single.cpp double.cpp complex_single.cpp complex_double.cpp ../blas/xerbla.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(CMAKE_Fortran_COMPILER_WORKS)
|
||||||
|
|
||||||
get_filename_component(eigen_full_path_to_reference_to_reference_lapack "./reference/" ABSOLUTE)
|
get_filename_component(eigen_full_path_to_reference_to_reference_lapack "./reference/" ABSOLUTE)
|
||||||
if(EXISTS ${eigen_full_path_to_reference_to_reference_lapack})
|
if(EXISTS ${eigen_full_path_to_reference_to_reference_lapack})
|
||||||
set(EigenLapack_SRCS ${EigenLapack_SRCS}
|
set(EigenLapack_SRCS ${EigenLapack_SRCS}
|
||||||
@ -357,6 +358,8 @@ reference/ctbcon.f reference/dormhr.f reference/sla_
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
endif(CMAKE_Fortran_COMPILER_WORKS)
|
||||||
|
|
||||||
add_library(eigen_lapack_static ${EigenLapack_SRCS})
|
add_library(eigen_lapack_static ${EigenLapack_SRCS})
|
||||||
add_library(eigen_lapack SHARED ${EigenLapack_SRCS})
|
add_library(eigen_lapack SHARED ${EigenLapack_SRCS})
|
||||||
|
|
||||||
@ -373,4 +376,4 @@ install(TARGETS eigen_lapack eigen_lapack_static
|
|||||||
ARCHIVE DESTINATION lib)
|
ARCHIVE DESTINATION lib)
|
||||||
|
|
||||||
# add_subdirectory(testing)
|
# add_subdirectory(testing)
|
||||||
endif(CMAKE_Fortran_COMPILER_WORKS)
|
|
||||||
|
@ -4,15 +4,11 @@ include_directories(../../test ../../unsupported ../../Eigen
|
|||||||
|
|
||||||
set(SPARSE_LIBS "")
|
set(SPARSE_LIBS "")
|
||||||
|
|
||||||
# configure blas/lapack
|
# configure blas/lapack (use Eigen's by default)
|
||||||
if(CMAKE_Fortran_COMPILER_WORKS)
|
|
||||||
set(BLAS_FOUND TRUE)
|
set(BLAS_FOUND TRUE)
|
||||||
set(LAPACK_FOUND TRUE)
|
set(LAPACK_FOUND TRUE)
|
||||||
set(BLAS_LIBRARIES eigen_blas_static)
|
set(BLAS_LIBRARIES eigen_blas)
|
||||||
set(LAPACK_LIBRARIES eigen_lapack_static)
|
set(LAPACK_LIBRARIES eigen_lapack)
|
||||||
else()
|
|
||||||
# TODO search for default blas/lapack
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(Cholmod)
|
find_package(Cholmod)
|
||||||
if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND)
|
if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user