Skip to content
Prev Previous commit
Next Next commit
Adds frecursive to Travis; Tries allocating memory dinamically for TE…
…STING/EIG/zchkee.f; Improves CMakeLists.txt
  • Loading branch information
weslleyspereira committed Feb 18, 2021
commit 16e0d403b4a326123c664d9f46e3cf20eefab5da
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ script:
-DLAPACKE:BOOL=ON
-DBUILD_TESTING=ON
-DLAPACKE_WITH_TMG:BOOL=ON
-DCMAKE_Fortran_FLAGS:STRING="-fimplicit-none"
-DCMAKE_Fortran_FLAGS:STRING="-fimplicit-none -frecursive"
${SRC_DIR}
- ctest -D ExperimentalStart
- ctest -D ExperimentalConfigure
Expand Down
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,21 @@ check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag)
# Add recursive flag
if(_recursiveFlag)
string(REGEX MATCH "-recursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
if(NOT output_test)
message(STATUS "Adding recursive flag to CMAKE_Fortran_FLAGS.")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive")
if(NOT output_test)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
elseif(_frecursiveFlag)
string(REGEX MATCH "-frecursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
if(NOT output_test)
message(STATUS "Adding recursive flag to CMAKE_Fortran_FLAGS.")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -frecursive")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -frecursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
elseif(_MrecursiveFlag)
string(REGEX MATCH "-Mrecursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
if(NOT output_test)
message(STATUS "Adding recursive flag to CMAKE_Fortran_FLAGS.")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive")
if(NOT output_test)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
endif()

Expand Down
35 changes: 31 additions & 4 deletions TESTING/EIG/zchkee.f
Original file line number Diff line number Diff line change
Expand Up @@ -1084,12 +1084,17 @@ PROGRAM ZCHKEE
INTEGER INMIN( MAXIN ), INWIN( MAXIN ), INIBL( MAXIN ),
$ ISHFTS( MAXIN ), IACC22( MAXIN )
DOUBLE PRECISION ALPHA( NMAX ), BETA( NMAX ), DR( NMAX, 12 ),
$ RESULT( 500 ), RWORK( LWORK ), S( NMAX*NMAX )
COMPLEX*16 A( NMAX*NMAX, NEED ), B( NMAX*NMAX, 5 ),
$ C( NCMAX*NCMAX, NCMAX*NCMAX ), DC( NMAX, 6 ),
$ TAUA( NMAX ), TAUB( NMAX ), WORK( LWORK ),
$ RESULT( 500 )
COMPLEX*16 DC( NMAX, 6 ), TAUA( NMAX ), TAUB( NMAX ),
$ X( 5*NMAX )
* ..
* .. Allocatable Arrays ..
INTEGER AllocateStatus
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: RWORK
DOUBLE PRECISION, DIMENSION(:,:), ALLOCATABLE :: S
COMPLEX*16, DIMENSION(:), ALLOCATABLE :: WORK
COMPLEX*16, DIMENSION(:,:), ALLOCATABLE :: A, B, C
* ..
* .. External Functions ..
LOGICAL LSAMEN
DOUBLE PRECISION DLAMCH, DSECND
Expand Down Expand Up @@ -1130,6 +1135,21 @@ PROGRAM ZCHKEE
DATA INTSTR / '0123456789' /
DATA IOLDSD / 0, 0, 0, 1 /
* ..
* .. Allocate memory dynamically ..
*
ALLOCATE ( S(NMAX,NMAX), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( A(NMAX,NMAX), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( B(NMAX,NMAX), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( C(NCMAX*NCMAX,NCMAX*NCMAX), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( RWORK(LWORK), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( WORK(LWORK), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
* ..
* .. Executable Statements ..
*
A = 0.0
Expand Down Expand Up @@ -2435,6 +2455,13 @@ PROGRAM ZCHKEE
WRITE( NOUT, FMT = 9994 )
S2 = DSECND( )
WRITE( NOUT, FMT = 9993 )S2 - S1
*
DEALLOCATE (S, STAT = AllocateStatus)
DEALLOCATE (A, STAT = AllocateStatus)
DEALLOCATE (B, STAT = AllocateStatus)
DEALLOCATE (C, STAT = AllocateStatus)
DEALLOCATE (RWORK, STAT = AllocateStatus)
DEALLOCATE (WORK, STAT = AllocateStatus)
*
9999 FORMAT( / ' Execution not attempted due to input errors' )
9997 FORMAT( / / 1X, A3, ': NB =', I4, ', NBMIN =', I4, ', NX =', I4 )
Expand Down