Skip to content

Commit e624fd6

Browse files
committed
- ensure compilation with older cmake, force C_INT type to int on windows
1 parent 8b0deaf commit e624fd6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

CMakeModules/FindCLAPACK.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ if(NOT LAPACK_FOUND)
128128
set(LAPACK_LIBRARIES "${MKLROOT}/lib/intel64/mkl_intel_lp64.lib" "${MKLROOT}/lib/intel64/mkl_core.lib" "${MKLROOT}/lib/intel64/mkl_sequential.lib")
129129
elseif(EXISTS "${MKLROOT}/lib/mkl_intel_lp64.lib")
130130
set(LAPACK_LIBRARIES "${MKLROOT}/lib/mkl_intel_lp64.lib" "${MKLROOT}/lib/mkl_core.lib" "${MKLROOT}/lib/mkl_sequential.lib")
131+
list(APPEND LOCAL_LAPACK_DEFINES "-DF2C_INTEGER=int")
131132
endif()
132133
endif()
133134

@@ -371,15 +372,16 @@ if(NOT CLAPACK_LIBRARIES AND NOT APPLE)
371372
endif(NOT CLAPACK_LIBRARIES AND NOT APPLE)
372373

373374
list(REMOVE_DUPLICATES LOCAL_LAPACK_DEFINES)
375+
message(STATUS "LOCAL_LAPACK_DEFINES: ${LOCAL_LAPACK_DEFINES}")
374376

375377
if (LOCAL_LAPACK_DEFINES)
376-
set (CACHE{CLAPACK_DEFINES} TYPE STRING HELP "defines for lapack" FORCE VALUE ${LOCAL_LAPACK_DEFINES})
378+
set(CLAPACK_DEFINES "${LOCAL_LAPACK_DEFINES}" CACHE STRING "defines for lapack" FORCE)
377379
endif(LOCAL_LAPACK_DEFINES)
378380

379381
# handle the QUIETLY and REQUIRED arguments and set CLAPACK_FOUND to TRUE if
380382
# all listed variables are TRUE
381383
include(FindPackageHandleStandardArgs)
382-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLAPACK DEFAULT_MSG CLAPACK_LIBRARIES CLAPACK_INCLUDE_DIR BLA_VENDOR)
384+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLAPACK DEFAULT_MSG CLAPACK_LIBRARIES CLAPACK_INCLUDE_DIR CLAPACK_DEFINES BLA_VENDOR)
383385

384386
mark_as_advanced(CLAPACK_LIBRARIES CLAPACK_INCLUDE_DIR CLAPACK_DEFINES BLA_VENDOR)
385387

0 commit comments

Comments
 (0)