new test for lapack added, all fc tests fixed for PGI Fortran

This commit is contained in:
Miro ILIAS 2015-08-02 13:37:50 +02:00
parent f7b1b854aa
commit 7d192205aa
7 changed files with 76 additions and 2 deletions

View File

@ -1,6 +1,6 @@
language: cpp
install:
- sudo apt-get install g++ cmake gfortran libblas-dev
- sudo apt-get install g++ cmake gfortran libblas-dev liblapack-dev
- sudo pip install pytest pep8
script:
- pep8 --ignore=E501 update.py

View File

@ -1 +1,5 @@
if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
# remove -rdynamic flag offensive to PGI Fortran
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
endif()
add_executable(example example.f90 module.f90)

View File

@ -1,4 +1,10 @@
if(BLAS_FOUND)
if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
# remove -rdynamic flag offensive to PGI Fortran
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
endif()
add_executable(example example.f90)
target_link_libraries(example ${MATH_LIBS})
else()

View File

@ -0,0 +1,20 @@
[project]
name: example
[fc]
source: ../../../modules/fc.cmake
[static]
source: ../../../modules/static_linking.cmake
[int64]
source: ../../../modules/int64.cmake
[math_libs]
source: ../../../modules/math_libs.cmake
[default_build_paths]
source: ../../../modules/default_build_paths.cmake
[src]
source: ../../../modules/src.cmake

View File

@ -0,0 +1,10 @@
if(LAPACK_FOUND)
if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
# remove -rdynamic flag offensive for PGI Fortran
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
endif()
add_executable(example example.F90)
target_link_libraries(example ${MATH_LIBS})
else()
message(FATAL_ERROR "LAPACK/BLAS libraries not found for the test fc_lapack!")
endif()

View File

@ -0,0 +1,24 @@
program example
implicit none
integer, parameter :: n = 3
integer :: info
real(8) :: a(n, n)
real(8) :: b(n)
integer :: ipiv(n)
logical :: roots_ok=.false.
data a /2,1,3,2,6,8,6,8,18/
data b /1,3,5/
call dgesv( n, 1, a, n, ipiv, b, n , info )
if (info.gt.0) stop "error in dgesv routine !"
! roots are -0.5, 0.25, 0.25
roots_ok=dabs(b(1)+0.5).le.1d-12.and.dabs(b(2)-0.25).le.1d-12.and.dabs(b(3)-0.25).le.1d-12
if (roots_ok) then
print *, 'dgesv test ok'
else
stop 'dgesv test failed!'
endif
end program

View File

@ -137,7 +137,17 @@ def test_fc():
def test_fc_blas():
if sys.platform != 'win32':
stdout, stderr = configure_build_and_exe('fc_blas', 'python setup.py --fc=gfortran --blas=auto')
stdout, stderr = configure_build_and_exe('fc_blas', 'python setup.py --fc=gfortran')
assert 'dgemm test ok' in stdout
else:
pass
# ------------------------------------------------------------------------------
def test_fc_lapack():
if sys.platform != 'win32':
stdout, stderr = configure_build_and_exe('fc_lapack', 'python setup.py --fc=gfortran')
assert 'dgesv test ok' in stdout
else:
pass