Skip to content

Commit

Permalink
try to use blastrampoline if lapack is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Nov 29, 2023
1 parent c894a7d commit 2d3a682
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ project(lovoalign Fortran)
# Set the output directory for the executable
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

find_package(LAPACK)
# Find LAPACK or LIBBLASTRAMPOLINE
find_package(LAPACK QUIET)
if(NOT LAPACK_FOUND)
find_library(LIBBLASTRAMPOLINE NAMES blastrampoline)
endif()

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif(NOT CMAKE_BUILD_TYPE)

if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
add_compile_options(
-Wall "$<$<CONFIG:Debug>:-Werror>"
-fmax-stack-var-size=1296000000
)
add_compile_options( -Wall "$<$<CONFIG:Debug>:-Werror>" -frecursive )
endif()

# Create the output directory
Expand Down Expand Up @@ -69,6 +70,13 @@ add_executable(lovoalign
src/optim.f
)

# Link LAPACK or LIBBLASTRAMPOLINE
if(LAPACK_FOUND)
target_link_libraries(lovoalign PRIVATE LAPACK::LAPACK)
else()
target_link_libraries(lovoalign PRIVATE ${LIBBLASTRAMPOLINE})
endif()

target_link_libraries(lovoalign PRIVATE LAPACK::LAPACK)

# Installation directive
Expand Down

0 comments on commit 2d3a682

Please sign in to comment.