Skip to content

Commit 5953353

Browse files
authored
Merge branch 'Reference-LAPACK:master' into orm2r
2 parents 4a5139e + 8b468db commit 5953353

22 files changed

+220
-272
lines changed

CMAKE/CheckLAPACKCompilerFlags.cmake

Lines changed: 145 additions & 209 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.9)
1+
cmake_minimum_required(VERSION 3.13)
22

33
project(LAPACK)
44

@@ -107,9 +107,18 @@ else()
107107
set(LAPACKELIB "lapacke")
108108
set(TMGLIB "tmglib")
109109
endif()
110-
# By default build extended _64 API for supported compilers only
110+
111+
# By default build extended _64 API for supported compilers only. This needs
112+
# CMake >= 3.18! Let's disable it by default for CMake < 3.18.
113+
if(CMAKE_VERSION VERSION_LESS "3.18")
114+
set(INDEX64_EXT_API_DEFAULT OFF)
115+
else()
116+
set(INDEX64_EXT_API_DEFAULT ON)
117+
endif()
111118
set(INDEX64_EXT_API_COMPILERS "Intel|GNU")
112-
option(BUILD_INDEX64_EXT_API "Build Index-64 API as extended API with _64 suffix" ON)
119+
option(BUILD_INDEX64_EXT_API
120+
"Build Index-64 API as extended API with _64 suffix (needs CMake >= 3.18)"
121+
${INDEX64_EXT_API_DEFAULT})
113122
message(STATUS "Build Index-64 API as extended API with _64 suffix: ${BUILD_INDEX64_EXT_API}")
114123

115124
include(GNUInstallDirs)
@@ -119,13 +128,22 @@ include(GNUInstallDirs)
119128
# the OSX RPATH settings have been updated per recommendations found
120129
# in the CMake Wiki:
121130
# http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH
122-
set(CMAKE_MACOSX_RPATH ON)
123-
set(CMAKE_SKIP_BUILD_RPATH FALSE)
124-
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
131+
option(CMAKE_MACOSX_RPATH "Enable macOS RPATH" ON)
132+
message(STATUS "Enable macOS RPATH: ${CMAKE_MACOSX_RPATH}")
133+
option(CMAKE_SKIP_BUILD_RPATH "Skip build-time RPATH" OFF)
134+
message(STATUS "Skip build-time RPATH: ${CMAKE_SKIP_BUILD_RPATH}")
135+
option(CMAKE_BUILD_WITH_INSTALL_RPATH "Build with install RPATH" OFF)
136+
message(STATUS "Build with install RPATH: ${CMAKE_BUILD_WITH_INSTALL_RPATH}")
137+
125138
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${CMAKE_INSTALL_FULL_LIBDIR} isSystemDir)
126-
if("${isSystemDir}" STREQUAL "-1")
127-
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
128-
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
139+
140+
if ("${isSystemDir}" STREQUAL "-1")
141+
if(${CMAKE_INSTALL_FULL_LIBDIR})
142+
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
143+
endif()
144+
message(STATUS "Install RPATH: ${CMAKE_INSTALL_RPATH}")
145+
option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "Use link path for RPATH" TRUE)
146+
message(STATUS "Install RPATH use link path: ${CMAKE_INSTALL_RPATH_USE_LINK_PATH}")
129147
endif()
130148

131149

@@ -256,15 +274,7 @@ if(NOT BLAS_FOUND)
256274
add_subdirectory(BLAS)
257275
set(BLAS_LIBRARIES ${BLASLIB})
258276
else()
259-
set(CMAKE_EXE_LINKER_FLAGS
260-
"${CMAKE_EXE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
261-
CACHE STRING "Linker flags for executables" FORCE)
262-
set(CMAKE_MODULE_LINKER_FLAGS
263-
"${CMAKE_MODULE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
264-
CACHE STRING "Linker flags for modules" FORCE)
265-
set(CMAKE_SHARED_LINKER_FLAGS
266-
"${CMAKE_SHARED_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
267-
CACHE STRING "Linker flags for shared libs" FORCE)
277+
add_link_options(${BLAS_LINKER_FLAGS})
268278
endif()
269279

270280

@@ -346,15 +356,7 @@ if(NOT LATESTLAPACK_FOUND)
346356

347357
add_subdirectory(SRC)
348358
else()
349-
set(CMAKE_EXE_LINKER_FLAGS
350-
"${CMAKE_EXE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
351-
CACHE STRING "Linker flags for executables" FORCE)
352-
set(CMAKE_MODULE_LINKER_FLAGS
353-
"${CMAKE_MODULE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
354-
CACHE STRING "Linker flags for modules" FORCE)
355-
set(CMAKE_SHARED_LINKER_FLAGS
356-
"${CMAKE_SHARED_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
357-
CACHE STRING "Linker flags for shared libs" FORCE)
359+
add_link_options(${LAPACK_LINKER_FLAGS})
358360
endif()
359361

360362
if(BUILD_TESTING)

INSTALL/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
cmake_minimum_required(VERSION 3.6)
1+
cmake_minimum_required(VERSION 3.13)
22
project(TIMING Fortran)
3+
4+
# Add the CMake directory for custom CMake modules
5+
set(CMAKE_MODULE_PATH "${TIMING_SOURCE_DIR}/../CMAKE" ${CMAKE_MODULE_PATH})
6+
7+
# Check for any necessary platform specific compiler flags
8+
include(CheckLAPACKCompilerFlags)
9+
CheckLAPACKCompilerFlags()
10+
311
add_executable(secondtst_NONE second_NONE.f secondtst.f)
412
add_executable(secondtst_EXT_ETIME second_EXT_ETIME.f secondtst.f)
513
add_executable(secondtst_EXT_ETIME_ second_EXT_ETIME_.f secondtst.f)

LAPACKE/mangling/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.6)
1+
cmake_minimum_required(VERSION 3.13)
22
project(MANGLING C Fortran)
33

44
add_executable(xintface Fintface.f Cintface.c)

SRC/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ if(BUILD_INDEX64_EXT_API)
541541
set(BUILD_INDEX64_EXT_API OFF)
542542
set(BUILD_INDEX64_EXT_API OFF PARENT_SCOPE)
543543
else()
544+
cmake_minimum_required(VERSION 3.18)
544545
set(SOURCES_64)
545546
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${LAPACKLIB}_64_obj)
546547
file(COPY ${SOURCES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${LAPACKLIB}_64_obj)

SRC/cgetc2.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ SUBROUTINE CGETC2( N, A, LDA, IPIV, JPIV, INFO )
176176
* Find max element in matrix A
177177
*
178178
XMAX = ZERO
179-
DO 20 IP = I, N
180-
DO 10 JP = I, N
179+
DO 20 JP = I, N
180+
DO 10 IP = I, N
181181
IF( ABS( A( IP, JP ) ).GE.XMAX ) THEN
182182
XMAX = ABS( A( IP, JP ) )
183183
IPV = IP

SRC/clarfb.f

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,8 @@
170170
*>
171171
*> The shape of the matrix V and the storage of the vectors which define
172172
*> the H(i) is best illustrated by the following example with n = 5 and
173-
*> k = 3. The elements equal to 1 are not stored; the corresponding
174-
*> array elements are modified but restored on exit. The rest of the
175-
*> array is not used.
173+
*> k = 3. The triangular part of V (including its diagonal) is not
174+
*> referenced.
176175
*>
177176
*> DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R':
178177
*>

SRC/cunhr_col.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ SUBROUTINE CUNHR_COL( M, N, NB, A, LDA, T, LDT, D, INFO )
421421
*
422422
JBTEMP2 = JB - 2
423423
DO J = JB, JB+JNB-2
424-
DO I = J-JBTEMP2, NB
424+
DO I = J-JBTEMP2, MIN( NB, N )
425425
T( I, J ) = CZERO
426426
END DO
427427
END DO

SRC/dgetc2.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ SUBROUTINE DGETC2( N, A, LDA, IPIV, JPIV, INFO )
176176
* Find max element in matrix A
177177
*
178178
XMAX = ZERO
179-
DO 20 IP = I, N
180-
DO 10 JP = I, N
179+
DO 20 JP = I, N
180+
DO 10 IP = I, N
181181
IF( ABS( A( IP, JP ) ).GE.XMAX ) THEN
182182
XMAX = ABS( A( IP, JP ) )
183183
IPV = IP

SRC/dlarfb.f

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,8 @@
170170
*>
171171
*> The shape of the matrix V and the storage of the vectors which define
172172
*> the H(i) is best illustrated by the following example with n = 5 and
173-
*> k = 3. The elements equal to 1 are not stored; the corresponding
174-
*> array elements are modified but restored on exit. The rest of the
175-
*> array is not used.
173+
*> k = 3. The triangular part of V (including its diagonal) is not
174+
*> referenced.
176175
*>
177176
*> DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R':
178177
*>

0 commit comments

Comments
 (0)