Commit 85dedb63 authored by Alexander Danilov's avatar Alexander Danilov

ILU2: check Fortran and BLAS in CMakeLists.txt

Handle situations with no Fortran compiler and no BLAS library.
Logic is moved upwards from ILU2 project, otherwise examples and tests
will not link with fortran libraries.
parent d13bcf94
......@@ -72,12 +72,18 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_find/")
if(TEST_FORTRAN_ANI3D)
add_subdirectory(ILU2)
if(ANI3D_AVAILIBLE)
include(CheckLanguage)
check_language(Fortran)
find_package(BLAS)
if(NOT CMAKE_Fortran_COMPILER OR NOT BLAS_FOUND)
message(STATUS "No Fortran or BLAS support")
option(USE_SOLVER_ANI "Compile with ANI3D sequential solvers" OFF)
else()
enable_language(Fortran)
add_subdirectory(ILU2)
option(USE_SOLVER_ANI "Compile with ANI3D sequential solvers" ON)
endif()
endif()
......
......@@ -7,8 +7,11 @@ target_link_libraries(FVDiscr inmost)
if(USE_SOLVER)
if(USE_SOLVER_ANI)
message("linking FVDiscr with ani3d")
target_link_libraries(FVDiscr ani3d)
message("linking FVDiscr with ani3d and BLAS")
target_link_libraries(FVDiscr ani3d ${BLAS_LIBRARIES})
if(BLAS_LINKER_FLAGS)
set_target_properties(FVDiscr PROPERTIES LINK_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
endif()
if(USE_SOLVER_PETSC)
message("linking FVDiscr with PETSc")
......
......@@ -15,8 +15,11 @@ endif(USE_MPI)
if(USE_SOLVER)
if(USE_SOLVER_ANI)
message("linking MatSolve with ani3d")
target_link_libraries(MatSolve ani3d)
message("linking MatSolve with ani3d and BLAS")
target_link_libraries(MatSolve ani3d ${BLAS_LIBRARIES})
if(BLAS_LINKER_FLAGS)
set_target_properties(MatSolve PROPERTIES LINK_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
endif()
if(USE_SOLVER_PETSC)
message("linking MatSolve with PETSc")
......
......@@ -6,8 +6,11 @@ add_executable(Solver ${SOURCE})
target_link_libraries(Solver inmost)
if(USE_SOLVER_ANI)
message("linking Solver with ani3d")
target_link_libraries(Solver ani3d)
message("linking Solver with ani3d and BLAS")
target_link_libraries(Solver ani3d ${BLAS_LIBRARIES})
if(BLAS_LINKER_FLAGS)
set_target_properties(Solver PROPERTIES LINK_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
endif()
if(USE_SOLVER_PETSC)
message("linking Solver with PETSc")
......@@ -37,4 +40,4 @@ if(USE_MPI)
endif(USE_MPI)
install(TARGETS Solver EXPORT inmost-targets RUNTIME DESTINATION bin)
\ No newline at end of file
install(TARGETS Solver EXPORT inmost-targets RUNTIME DESTINATION bin)
......@@ -14,8 +14,11 @@ endif(USE_MPI)
if(USE_SOLVER_ANI)
message("linking solver_test000 with ani3d")
target_link_libraries(solver_test000 ani3d)
message("linking solver_test000 with ani3d and BLAS")
target_link_libraries(solver_test000 ani3d ${BLAS_LIBRARIES})
if(BLAS_LINKER_FLAGS)
set_target_properties(solver_test000 PROPERTIES LINK_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
endif()
if(USE_SOLVER_PETSC)
message("linking solver_test000 with PETSc")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment