Skip to content

Commit fd82c87

Browse files
authored
Merge branch 'master' into master
2 parents 8ade5d1 + f86d08b commit fd82c87

File tree

554 files changed

+2496
-1980
lines changed

Some content is hidden

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

554 files changed

+2496
-1980
lines changed

.appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ skip_commits:
1414
environment:
1515
global:
1616
CONDA_INSTALL_LOCN: C:\\Miniconda37-x64
17+
CTEST_OUTPUT_ON_FAILURE: 1
1718

1819
install:
1920
- call %CONDA_INSTALL_LOCN%\Scripts\activate.bat

.github/SECURITY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Security updates are applied only to the latest release.
6+
7+
## Reporting a Vulnerability
8+
9+
If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released.
10+
11+
Please disclose it at [security advisory](https://github.com/Reference-LAPACK/lapack/security/advisories/new).
12+
13+
This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.

.github/workflows/cmake.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- master
7-
- try-github-actions
7+
- try-github-actions-for-windows
88
paths:
99
- .github/workflows/cmake.yml
1010
- '**CMakeLists.txt'
@@ -62,36 +62,38 @@ jobs:
6262
strategy:
6363
fail-fast: true
6464
matrix:
65-
os: [ macos-latest, ubuntu-latest ]
65+
os: [ macos-latest, ubuntu-latest, windows-latest ]
6666
fflags: [
6767
"-Wall -Wno-unused-dummy-argument -Wno-unused-variable -Wno-unused-label -Werror=conversion -fimplicit-none -frecursive -fcheck=all",
6868
"-Wall -Wno-unused-dummy-argument -Wno-unused-variable -Wno-unused-label -Werror=conversion -fimplicit-none -frecursive -fcheck=all -fopenmp" ]
6969

7070
steps:
7171

7272
- name: Checkout LAPACK
73-
uses: actions/checkout@v2
73+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
74+
75+
- name: Install ninja-build tool
76+
uses: seanmiddleditch/gha-setup-ninja@16b940825621068d98711680b6c3ff92201f8fc0 # v3
7477

7578
- name: Use GCC-11 on MacOS
7679
if: ${{ matrix.os == 'macos-latest' }}
7780
run: >
78-
cmake -B build
81+
cmake -B build -G Ninja
7982
-D CMAKE_C_COMPILER="gcc-11"
8083
-D CMAKE_Fortran_COMPILER="gfortran-11"
8184
-D USE_FLAT_NAMESPACE:BOOL=ON
8285
83-
# - name: Use Unix Makefiles on Windows
84-
# if: ${{ matrix.os == 'windows-latest' }}
85-
# run: >
86-
# cmake -B build
87-
# -G "Unix Makefiles"
88-
# -D CMAKE_C_FLAGS="${{env.CFLAGS}} -Wl,--stack=1000000000"
86+
- name: Special flags for Windows
87+
if: ${{ matrix.os == 'windows-latest' }}
88+
run: >
89+
cmake -B build -G Ninja
90+
-D CMAKE_EXE_LINKER_FLAGS="-Wl,--stack=2097152"
8991
9092
- name: Configure CMake
9193
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
9294
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
9395
run: >
94-
cmake -B build
96+
cmake -B build -G Ninja
9597
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
9698
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/lapack_install
9799
-D CBLAS:BOOL=ON
@@ -107,18 +109,18 @@ jobs:
107109
run: |
108110
ctest -D ExperimentalStart
109111
ctest -D ExperimentalConfigure
110-
ctest -D ExperimentalBuild -j2
112+
ctest -D ExperimentalBuild
111113
112114
- name: Test with OpenMP
113115
working-directory: ${{github.workspace}}/build
114-
if: ${{ contains( matrix.fflags, 'openmp' ) }}
116+
if: ${{ contains( matrix.fflags, 'openmp' ) && (matrix.os != 'windows-latest') }}
115117
run: |
116118
ctest -D ExperimentalTest --schedule-random -j1 --output-on-failure --timeout 100
117119
ctest -D ExperimentalSubmit
118120
119121
- name: Test
120122
working-directory: ${{github.workspace}}/build
121-
if: ${{ !contains( matrix.fflags, 'openmp' ) }}
123+
if: ${{ !contains( matrix.fflags, 'openmp' ) && (matrix.os != 'windows-latest') }}
122124
run: |
123125
ctest -D ExperimentalTest --schedule-random -j2 --output-on-failure --timeout 100
124126
ctest -D ExperimentalSubmit
@@ -134,7 +136,7 @@ jobs:
134136
steps:
135137

136138
- name: Checkout LAPACK
137-
uses: actions/checkout@v2
139+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
138140

139141
- name: Configure CMake
140142
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.

.github/workflows/makefile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
runs-on: ubuntu-latest
5656
steps:
5757
- name: Checkout LAPACK
58-
uses: actions/checkout@v2
58+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
5959
- name: Set configurations
6060
run: |
6161
echo "SHELL = /bin/sh" >> make.inc
@@ -76,7 +76,7 @@ jobs:
7676
runs-on: macos-latest
7777
steps:
7878
- name: Checkout LAPACK
79-
uses: actions/checkout@v2
79+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
8080
- name: Set configurations
8181
run: |
8282
echo "SHELL = /bin/sh" >> make.inc

CBLAS/testing/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
#######################################################################
55

66
macro(add_cblas_test output input target)
7-
set(TEST_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/${input}")
7+
if(NOT "${input}" STREQUAL "")
8+
set(TEST_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/${input}")
9+
endif()
810
set(TEST_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${output}")
911
set(testName "${target}")
1012

11-
if(EXISTS "${TEST_INPUT}")
13+
if(DEFINED TEST_INPUT AND EXISTS "${TEST_INPUT}")
1214
add_test(NAME CBLAS-${testName} COMMAND "${CMAKE_COMMAND}"
1315
-DTEST=$<TARGET_FILE:${target}>
1416
-DINPUT=${TEST_INPUT}

CMAKE/CheckFortranTypeSizes.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This module perdorms several try-compiles to determine the default integer
1+
# This module performs several try-compiles to determine the default integer
22
# size being used by the fortran compiler
33
#
44
# After execution, the following variables are set. If they are un set then

CMAKE/Findcodecov.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function(add_coverage TNAME)
3636
endfunction()
3737

3838

39-
# Find the reuired flags foreach language.
39+
# Find the required flags foreach language.
4040
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
4141
set(CMAKE_REQUIRED_QUIET ${codecov_FIND_QUIETLY})
4242

@@ -118,7 +118,7 @@ function (codecov_path_of_source FILE RETURN_VAR)
118118

119119
# If expression was found, SOURCEFILE is a generator-expression for an
120120
# object library. Currently we found no way to call this function automatic
121-
# for the referenced target, so it must be called in the directoryso of the
121+
# for the referenced target, so it must be called in the directory of the
122122
# object library definition.
123123
if(NOT "${_source}" STREQUAL "")
124124
set(${RETURN_VAR} "" PARENT_SCOPE)

CMakeLists.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ set(
1010
${LAPACK_MAJOR_VERSION}.${LAPACK_MINOR_VERSION}.${LAPACK_PATCH_VERSION}
1111
)
1212

13+
# Allow setting a prefix for the library names
14+
set(CMAKE_STATIC_LIBRARY_PREFIX "lib${LIBRARY_PREFIX}")
15+
set(CMAKE_SHARED_LIBRARY_PREFIX "lib${LIBRARY_PREFIX}")
16+
1317
# Add the CMake directory for custom CMake modules
1418
set(CMAKE_MODULE_PATH "${LAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})
1519

@@ -72,7 +76,7 @@ if( TEST_FORTRAN_COMPILER )
7276
WORKING_DIRECTORY ${LAPACK_BINARY_DIR}/INSTALL
7377
COMMENT "Running test_zminMax in ${LAPACK_BINARY_DIR}/INSTALL with stderr: test_zminMax.err"
7478
SOURCES ${LAPACK_SOURCE_DIR}/INSTALL/test_zminMax.f )
75-
79+
7680
endif()
7781

7882
# By default static library
@@ -444,7 +448,9 @@ endif()
444448
set(LAPACK_INSTALL_EXPORT_NAME ${LAPACK_INSTALL_EXPORT_NAME_CACHE})
445449
unset(LAPACK_INSTALL_EXPORT_NAME_CACHE)
446450

447-
add_subdirectory(LAPACKE)
451+
if(LAPACKE)
452+
add_subdirectory(LAPACKE)
453+
endif()
448454

449455

450456
#-------------------------------------
@@ -468,8 +474,8 @@ if (BLAS++)
468474
ExternalProject_Add(blaspp
469475
URL https://bitbucket.org/icl/blaspp/downloads/blaspp-2020.10.02.tar.gz
470476
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env LIBRARY_PATH=$ENV{LIBRARY_PATH}:${CMAKE_BINARY_DIR}/lib LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${PROJECT_BINARY_DIR}/lib ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR} -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} ${PROJECT_BINARY_DIR}/blaspp-prefix/src/blaspp
471-
BUILD_COMMAND ${CMAKE_COMMAND} -E env LIBRARY_PATH=$ENV{LIBRARY_PATH}:${PROJECT_BINARY_DIR}/lib LIB_SUFFIX="" make
472-
INSTALL_COMMAND make PREFIX=${PROJECT_BINARY_DIR} LIB_SUFFIX="" install
477+
BUILD_COMMAND ${CMAKE_COMMAND} -E env LIBRARY_PATH=$ENV{LIBRARY_PATH}:${PROJECT_BINARY_DIR}/lib LIB_SUFFIX="" ${CMAKE_COMMAND} --build .
478+
INSTALL_COMMAND ${CMAKE_COMMAND} -E env PREFIX=${PROJECT_BINARY_DIR} LIB_SUFFIX="" ${CMAKE_COMMAND} --install .
473479
)
474480
ExternalProject_Add_StepDependencies(blaspp build ${BLAS_LIBRARIES})
475481
endif()
@@ -481,16 +487,16 @@ if (LAPACK++)
481487
ExternalProject_Add(lapackpp
482488
URL https://bitbucket.org/icl/lapackpp/downloads/lapackpp-2020.10.02.tar.gz
483489
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env LIBRARY_PATH=$ENV{LIBRARY_PATH}:${CMAKE_BINARY_DIR}/lib LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${PROJECT_BINARY_DIR}/lib ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR} -DCMAKE_INSTALL_LIBDIR=lib -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} ${PROJECT_BINARY_DIR}/lapackpp-prefix/src/lapackpp
484-
BUILD_COMMAND ${CMAKE_COMMAND} -E env LIBRARY_PATH=$ENV{LIBRARY_PATH}:${PROJECT_BINARY_DIR}/lib LIB_SUFFIX="" make
485-
INSTALL_COMMAND make PREFIX=${PROJECT_BINARY_DIR} LIB_SUFFIX="" install
490+
BUILD_COMMAND ${CMAKE_COMMAND} -E env LIBRARY_PATH=$ENV{LIBRARY_PATH}:${PROJECT_BINARY_DIR}/lib LIB_SUFFIX="" ${CMAKE_COMMAND} --build .
491+
INSTALL_COMMAND ${CMAKE_COMMAND} -E env PREFIX=${PROJECT_BINARY_DIR} LIB_SUFFIX="" ${CMAKE_COMMAND} --install .
486492
)
487493
else ()
488494
# FIXME this does not really work as the libraries list gets converted to a semicolon-separated list somewhere in the lapack++ build files
489495
ExternalProject_Add(lapackpp
490496
URL https://bitbucket.org/icl/lapackpp/downloads/lapackpp-2020.10.02.tar.gz
491497
CONFIGURE_COMMAND env LIBRARY_PATH=$ENV{LIBRARY_PATH}:${CMAKE_BINARY_DIR}/lib LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${PROJECT_BINARY_DIR}/lib ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR} -DCMAKE_INSTALL_LIBDIR=lib -DLAPACK_LIBRARIES="${PROJECT_BINARY_DIR}/lib/liblapack.a -lgfortran" -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} ${PROJECT_BINARY_DIR}/lapackpp-prefix/src/lapackpp
492-
BUILD_COMMAND env LIBRARY_PATH=$ENV{LIBRARY_PATH}:${PROJECT_BINARY_DIR}/lib LIB_SUFFIX="" make
493-
INSTALL_COMMAND make PREFIX=${PROJECT_BINARY_DIR} LIB_SUFFIX="" install
498+
BUILD_COMMAND env LIBRARY_PATH=$ENV{LIBRARY_PATH}:${PROJECT_BINARY_DIR}/lib LIB_SUFFIX="" ${CMAKE_COMMAND} --build .
499+
INSTALL_COMMAND ${CMAKE_COMMAND} -E env PREFIX=${PROJECT_BINARY_DIR} LIB_SUFFIX="" ${CMAKE_COMMAND} --install .
494500
)
495501
endif()
496502
ExternalProject_Add_StepDependencies(lapackpp build blaspp ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
@@ -510,7 +516,7 @@ set(CPACK_MONOLITHIC_INSTALL ON)
510516
set(CPACK_PACKAGE_INSTALL_DIRECTORY "LAPACK")
511517
if(WIN32 AND NOT UNIX)
512518
# There is a bug in NSI that does not handle full unix paths properly. Make
513-
# sure there is at least one set of four (4) backlasshes.
519+
# sure there is at least one set of four (4) backslashes.
514520
set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\http://icl.cs.utk.edu/lapack-forum")
515521
set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.netlib.org/lapack")
516522
set(CPACK_NSIS_CONTACT "[email protected]")

DOCS/lawn81.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ \subsection{Test and Install the Machine-Dependent Routines.}
575575
package, at least three of which must be installed. They are
576576

577577
\begin{tabbing}
578-
MONOMO \= DOUBLE PRECYSION \= \kill
578+
MONOMO \= DOUBLE PRECISION \= \kill
579579
LSAME \> LOGICAL \> Test if two characters are the same regardless of case \\
580580
SLAMCH \> REAL \> Determine machine-dependent parameters \\
581581
DLAMCH \> DOUBLE PRECISION \> Determine machine-dependent parameters \\

INSTALL/test_zcomplexabs.f

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ program zabs
5959
* ..
6060
* .. Local Variables ..
6161
integer i, min, Max, m, subnormalTreatedAs0,
62-
$ caseAFails, caseBFails, caseCFails, caseDFails
62+
$ caseAFails, caseBFails, caseCFails, caseDFails,
63+
$ caseEFails, caseFFails, nFailingTests, nTests
6364
double precision X( N ), R, answerC,
6465
$ answerD, aInf, aNaN, relDiff, b,
6566
$ eps, blueMin, blueMax, Xj, stepX(N), limX(N)
@@ -77,6 +78,10 @@ program zabs
7778
caseBFails = 0
7879
caseCFails = 0
7980
caseDFails = 0
81+
caseEFails = 0
82+
caseFFails = 0
83+
nFailingTests = 0
84+
nTests = 0
8085
*
8186
* .. Initialize machine constants ..
8287
min = MINEXPONENT(0.0d0)
@@ -156,6 +161,7 @@ program zabs
156161
endif
157162
else
158163
do while( Xj .ne. limX(i) )
164+
nTests = nTests + 1
159165
Y = DCMPLX( Xj, 0.0d0 )
160166
R = ABS( Y )
161167
if( R .ne. Xj ) then
@@ -180,6 +186,7 @@ program zabs
180186
endif
181187
else
182188
do while( Xj .ne. limX(i) )
189+
nTests = nTests + 1
183190
Y = DCMPLX( 0.0d0, Xj )
184191
R = ABS( Y )
185192
if( R .ne. Xj ) then
@@ -209,6 +216,7 @@ program zabs
209216
endif
210217
else
211218
do while( Xj .ne. limX(i) )
219+
nTests = nTests + 1
212220
answerC = fiveFourth * Xj
213221
Y = DCMPLX( threeFourth * Xj, Xj )
214222
R = ABS( Y )
@@ -247,6 +255,7 @@ program zabs
247255
print *, "!! [d] fl( subnormal ) may be 0"
248256
endif
249257
else
258+
nTests = nTests + 1
250259
Y = DCMPLX( oneHalf * Xj, oneHalf * Xj )
251260
R = ABS( Y )
252261
relDiff = ABS(R-answerD)/answerD
@@ -267,26 +276,41 @@ program zabs
267276
*
268277
* Test (e) Infs
269278
do 50 i = 1, nInf
279+
nTests = nTests + 1
270280
Y = cInf(i)
271281
R = ABS( Y )
272282
if( .not.(R .gt. HUGE(0.0d0)) ) then
283+
caseEFails = caseEFails + 1
273284
WRITE( *, FMT = 9997 ) 'i',i, Y, R
274285
endif
275286
50 continue
276287
*
277288
* Test (f) NaNs
278289
do 60 i = 1, nNaN
290+
nTests = nTests + 1
279291
Y = cNaN(i)
280292
R = ABS( Y )
281293
if( R .eq. R ) then
294+
caseFFails = caseFFails + 1
282295
WRITE( *, FMT = 9998 ) 'n',i, Y, R
283296
endif
284297
60 continue
285298
*
299+
* If any test fails, displays a message
300+
nFailingTests = caseAFails + caseBFails + caseCFails + caseDFails
301+
$ + caseEFails + caseFFails
302+
if( nFailingTests .gt. 0 ) then
303+
print *, "# ", nTests-nFailingTests, " tests out of ", nTests,
304+
$ " pass for ABS(a+b*I),", nFailingTests, " tests fail."
305+
else
306+
print *, "# All tests pass for ABS(a+b*I)"
307+
endif
308+
*
286309
* If anything was written to stderr, print the message
287310
if( (caseAFails .gt. 0) .or. (caseBFails .gt. 0) .or.
288-
$ (caseCFails .gt. 0) .or. (caseDFails .gt. 0) )
289-
$ print *, "# Please check the failed ABS(a+b*I) in [stderr]"
311+
$ (caseCFails .gt. 0) .or. (caseDFails .gt. 0) ) then
312+
print *, "# Please check the failed ABS(a+b*I) in [stderr]"
313+
endif
290314
*
291315
* .. Formats ..
292316
9997 FORMAT( '[',A1,I1, '] ABS(', (ES8.1,SP,ES8.1,"*I"), ' ) = ',

0 commit comments

Comments
 (0)