Skip to content

Commit f3e8010

Browse files
committed
Merge branch 'master' of github.com:Reference-LAPACK/lapack
2 parents 9c2380c + 1782d90 commit f3e8010

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+231
-174
lines changed

BLAS/SRC/crotg.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
! CROTG constructs a plane rotation
1212
! [ c s ] [ a ] = [ r ]
1313
! [ -conjg(s) c ] [ b ] [ 0 ]
14-
! where c is real, s ic complex, and c**2 + conjg(s)*s = 1.
14+
! where c is real, s is complex, and c**2 + conjg(s)*s = 1.
1515
!
1616
!> \par Purpose:
1717
! =============
@@ -28,8 +28,8 @@
2828
!> r = sgn(a)*sqrt(|a|**2 + |b|**2)
2929
!> c = a / r
3030
!> s = b / r
31-
!> the same as in CROTG when |a| > |b|. When |b| >= |a|, the
32-
!> sign of c and s will be different from those computed by CROTG
31+
!> the same as in SROTG when |a| > |b|. When |b| >= |a|, the
32+
!> sign of c and s will be different from those computed by SROTG
3333
!> if the signs of a and b are not the same.
3434
!>
3535
!> \endverbatim

BLAS/SRC/zrotg.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
! ZROTG constructs a plane rotation
1212
! [ c s ] [ a ] = [ r ]
1313
! [ -conjg(s) c ] [ b ] [ 0 ]
14-
! where c is real, s ic complex, and c**2 + conjg(s)*s = 1.
14+
! where c is real, s is complex, and c**2 + conjg(s)*s = 1.
1515
!
1616
!> \par Purpose:
1717
! =============
@@ -28,8 +28,8 @@
2828
!> r = sgn(a)*sqrt(|a|**2 + |b|**2)
2929
!> c = a / r
3030
!> s = b / r
31-
!> the same as in ZROTG when |a| > |b|. When |b| >= |a|, the
32-
!> sign of c and s will be different from those computed by ZROTG
31+
!> the same as in DROTG when |a| > |b|. When |b| >= |a|, the
32+
!> sign of c and s will be different from those computed by DROTG
3333
!> if the signs of a and b are not the same.
3434
!>
3535
!> \endverbatim

CBLAS/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ FortranCInterface_HEADER(${LAPACK_BINARY_DIR}/include/cblas_mangling.h
1111
MACRO_NAMESPACE "F77_"
1212
SYMBOL_NAMESPACE "F77_")
1313
if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
14-
message(WARNING "Reverting to pre-defined include/lapacke_mangling.h")
15-
configure_file(include/lapacke_mangling_with_flags.h.in
16-
${LAPACK_BINARY_DIR}/include/lapacke_mangling.h)
14+
message(WARNING "Reverting to pre-defined include/cblas_mangling.h")
1715
configure_file(include/cblas_mangling_with_flags.h.in
1816
${LAPACK_BINARY_DIR}/include/cblas_mangling.h)
1917
endif()

CBLAS/include/cblas.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef CBLAS_H
22
#define CBLAS_H
33
#include <stddef.h>
4+
#include <stdint.h>
45

56

67
#ifdef __cplusplus
@@ -15,10 +16,12 @@ extern "C" { /* Assume C declarations for C++ */
1516
/*
1617
* Integer type
1718
*/
19+
#ifndef CBLAS_INT
1820
#ifdef WeirdNEC
19-
#define CBLAS_INT long
21+
#define CBLAS_INT int64_t
2022
#else
21-
#define CBLAS_INT int
23+
#define CBLAS_INT int32_t
24+
#endif
2225
#endif
2326

2427
typedef enum CBLAS_LAYOUT {CblasRowMajor=101, CblasColMajor=102} CBLAS_LAYOUT;

CBLAS/include/cblas_f77.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define CBLAS_F77_H
1111

1212
#include <stdarg.h>
13+
#include <stdint.h>
1314

1415
/* It seems all current Fortran compilers put strlen at end.
1516
* Some historical compilers put strlen after the str argument
@@ -24,10 +25,12 @@
2425
#define F77_STRLEN(a) (_fcdlen)
2526
#endif
2627

28+
#ifndef F77_INT
2729
#ifdef WeirdNEC
28-
#define F77_INT long
30+
#define F77_INT int64_t
2931
#else
30-
#define F77_INT int
32+
#define F77_INT int32_t
33+
#endif
3134
#endif
3235

3336
#ifdef F77_CHAR
@@ -527,7 +530,11 @@
527530
extern "C" {
528531
#endif
529532

530-
void F77_xerbla(FCHAR, void *);
533+
#ifdef BLAS_FORTRAN_STRLEN_END
534+
#define F77_xerbla(...) F77_xerbla_base(__VA_ARGS__, 1)
535+
#else
536+
#define F77_xerbla(...) F77_xerbla_base(__VA_ARGS__)
537+
#endif
531538
void F77_xerbla_base(FCHAR, void *
532539
#ifdef BLAS_FORTRAN_STRLEN_END
533540
, size_t

CBLAS/src/xerbla.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ void
1010
#ifdef HAS_ATTRIBUTE_WEAK_SUPPORT
1111
__attribute__((weak))
1212
#endif
13-
F77_xerbla
13+
F77_xerbla_base
1414
#ifdef F77_CHAR
15-
(F77_CHAR F77_srname, void *vinfo)
15+
(F77_CHAR F77_srname, void *vinfo
1616
#else
17-
(char *srname, void *vinfo)
17+
(char *srname, void *vinfo
1818
#endif
19-
19+
#ifdef BLAS_FORTRAN_STRLEN_END
20+
, size_t len
21+
#endif
22+
)
2023
{
2124
#ifdef F77_CHAR
2225
char *srname;

CMAKE/CheckLAPACKCompilerFlags.cmake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ macro( CheckLAPACKCompilerFlags )
1414

1515
set( FPE_EXIT FALSE )
1616

17+
# FORTRAN ILP default
18+
if ( FORTRAN_ILP )
19+
if( CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" )
20+
if ( WIN32 )
21+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /integer-size:64")
22+
else ()
23+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -integer-size 64")
24+
endif()
25+
else()
26+
set(CPE_ENV $ENV{PE_ENV})
27+
if(CPE_ENV STREQUAL "CRAY")
28+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -sinteger64")
29+
elseif(CPE_ENV STREQUAL "NVIDIA")
30+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -i8")
31+
else()
32+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-integer-8")
33+
endif()
34+
endif()
35+
endif()
36+
1737
# GNU Fortran
1838
if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
1939
if( "${CMAKE_Fortran_FLAGS}" MATCHES "-ffpe-trap=[izoupd]")

CMakeLists.txt

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,7 @@ if(BUILD_INDEX64)
5353
set(LAPACKELIB "lapacke64")
5454
set(TMGLIB "tmglib64")
5555
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWeirdNEC -DLAPACK_ILP64 -DHAVE_LAPACK_CONFIG_H")
56-
set(CPE_ENV $ENV{PE_ENV})
57-
if(CPE_ENV STREQUAL "CRAY")
58-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -sinteger64")
59-
elseif(CPE_ENV STREQUAL "NVIDIA")
60-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -i8")
61-
else()
62-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-integer-8")
63-
endif()
56+
set(FORTRAN_ILP TRUE)
6457
else()
6558
set(BLASLIB "blas")
6659
set(CBLASLIB "cblas")
@@ -98,28 +91,44 @@ include(PreventInBuildInstalls)
9891

9992
# Check if recursive flag exists
10093
include(CheckFortranCompilerFlag)
101-
check_fortran_compiler_flag("-recursive" _recursiveFlag)
102-
check_fortran_compiler_flag("-frecursive" _frecursiveFlag)
103-
check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag)
94+
if(CMAKE_Fortran_COMPILER_ID STREQUAL Flang)
95+
check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag)
96+
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
97+
check_fortran_compiler_flag("-frecursive" _frecursiveFlag)
98+
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
99+
check_fortran_compiler_flag("-recursive" _recursiveFlag)
100+
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
101+
check_fortran_compiler_flag("-qrecur" _qrecurFlag)
102+
else()
103+
message(WARNING "Fortran local arrays should be allocated on the stack."
104+
" Please use a compiler which guarantees that feature."
105+
" See https://github.com/Reference-LAPACK/lapack/pull/188 and references therein.")
106+
endif()
104107

105108
# Add recursive flag
106-
if(_recursiveFlag)
107-
string(REGEX MATCH "-recursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
109+
if(_MrecursiveFlag)
110+
string(REGEX MATCH "-Mrecursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
108111
if(NOT output_test)
109-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive"
112+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive"
110113
CACHE STRING "Recursive flag must be set" FORCE)
111114
endif()
112115
elseif(_frecursiveFlag)
113116
string(REGEX MATCH "-frecursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
114117
if(NOT output_test)
115118
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -frecursive"
116-
CACHE STRING "Recursive flag must be set" FORCE)
119+
CACHE STRING "Recursive flag must be set" FORCE)
117120
endif()
118-
elseif(_MrecursiveFlag)
119-
string(REGEX MATCH "-Mrecursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
121+
elseif(_recursiveFlag)
122+
string(REGEX MATCH "-recursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
120123
if(NOT output_test)
121-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive"
122-
CACHE STRING "Recursive flag must be set" FORCE)
124+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive"
125+
CACHE STRING "Recursive flag must be set" FORCE)
126+
endif()
127+
elseif(_qrecurFlag)
128+
string(REGEX MATCH "-qrecur" output_test <string> "${CMAKE_Fortran_FLAGS}")
129+
if(NOT output_test)
130+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qrecur"
131+
CACHE STRING "Recursive flag must be set" FORCE)
123132
endif()
124133
endif()
125134

@@ -128,7 +137,7 @@ if(UNIX)
128137
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict")
129138
endif()
130139
if(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
131-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qnosave -qstrict=none")
140+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qnosave -qstrict")
132141
endif()
133142
# Delete libmtsk in linking sequence for Sun/Oracle Fortran Compiler.
134143
# This library is not present in the Sun package SolarisStudio12.3-linux-x86-bin

INSTALL/make.inc.XLF

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ CFLAGS = -O3 -qnosave
1414
# the compiler options desired when NO OPTIMIZATION is selected.
1515
#
1616
FC = xlf
17-
FFLAGS = -O3 -qfixed -qnosave
17+
FFLAGS = -O3 -qfixed -qnosave -qrecur
1818
# For -O2, add -qstrict=none
1919
FFLAGS_DRV = $(FFLAGS)
20-
FFLAGS_NOOPT = -O0 -qfixed -qnosave
20+
FFLAGS_NOOPT = -O0 -qfixed -qnosave -qrecur
2121

2222
# Define LDFLAGS to the desired linker options for your machine.
2323
#

INSTALL/make.inc.gfortran

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,8 @@ CBLASLIB = $(TOPSRCDIR)/libcblas.a
7979
LAPACKLIB = $(TOPSRCDIR)/liblapack.a
8080
TMGLIB = $(TOPSRCDIR)/libtmglib.a
8181
LAPACKELIB = $(TOPSRCDIR)/liblapacke.a
82+
83+
# DOCUMENTATION DIRECTORY
84+
# If you generate html pages (make html), documentation will be placed in $(DOCSDIR)/explore-html
85+
# If you generate man pages (make man), documentation will be placed in $(DOCSDIR)/man
86+
DOCSDIR = $(TOPSRCDIR)/DOCS

0 commit comments

Comments
 (0)