Skip to content

Commit 83c7e0d

Browse files
authored
Merge pull request #703 from weslleyspereira/explicit-all-conversions
Define conversions explicitly, and use more rigorous flags in the CI
2 parents 7c16bc0 + 9f65664 commit 83c7e0d

Some content is hidden

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

101 files changed

+235
-204
lines changed

.github/workflows/cmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
matrix:
6262
os: [ macos-latest, ubuntu-latest ]
6363
fflags: [
64-
"-fimplicit-none -frecursive -fcheck=all",
65-
"-fimplicit-none -frecursive -fcheck=all -fopenmp" ]
64+
"-Wall -Wno-unused-dummy-argument -Wno-unused-variable -Wno-unused-label -Werror=conversion -fimplicit-none -frecursive -fcheck=all",
65+
"-Wall -Wno-unused-dummy-argument -Wno-unused-variable -Wno-unused-label -Werror=conversion -fimplicit-none -frecursive -fcheck=all -fopenmp" ]
6666

6767
steps:
6868

.github/workflows/makefile.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@ on:
3232
- '!**md'
3333

3434
env:
35-
CFLAGS: "-Wall -pedantic"
36-
FFLAGS: "-fimplicit-none -frecursive -fopenmp -fcheck=all"
35+
CC: "gcc"
36+
FC: "gfortran"
37+
CFLAGS: "-O3 -flto -Wall -pedantic-errors"
38+
FFLAGS: "-O2 -flto -Wall -Werror=conversion -pedantic -fimplicit-none -frecursive -fopenmp -fcheck=all"
39+
FFLAGS_NOOPT: "-O0 -flto -Wall -fimplicit-none -frecursive -fopenmp -fcheck=all"
40+
LDFLAGS: ""
41+
AR: "ar"
42+
ARFLAGS: "cr"
43+
RANLIB: "ranlib"
3744

3845
defaults:
3946
run:
@@ -46,9 +53,19 @@ jobs:
4653
steps:
4754
- name: Checkout LAPACK
4855
uses: actions/checkout@v2
56+
- name: Set configurations
57+
run: |
58+
echo "SHELL = /bin/sh" >> make.inc
59+
echo "FFLAGS_DRV = ${{env.FFLAGS}}" >> make.inc
60+
echo "TIMER = INT_ETIME" >> make.inc
61+
echo "BLASLIB = ${{github.workspace}}/librefblas.a" >> make.inc
62+
echo "CBLASLIB = ${{github.workspace}}/libcblas.a" >> make.inc
63+
echo "LAPACKLIB = ${{github.workspace}}/liblapack.a" >> make.inc
64+
echo "TMGLIB = ${{github.workspace}}/libtmglib.a" >> make.inc
65+
echo "LAPACKELIB = ${{github.workspace}}/liblapacke.a" >> make.inc
66+
echo "DOCSDIR = ${{github.workspace}}/DOCS" >> make.inc
4967
- name: Install
5068
run: |
51-
cp make.inc.example make.inc
5269
make -s -j2 all
5370
make -j2 lapack_install
5471
@@ -57,12 +74,22 @@ jobs:
5774
steps:
5875
- name: Checkout LAPACK
5976
uses: actions/checkout@v2
77+
- name: Set configurations
78+
run: |
79+
echo "SHELL = /bin/sh" >> make.inc
80+
echo "FFLAGS_DRV = ${{env.FFLAGS}}" >> make.inc
81+
echo "TIMER = INT_ETIME" >> make.inc
82+
echo "BLASLIB = ${{github.workspace}}/librefblas.a" >> make.inc
83+
echo "CBLASLIB = ${{github.workspace}}/libcblas.a" >> make.inc
84+
echo "LAPACKLIB = ${{github.workspace}}/liblapack.a" >> make.inc
85+
echo "TMGLIB = ${{github.workspace}}/libtmglib.a" >> make.inc
86+
echo "LAPACKELIB = ${{github.workspace}}/liblapacke.a" >> make.inc
87+
echo "DOCSDIR = ${{github.workspace}}/DOCS" >> make.inc
6088
- name: Alias for GCC compilers
6189
run: |
6290
sudo ln -s $(which gcc-11) /usr/local/bin/gcc
6391
sudo ln -s $(which gfortran-11) /usr/local/bin/gfortran
6492
- name: Install
6593
run: |
66-
cp make.inc.example make.inc
6794
make -s -j2 all
6895
make -j2 lapack_install

BLAS/SRC/cherk.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ SUBROUTINE CHERK(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC)
352352
200 CONTINUE
353353
RTEMP = ZERO
354354
DO 210 L = 1,K
355-
RTEMP = RTEMP + CONJG(A(L,J))*A(L,J)
355+
RTEMP = RTEMP + REAL(CONJG(A(L,J))*A(L,J))
356356
210 CONTINUE
357357
IF (BETA.EQ.ZERO) THEN
358358
C(J,J) = ALPHA*RTEMP
@@ -364,7 +364,7 @@ SUBROUTINE CHERK(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC)
364364
DO 260 J = 1,N
365365
RTEMP = ZERO
366366
DO 230 L = 1,K
367-
RTEMP = RTEMP + CONJG(A(L,J))*A(L,J)
367+
RTEMP = RTEMP + REAL(CONJG(A(L,J))*A(L,J))
368368
230 CONTINUE
369369
IF (BETA.EQ.ZERO) THEN
370370
C(J,J) = ALPHA*RTEMP

BLAS/SRC/sdsdot.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ REAL FUNCTION SDSDOT(N,SB,SX,INCX,SY,INCY)
130130
* ..
131131
DSDOT = SB
132132
IF (N.LE.0) THEN
133-
SDSDOT = DSDOT
133+
SDSDOT = REAL(DSDOT)
134134
RETURN
135135
END IF
136136
IF (INCX.EQ.INCY .AND. INCX.GT.0) THEN
@@ -155,7 +155,7 @@ REAL FUNCTION SDSDOT(N,SB,SX,INCX,SY,INCY)
155155
KY = KY + INCY
156156
END DO
157157
END IF
158-
SDSDOT = DSDOT
158+
SDSDOT = REAL(DSDOT)
159159
RETURN
160160
*
161161
* End of SDSDOT

BLAS/SRC/zherk.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ SUBROUTINE ZHERK(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC)
352352
200 CONTINUE
353353
RTEMP = ZERO
354354
DO 210 L = 1,K
355-
RTEMP = RTEMP + DCONJG(A(L,J))*A(L,J)
355+
RTEMP = RTEMP + DBLE(DCONJG(A(L,J))*A(L,J))
356356
210 CONTINUE
357357
IF (BETA.EQ.ZERO) THEN
358358
C(J,J) = ALPHA*RTEMP
@@ -364,7 +364,7 @@ SUBROUTINE ZHERK(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC)
364364
DO 260 J = 1,N
365365
RTEMP = ZERO
366366
DO 230 L = 1,K
367-
RTEMP = RTEMP + DCONJG(A(L,J))*A(L,J)
367+
RTEMP = RTEMP + DBLE(DCONJG(A(L,J))*A(L,J))
368368
230 CONTINUE
369369
IF (BETA.EQ.ZERO) THEN
370370
C(J,J) = ALPHA*RTEMP

LAPACKE/example/example_DGELS_rowmajor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
int main (int argc, const char * argv[])
6565
{
6666
/* Locals */
67-
double A[5][3] = {1,1,1,2,3,4,3,5,2,4,2,5,5,4,3};
68-
double b[5][2] = {-10,-3,12,14,14,12,16,16,18,16};
67+
double A[5][3] = {{1,1,1},{2,3,4},{3,5,2},{4,2,5},{5,4,3}};
68+
double b[5][2] = {{-10,-3},{12,14},{14,12},{16,16},{18,16}};
6969
lapack_int info,m,n,lda,ldb,nrhs;
7070

7171
/* Initialization */

LAPACKE/src/lapacke_cgesvdq.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ lapack_int LAPACKE_cgesvdq( int matrix_layout, char joba, char jobp,
4848
lapack_int lrwork = -1;
4949
float* rwork = NULL;
5050
float rwork_query;
51-
lapack_int i;
5251
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
5352
LAPACKE_xerbla( "LAPACKE_cgesvdq", -1 );
5453
return -1;

LAPACKE/src/lapacke_dgesvdq.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ lapack_int LAPACKE_dgesvdq( int matrix_layout, char joba, char jobp,
4848
lapack_int lrwork = -1;
4949
double* rwork = NULL;
5050
double rwork_query;
51-
lapack_int i;
5251
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
5352
LAPACKE_xerbla( "LAPACKE_dgesvdq", -1 );
5453
return -1;

LAPACKE/src/lapacke_sgesvdq.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ lapack_int LAPACKE_sgesvdq( int matrix_layout, char joba, char jobp,
4848
lapack_int lrwork = -1;
4949
float* rwork = NULL;
5050
float rwork_query;
51-
lapack_int i;
5251
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
5352
LAPACKE_xerbla( "LAPACKE_sgesvdq", -1 );
5453
return -1;

LAPACKE/src/lapacke_zgesvdq.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ lapack_int LAPACKE_zgesvdq( int matrix_layout, char joba, char jobp,
4848
lapack_int lrwork = -1;
4949
double* rwork = NULL;
5050
double rwork_query;
51-
lapack_int i;
5251
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
5352
LAPACKE_xerbla( "LAPACKE_zgesvdq", -1 );
5453
return -1;

0 commit comments

Comments
 (0)