| # SPDX-FileCopyrightText: The Eigen Authors | |
| # SPDX-License-Identifier: MPL-2.0 | |
| include(CheckLanguage) | |
| check_language(Fortran) | |
| if(CMAKE_Fortran_COMPILER) | |
| enable_language(Fortran) | |
| set(EIGEN_Fortran_COMPILER_WORKS ON) | |
| else() | |
| set(EIGEN_Fortran_COMPILER_WORKS OFF) | |
| endif() | |
| if (EIGEN_Fortran_COMPILER_WORKS) | |
| macro(ei_add_blas_test testname) | |
| set(targetname ${testname}) | |
| set(filename ${testname}.f) | |
| add_executable(${targetname} ${filename}) | |
| target_link_libraries(${targetname} eigen_blas) | |
| if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) | |
| target_link_libraries(${targetname} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) | |
| endif() | |
| target_link_libraries(${targetname} ${EXTERNAL_LIBS}) | |
| add_test(${testname} "${Eigen_SOURCE_DIR}/blas/testing/runblastest.sh" "${testname}" "${Eigen_SOURCE_DIR}/blas/testing/${testname}.dat") | |
| add_dependencies(buildtests ${targetname}) | |
| endmacro() | |
| ei_add_blas_test(sblat1) | |
| ei_add_blas_test(sblat2) | |
| ei_add_blas_test(sblat3) | |
| ei_add_blas_test(dblat1) | |
| ei_add_blas_test(dblat2) | |
| ei_add_blas_test(dblat3) | |
| ei_add_blas_test(cblat1) | |
| ei_add_blas_test(cblat2) | |
| ei_add_blas_test(cblat3) | |
| ei_add_blas_test(zblat1) | |
| ei_add_blas_test(zblat2) | |
| ei_add_blas_test(zblat3) | |
| # add_custom_target(level1) | |
| # add_dependencies(level1 sblat1) | |
| # Workaround for gfortran -O3 bug. The optimization | |
| # introduces a bug in the calculation of the norm of the error | |
| # in the complex case. | |
| if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") | |
| target_compile_options(cblat3 PRIVATE "-O0") | |
| target_compile_options(zblat3 PRIVATE "-O0") | |
| endif() | |
| endif() | |